#include <bits/stdc++.h>
using namespace std;
#define ll long long
using namespace std;
const int mx=100009;
int sum[mx];
int ans[mx];
int main() {
int n,d,m;
cin>>n>>d>>m;
for(int i=0;i<m;i++){
int x;cin>>x;
sum[x]++;
}vector<ll>v[mx];
for(int i=1;i<=n;i++){
//cout<<sum[i];
}//return 0;
for(int i=1;i<=n;i++){
if(sum[i]){
multiset<pair<int,int>> q;
for(int j=i;j<=i+d;j++){
q.insert({ans[j],j});
}
while(sum[i]--){
auto o=q.begin();
int z=(*o).first;
q.erase(q.find(*o));
ans[(*o).second]++;
z++;
q.insert({z,(*o).second});
}
}
}int anss=0;
for(int i=1;i<=n;i++){
anss=max(ans[i],anss);
}
cout<<anss<<endl;
for (int i = 0; i < n; i++)
cout << "0\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
2936 KB |
Output is correct |
2 |
Correct |
49 ms |
2936 KB |
Output is correct |
3 |
Correct |
58 ms |
3064 KB |
Output is correct |
4 |
Correct |
48 ms |
2936 KB |
Output is correct |
5 |
Correct |
45 ms |
2936 KB |
Output is correct |
6 |
Correct |
58 ms |
2936 KB |
Output is correct |
7 |
Correct |
49 ms |
2976 KB |
Output is correct |
8 |
Correct |
51 ms |
3064 KB |
Output is correct |
9 |
Incorrect |
43 ms |
3096 KB |
Output isn't correct |
10 |
Incorrect |
44 ms |
3064 KB |
Output isn't correct |
11 |
Incorrect |
53 ms |
3064 KB |
Output isn't correct |
12 |
Incorrect |
107 ms |
3448 KB |
Output isn't correct |
13 |
Incorrect |
146 ms |
3832 KB |
Output isn't correct |
14 |
Execution timed out |
1094 ms |
4836 KB |
Time limit exceeded |
15 |
Incorrect |
229 ms |
4600 KB |
Output isn't correct |
16 |
Incorrect |
346 ms |
5752 KB |
Output isn't correct |
17 |
Incorrect |
477 ms |
6136 KB |
Output isn't correct |
18 |
Incorrect |
374 ms |
5880 KB |
Output isn't correct |
19 |
Incorrect |
424 ms |
6252 KB |
Output isn't correct |
20 |
Incorrect |
465 ms |
6136 KB |
Output isn't correct |