# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132224 | amoo_safar | Job Scheduling (CEOI12_jobs) | C++14 | 195 ms | 20236 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>
#define pb push_back
using namespace std;
typedef long long ll;
const int Maxn = 1e5 + 10;
vector<int> rec[Maxn], op[Maxn];
int cnt[Maxn];
int n, m, d;
bool check(int c){
for(int i = 1; i <= n; i++) cnt[i] = rec[i].size();
int p = 1, done = 0, free, rem;
for(int i = 1; i <= n; i++){
p = max(p, i - d);
free = c;
while((p <= i) && (free)){
rem = min(free, cnt[p]);
free -= rem;
cnt[p] -= rem;
done += rem;
if(cnt[p] == 0) p++;
}
}
return (done == m);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |