#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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
632 KB |
Output isn't correct |
2 |
Incorrect |
42 ms |
732 KB |
Output isn't correct |
3 |
Incorrect |
41 ms |
764 KB |
Output isn't correct |
4 |
Incorrect |
41 ms |
760 KB |
Output isn't correct |
5 |
Incorrect |
43 ms |
760 KB |
Output isn't correct |
6 |
Incorrect |
42 ms |
760 KB |
Output isn't correct |
7 |
Incorrect |
43 ms |
760 KB |
Output isn't correct |
8 |
Incorrect |
42 ms |
752 KB |
Output isn't correct |
9 |
Incorrect |
42 ms |
732 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
42 ms |
632 KB |
Unexpected end of file - int32 expected |
11 |
Incorrect |
72 ms |
676 KB |
Unexpected end of file - int32 expected |
12 |
Incorrect |
100 ms |
1184 KB |
Unexpected end of file - int32 expected |
13 |
Incorrect |
153 ms |
1656 KB |
Unexpected end of file - int32 expected |
14 |
Incorrect |
232 ms |
1944 KB |
Unexpected end of file - int32 expected |
15 |
Incorrect |
247 ms |
2304 KB |
Output isn't correct |
16 |
Incorrect |
347 ms |
2680 KB |
Unexpected end of file - int32 expected |
17 |
Incorrect |
406 ms |
3064 KB |
Unexpected end of file - int32 expected |
18 |
Incorrect |
403 ms |
3440 KB |
Unexpected end of file - int32 expected |
19 |
Incorrect |
454 ms |
3784 KB |
Unexpected end of file - int32 expected |
20 |
Incorrect |
416 ms |
3064 KB |
Unexpected end of file - int32 expected |