diff --git a/week06/ex3.c b/week06/ex3.c index 956a113..5a5ee13 100644 --- a/week06/ex3.c +++ b/week06/ex3.c @@ -65,8 +65,9 @@ int main() { jd++; } } + for (int i = 0; i < n; ++i) { - if (curt >= p[i].at) { + if (curt >= p[i].at && p[i].used == 0) { ready[qsz++] = i; p[i].used = 1; } @@ -78,7 +79,7 @@ int main() { if (qsz == 0) { for (int i = 0; i < n; ++i) { - if (p[i].used != 0) { + if (p[i].used == 0) { ready[qsz++] = i; p[i].used = 1; curt = p[i].at; diff --git a/week06/ex3.out b/week06/ex3.out index f26b6a8..2c59023 100755 Binary files a/week06/ex3.out and b/week06/ex3.out differ