# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1059830 |
2024-08-15T08:33:34 Z |
Piokemon |
Lottery (CEOI18_lot) |
C++17 |
|
436 ms |
16472 KB |
#include <iostream>
using namespace std;
constexpr int N = 2000;
short int odp[N+9][N+9];
int a[N+9];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n,l,q,pyt;
cin >> n >> l;
for (int x=1;x<=n;x++) cin >> a[x];
int dist;
for (int x=1;x<=n-l;x++){
for (int y=x+1;y<=n-l+1;y++){
dist=0;
for (int z=0;z<l;z++)dist+=a[x+z]!=a[y+z];
odp[x][dist]++;
odp[y][dist]++;
}
}
for (int x=1;x<=n;x++){
for (int k=1;k<=n;k++)odp[x][k]=odp[x][k]+odp[x][k-1];
}
cin >> q;
while(q--){
cin >> pyt;
for (int x=1;x<=n-l+1;x++) cout << odp[x][pyt] << ' ';
cout << '\n';
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Correct |
1 ms |
2688 KB |
Output is correct |
4 |
Correct |
1 ms |
2652 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
6 |
Correct |
1 ms |
2652 KB |
Output is correct |
7 |
Correct |
1 ms |
2652 KB |
Output is correct |
8 |
Correct |
2 ms |
2652 KB |
Output is correct |
9 |
Correct |
3 ms |
2652 KB |
Output is correct |
10 |
Correct |
1 ms |
2652 KB |
Output is correct |
11 |
Correct |
2 ms |
2652 KB |
Output is correct |
12 |
Correct |
2 ms |
2652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Correct |
1 ms |
2688 KB |
Output is correct |
4 |
Correct |
1 ms |
2652 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
6 |
Correct |
1 ms |
2652 KB |
Output is correct |
7 |
Correct |
1 ms |
2652 KB |
Output is correct |
8 |
Correct |
2 ms |
2652 KB |
Output is correct |
9 |
Correct |
3 ms |
2652 KB |
Output is correct |
10 |
Correct |
1 ms |
2652 KB |
Output is correct |
11 |
Correct |
2 ms |
2652 KB |
Output is correct |
12 |
Correct |
2 ms |
2652 KB |
Output is correct |
13 |
Correct |
20 ms |
8280 KB |
Output is correct |
14 |
Correct |
425 ms |
8344 KB |
Output is correct |
15 |
Correct |
436 ms |
8344 KB |
Output is correct |
16 |
Correct |
257 ms |
8272 KB |
Output is correct |
17 |
Correct |
349 ms |
8272 KB |
Output is correct |
18 |
Correct |
336 ms |
8272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
16472 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
16472 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2652 KB |
Output is correct |
3 |
Correct |
1 ms |
2688 KB |
Output is correct |
4 |
Correct |
1 ms |
2652 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
6 |
Correct |
1 ms |
2652 KB |
Output is correct |
7 |
Correct |
1 ms |
2652 KB |
Output is correct |
8 |
Correct |
2 ms |
2652 KB |
Output is correct |
9 |
Correct |
3 ms |
2652 KB |
Output is correct |
10 |
Correct |
1 ms |
2652 KB |
Output is correct |
11 |
Correct |
2 ms |
2652 KB |
Output is correct |
12 |
Correct |
2 ms |
2652 KB |
Output is correct |
13 |
Correct |
20 ms |
8280 KB |
Output is correct |
14 |
Correct |
425 ms |
8344 KB |
Output is correct |
15 |
Correct |
436 ms |
8344 KB |
Output is correct |
16 |
Correct |
257 ms |
8272 KB |
Output is correct |
17 |
Correct |
349 ms |
8272 KB |
Output is correct |
18 |
Correct |
336 ms |
8272 KB |
Output is correct |
19 |
Runtime error |
7 ms |
16472 KB |
Execution killed with signal 11 |
20 |
Halted |
0 ms |
0 KB |
- |