# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975669 | vjudge1 | Job Scheduling (CEOI12_jobs) | C++17 | 425 ms | 17336 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m, d;
vector< pair<int,int> > jobs;
bool isok(int x) {//each day can process x jobs.
int j = 0;
for (int i = 1; i <= n; i++) {
int count = x;
while (j < m && jobs[j].first <= i && count > 0) {
if (i - jobs[j].first > d) return false;
j++;
count--;
}
}
return j == m;
}
int main() {
cin >> n >> d >> m;
jobs = vector< pair<int,int> >(m);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |