# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401938 | rainliofficial | Job Scheduling (CEOI12_jobs) | C++11 | 322 ms | 23504 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;
int n, d, m;
bool check(int mid, pair<int, int> arr[]){
int end[mid]; // Tracks when a machine ends its job
for (int i=0; i<mid; i++){
end[i] = 0;
}
int index = 0;
int maxD = 0;
for (int i=0; i<m; i++){
if (index == mid){
index = 0;
}
if (end[index]+1 > arr[i].first){
maxD = max(maxD, end[index]+1-arr[i].first);
end[index]++;
}else{
end[index] = arr[i].first; // No delay
}
index++;
}
return maxD <= d;
}
int main(){
cin.tie(0);ios_base::sync_with_stdio(0);
cin >> n >> d >> m;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |