# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
455179 | inluminas | Job Scheduling (CEOI12_jobs) | C++14 | 296 ms | 65536 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 ll long long
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false)
const int lmt=1e6+10;
vector<int>adj[lmt],res[lmt];
int n,d,m,cnt[lmt];
int main(){
fastio;
cin>>n>>d>>m;
for(int i=1;i<=m;i++){
int a;
cin>>a;
adj[a].push_back(i);
cnt[a]++;
}
int lo=1,hi=m;
while(lo<hi){
int mid=(lo+hi)>>1,ache[lmt]={0},cur=1,bad=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=cnt[i];j++){
while(cur<i || ache[cur]==mid) cur++;
if(cur-i>d){
bad=1;
break;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |