# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1028873 |
2024-07-20T09:46:26 Z |
dimasnbayu |
Lottery (CEOI18_lot) |
C++14 |
|
382 ms |
50660 KB |
#include<bits/stdc++.h>
using namespace std;
const int MAX_N=10000+5;
int arr[MAX_N];
short much[MAX_N][MAX_N];
int main(){
int n,l; cin>>n>>l;
for(int i=1;i<=n;i++) cin>>arr[i];
for(int i=1;i<=n-l+1;i++){
for(int j=i+1;j<=n-l+1;j++){
int cnt=0;
for(int k=0;k<l;k++){
if(arr[i+k]!=arr[j+k]) cnt++;
}
much[i][cnt]++;
much[j][cnt]++;
}
}
for(int i=1;i<=n-l+1;i++){
for(int j=0;j<=l;j++){
// cout<<much[i][j]<<" ";
much[i][j]+=much[i][j-1];
}
// cout<<endl;
}
int q; cin>>q;
while(q--){
int x; cin>>x;
for(int i=1;i<=n-l+1;i++) cout<<much[i][x]<<" ";
cout<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
0 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2396 KB |
Output is correct |
5 |
Correct |
0 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
0 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
4584 KB |
Output is correct |
9 |
Correct |
2 ms |
4444 KB |
Output is correct |
10 |
Correct |
3 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
3164 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
0 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2396 KB |
Output is correct |
5 |
Correct |
0 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
0 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
4584 KB |
Output is correct |
9 |
Correct |
2 ms |
4444 KB |
Output is correct |
10 |
Correct |
3 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
3164 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
14 ms |
16476 KB |
Output is correct |
14 |
Correct |
382 ms |
13380 KB |
Output is correct |
15 |
Correct |
348 ms |
14944 KB |
Output is correct |
16 |
Correct |
220 ms |
19536 KB |
Output is correct |
17 |
Correct |
278 ms |
19280 KB |
Output is correct |
18 |
Correct |
380 ms |
17488 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
355 ms |
50660 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
355 ms |
50660 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
2396 KB |
Output is correct |
3 |
Correct |
0 ms |
2396 KB |
Output is correct |
4 |
Correct |
1 ms |
2396 KB |
Output is correct |
5 |
Correct |
0 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2396 KB |
Output is correct |
7 |
Correct |
0 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
4584 KB |
Output is correct |
9 |
Correct |
2 ms |
4444 KB |
Output is correct |
10 |
Correct |
3 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
3164 KB |
Output is correct |
12 |
Correct |
2 ms |
6492 KB |
Output is correct |
13 |
Correct |
14 ms |
16476 KB |
Output is correct |
14 |
Correct |
382 ms |
13380 KB |
Output is correct |
15 |
Correct |
348 ms |
14944 KB |
Output is correct |
16 |
Correct |
220 ms |
19536 KB |
Output is correct |
17 |
Correct |
278 ms |
19280 KB |
Output is correct |
18 |
Correct |
380 ms |
17488 KB |
Output is correct |
19 |
Runtime error |
355 ms |
50660 KB |
Memory limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |