# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1026357 |
2024-07-18T02:29:51 Z |
vjudge1 |
Lottery (CEOI18_lot) |
C++17 |
|
399 ms |
63324 KB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
int ans[2005][2005];
int a[2000+5];
int n,l;
void solve(){
for(int q=1;q<=n-l+1;q++){
for(int w=q+1;w<=n-l+1;w++){
int bny=0;
for(int u=1;u<=l;u++){
if(a[q+u-1]!=a[w+u-1]){
bny++;
}
}
for(int r=bny;r<=l;r++){
ans[q][r]++;
ans[w][r]++;
}
}
}
}
signed main(){
cin>>n>>l;
for(int t=1;t<=n;t++){
cin>>a[t];
}
solve();
int q;
cin>>q;
for(int t=1;t<=q;t++){
int b;
cin>>b;
for(int r=1;r<=n-l+1;r++){
cout<<ans[r][b]<<" ";
}
cout<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2492 KB |
Output is correct |
7 |
Correct |
1 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
4588 KB |
Output is correct |
9 |
Correct |
3 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6492 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2492 KB |
Output is correct |
7 |
Correct |
1 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
4588 KB |
Output is correct |
9 |
Correct |
3 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6492 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
13 |
Correct |
17 ms |
31392 KB |
Output is correct |
14 |
Correct |
399 ms |
23124 KB |
Output is correct |
15 |
Correct |
391 ms |
23132 KB |
Output is correct |
16 |
Correct |
270 ms |
29268 KB |
Output is correct |
17 |
Correct |
398 ms |
27228 KB |
Output is correct |
18 |
Correct |
328 ms |
27204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
26 ms |
63324 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
26 ms |
63324 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Correct |
0 ms |
2396 KB |
Output is correct |
5 |
Correct |
1 ms |
2396 KB |
Output is correct |
6 |
Correct |
1 ms |
2492 KB |
Output is correct |
7 |
Correct |
1 ms |
2396 KB |
Output is correct |
8 |
Correct |
2 ms |
4588 KB |
Output is correct |
9 |
Correct |
3 ms |
4444 KB |
Output is correct |
10 |
Correct |
2 ms |
6492 KB |
Output is correct |
11 |
Correct |
2 ms |
6492 KB |
Output is correct |
12 |
Correct |
2 ms |
4444 KB |
Output is correct |
13 |
Correct |
17 ms |
31392 KB |
Output is correct |
14 |
Correct |
399 ms |
23124 KB |
Output is correct |
15 |
Correct |
391 ms |
23132 KB |
Output is correct |
16 |
Correct |
270 ms |
29268 KB |
Output is correct |
17 |
Correct |
398 ms |
27228 KB |
Output is correct |
18 |
Correct |
328 ms |
27204 KB |
Output is correct |
19 |
Runtime error |
26 ms |
63324 KB |
Execution killed with signal 11 |
20 |
Halted |
0 ms |
0 KB |
- |