# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
93995 | rkocharyan | Job Scheduling (CEOI12_jobs) | C++14 | 162 ms | 13304 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 N = 1e5 + 7;
int n, d, m;
int f[N];
vector <int> g[N];
bool check(int t) {
deque < pair <int, int> > h;
for(int i = 1; i <= n; i++) {
if(f[i]) h.emplace_back(i, f[i]);
int cur_t = t;
while(!h.empty() && cur_t) {
if(i - h[0].first > d) return false;
int next_t = cur_t;
next_t -= min(h[0].second, cur_t);
h[0].second -= min(h[0].second, cur_t);
cur_t = next_t;
if(h[0].second == 0) {
h.pop_front();
}
}
}
if(h.size()) return false;
return true;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |