# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
462469 | dqk | Job Scheduling (CEOI12_jobs) | C++17 | 984 ms | 56900 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>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int N, D, M;
std::cin >> N >> D >> M;
std::vector<std::vector<int>> a(M, std::vector<int>(2));
for (int i = 0; i < M; ++i) {
std::cin >> a[i][0];
a[i][1] = i + 1;
}
sort(a.begin(), a.end());
int lo = 1, hi = M;
while (lo < hi) {
int mi = (lo + hi) / 2;
bool ok = true;
for (int i = 1, j = 0; i <= N && ok; ++i) {
int tot = 0;
while (tot < mi && j < M && ok) {
if (a[j][0] + D < i)
ok = false;
else if (i >= a[j][0]) {
tot++;
j++;
}
else {
break;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |