# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
951625 | doducanh | Job Scheduling (CEOI12_jobs) | C++17 | 1002 ms | 28244 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;
#define ii pair<int,int>
#define fi first
#define se second
const int maxn=1e5+7;
vector<int>a[maxn];
vector<int>ans[maxn];
vector<int>ress[maxn];
int n,d,m;
bool check(int x)
{
priority_queue<ii,vector<ii>,greater<ii>>q;
for(int i=1;i<=n;i++)ans[i].clear();
for(int i=1;i<=n;i++){
for(int x:a[i])q.push({i,x});
while(ans[i].size()<x&&q.size()){
if(i-q.top().fi>d)return false;
ans[i].push_back(q.top().se);
q.pop();
}
}
if(q.size())return false;
for(int i=1;i<=n;i++){
ress[i].clear();
for(int x:ans[i])ress[i].push_back(x);
}
return true;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |