Submission #157695

# Submission time Handle Problem Language Result Execution time Memory
157695 2019-10-12T18:04:40 Z a_player Job Scheduling (CEOI12_jobs) C++14
0 / 100
808 ms 10304 KB
#include <bits/stdc++.h>

using namespace std;

int N,M,D;
int s[1000001];
bool check(int T){
  if(T>=M)return true;
  if(T==0)return false;
    for(int i=0;i<M;i++)if(s[i]+D<i/T+1)return false;
     return true;
}
int main(){
  cin>>N>>D>>M;
  for(int i=0;i<M;i++)cin>>s[i];
  sort(s,s+M);
  int x=-1;
  for(int b=M;b>=1;b/=2)
  while(!check(x+b))x+=b;

  cout<<x+1;
  for(int i=0;i<M;i++)cout<<i<<" ";
  cout<<0<<endl;
  for(int i=1;i<N;i++)cout<<0<<endl;

}
# Verdict Execution time Memory Grader output
1 Incorrect 78 ms 1400 KB Expected EOLN
2 Incorrect 79 ms 1272 KB Expected EOLN
3 Incorrect 80 ms 1400 KB Expected EOLN
4 Incorrect 77 ms 1400 KB Expected EOLN
5 Incorrect 80 ms 1272 KB Expected EOLN
6 Incorrect 78 ms 1400 KB Expected EOLN
7 Incorrect 79 ms 1400 KB Expected EOLN
8 Incorrect 78 ms 1372 KB Expected EOLN
9 Incorrect 320 ms 1548 KB Expected EOLN
10 Incorrect 317 ms 1616 KB Expected EOLN
11 Incorrect 63 ms 1272 KB Expected EOLN
12 Incorrect 124 ms 2424 KB Expected EOLN
13 Incorrect 182 ms 3448 KB Expected EOLN
14 Incorrect 308 ms 4692 KB Expected EOLN
15 Incorrect 307 ms 5676 KB Expected EOLN
16 Incorrect 443 ms 6776 KB Expected EOLN
17 Incorrect 514 ms 7928 KB Expected EOLN
18 Incorrect 512 ms 8996 KB Expected EOLN
19 Incorrect 808 ms 10304 KB Expected EOLN
20 Incorrect 514 ms 7928 KB Expected EOLN