Submission #157699

# Submission time Handle Problem Language Result Execution time Memory
157699 2019-10-12T18:08:46 Z a_player Job Scheduling (CEOI12_jobs) C++14
0 / 100
269 ms 632 KB
#include <bits/stdc++.h>

using namespace std;

int N,M,D;
int s[100];
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<<endl;
  int j=0;
  for(int i=0;i<N;i++){
    for(int z=0;z<x+1&&j+z<M;z++)cout<<j+z<<" ";
    cout<<0<<endl;
    j+=x+1;
  }
}
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 376 KB Output isn't correct
2 Incorrect 28 ms 380 KB Output isn't correct
3 Incorrect 28 ms 376 KB Output isn't correct
4 Incorrect 28 ms 376 KB Output isn't correct
5 Incorrect 29 ms 504 KB Output isn't correct
6 Incorrect 28 ms 376 KB Output isn't correct
7 Incorrect 28 ms 376 KB Output isn't correct
8 Incorrect 29 ms 376 KB Output isn't correct
9 Incorrect 269 ms 584 KB Output isn't correct
10 Incorrect 267 ms 632 KB Output isn't correct
11 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Incorrect 3 ms 256 KB Output isn't correct
13 Incorrect 3 ms 256 KB Output isn't correct
14 Incorrect 16 ms 376 KB Output isn't correct
15 Runtime error 2 ms 532 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 3 ms 380 KB Execution killed with signal 11 (could be triggered by violating memory limits)