# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
112870 | Hassoony | Job Scheduling (CEOI12_jobs) | C++17 | 672 ms | 25228 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;
const int MX=2e5+9;
int n,m,d,a[MX],b[MX];
bool check(int mach){
for(int i=1;i<=n;i++)a[i]=b[i];
multiset<int>ms;
int last=0;
for(int i=1;i<=2*n;i++){
mach+=last;
last=0;
while(mach&&!ms.empty()){
if(*ms.begin()<i)return 0;
ms.erase(ms.begin());
mach--;
last++;
}
while(mach&&a[i]){
mach--;
a[i]--;
last++;
}
while(a[i]){
ms.insert(i+d);
a[i]--;
}
}
return 1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |