Submission #157689

# Submission time Handle Problem Language Result Execution time Memory
157689 2019-10-12T17:58:52 Z a_player Job Scheduling (CEOI12_jobs) C++14
0 / 100
378 ms 7340 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+=T)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);
  for(int i=0;i<M;i++)s[i];
  int x=-1;
  for(int b=M;b>=1;b/=2)
  while(!check(x+b))x+=b;

  cout<<x+1;

}

Compilation message

jobs.cpp: In function 'int main()':
jobs.cpp:17:26: warning: statement has no effect [-Wunused-value]
   for(int i=0;i<M;i++)s[i];
                       ~~~^
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 1016 KB Output isn't correct
2 Incorrect 34 ms 1116 KB Output isn't correct
3 Incorrect 34 ms 1016 KB Output isn't correct
4 Incorrect 34 ms 1016 KB Output isn't correct
5 Incorrect 34 ms 1016 KB Output isn't correct
6 Incorrect 35 ms 1016 KB Output isn't correct
7 Incorrect 35 ms 1016 KB Output isn't correct
8 Incorrect 34 ms 1088 KB Output isn't correct
9 Incorrect 34 ms 888 KB Unexpected end of file - int32 expected
10 Incorrect 34 ms 1016 KB Unexpected end of file - int32 expected
11 Incorrect 44 ms 1016 KB Unexpected end of file - int32 expected
12 Incorrect 86 ms 1852 KB Unexpected end of file - int32 expected
13 Incorrect 129 ms 2680 KB Unexpected end of file - int32 expected
14 Incorrect 203 ms 3744 KB Unexpected end of file - int32 expected
15 Incorrect 214 ms 4216 KB Output isn't correct
16 Incorrect 306 ms 5604 KB Unexpected end of file - int32 expected
17 Incorrect 355 ms 6572 KB Unexpected end of file - int32 expected
18 Incorrect 339 ms 6496 KB Unexpected end of file - int32 expected
19 Incorrect 378 ms 7340 KB Unexpected end of file - int32 expected
20 Incorrect 355 ms 6520 KB Unexpected end of file - int32 expected