# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752756 | Mo_Huzaifa | Job Scheduling (CEOI12_jobs) | C++14 | 541 ms | 40668 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
i64 const &N_ = 1e5 + 500;
i64 const &M_ = 1e6 + 500;
i64 N, D, M;
vector < i64 > arr_M(M_);
vector < i64 > ans[N_];
vector < pair < i64, i64 >> DAYS;
bool check(i64 machine) {
i64 d = 0;
i64 cnt = 0;
for (i64 i = 0; i < (i64) DAYS.size(); ) {
i64 j = i;
bool ok = false;
i64 val = max(DAYS[i].first, d + 1);
for (i64 cnt_ = 0; j < M and DAYS[j].first < val + 1 and DAYS[j].first >= val - D and cnt_ < machine; ++ cnt_, ++ j) {
// Let it be
cnt ++;
ok = true;
}
if (! ok) return false;
i = j;
d = val;
}
return cnt == M;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |