# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1028797 |
2024-07-20T08:52:33 Z |
dimasnbayu |
Lottery (CEOI18_lot) |
C++14 |
|
390 ms |
9300 KB |
#include<bits/stdc++.h>
using namespace std;
const int MAX_N=2000+5;
int arr[MAX_N],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 |
432 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
600 KB |
Output is correct |
8 |
Correct |
2 ms |
1116 KB |
Output is correct |
9 |
Correct |
2 ms |
1116 KB |
Output is correct |
10 |
Correct |
2 ms |
1464 KB |
Output is correct |
11 |
Correct |
2 ms |
1372 KB |
Output is correct |
12 |
Correct |
3 ms |
1372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
432 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
600 KB |
Output is correct |
8 |
Correct |
2 ms |
1116 KB |
Output is correct |
9 |
Correct |
2 ms |
1116 KB |
Output is correct |
10 |
Correct |
2 ms |
1464 KB |
Output is correct |
11 |
Correct |
2 ms |
1372 KB |
Output is correct |
12 |
Correct |
3 ms |
1372 KB |
Output is correct |
13 |
Correct |
14 ms |
8492 KB |
Output is correct |
14 |
Correct |
369 ms |
9148 KB |
Output is correct |
15 |
Correct |
390 ms |
9300 KB |
Output is correct |
16 |
Correct |
235 ms |
9044 KB |
Output is correct |
17 |
Correct |
316 ms |
9224 KB |
Output is correct |
18 |
Correct |
305 ms |
9296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
432 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
600 KB |
Output is correct |
8 |
Correct |
2 ms |
1116 KB |
Output is correct |
9 |
Correct |
2 ms |
1116 KB |
Output is correct |
10 |
Correct |
2 ms |
1464 KB |
Output is correct |
11 |
Correct |
2 ms |
1372 KB |
Output is correct |
12 |
Correct |
3 ms |
1372 KB |
Output is correct |
13 |
Correct |
14 ms |
8492 KB |
Output is correct |
14 |
Correct |
369 ms |
9148 KB |
Output is correct |
15 |
Correct |
390 ms |
9300 KB |
Output is correct |
16 |
Correct |
235 ms |
9044 KB |
Output is correct |
17 |
Correct |
316 ms |
9224 KB |
Output is correct |
18 |
Correct |
305 ms |
9296 KB |
Output is correct |
19 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
20 |
Halted |
0 ms |
0 KB |
- |