# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
472976 |
2021-09-14T16:42:02 Z |
haru |
Lottery (CEOI18_lot) |
C++14 |
|
355 ms |
16844 KB |
#include <bits/stdc++.h>
#define HARU ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//#define int long long
const int N = 2010;
using namespace std;
int n , l ,q;
int v[N][N];
int ans[N],arr[N];
int32_t main() {
HARU
cin >> n >> l ;
for(int i = 0 ; i < n ; i ++)
cin >> arr[i];
for(int i = 0 ; i < n-l+1 ; i ++)
{
for(int j = i+1 ; j < n-l+1 ; j ++)
{
int cur=0;
for(int p = 0 ; p < l ; p ++) if(arr[i+p] != arr[j+p] ) cur++;
v[i][j]=v[j][i]=cur;
}
}
cin>>q;
while(q--){
int k;
cin>>k;
for(int i = 0 ; i < n-l+1 ; i ++)
{
ans[i]=-1;
for(int j = 0 ; j < n-l+1 ; j++)
{
if(v[i][j]<=k) ans[i]++;
}
cout<<ans[i]<<" ";
}
cout<<'\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
588 KB |
Output is correct |
3 |
Correct |
1 ms |
704 KB |
Output is correct |
4 |
Correct |
1 ms |
460 KB |
Output is correct |
5 |
Correct |
1 ms |
460 KB |
Output is correct |
6 |
Correct |
1 ms |
848 KB |
Output is correct |
7 |
Correct |
1 ms |
588 KB |
Output is correct |
8 |
Correct |
4 ms |
992 KB |
Output is correct |
9 |
Correct |
3 ms |
972 KB |
Output is correct |
10 |
Correct |
4 ms |
1732 KB |
Output is correct |
11 |
Correct |
5 ms |
1740 KB |
Output is correct |
12 |
Correct |
4 ms |
1612 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
588 KB |
Output is correct |
3 |
Correct |
1 ms |
704 KB |
Output is correct |
4 |
Correct |
1 ms |
460 KB |
Output is correct |
5 |
Correct |
1 ms |
460 KB |
Output is correct |
6 |
Correct |
1 ms |
848 KB |
Output is correct |
7 |
Correct |
1 ms |
588 KB |
Output is correct |
8 |
Correct |
4 ms |
992 KB |
Output is correct |
9 |
Correct |
3 ms |
972 KB |
Output is correct |
10 |
Correct |
4 ms |
1732 KB |
Output is correct |
11 |
Correct |
5 ms |
1740 KB |
Output is correct |
12 |
Correct |
4 ms |
1612 KB |
Output is correct |
13 |
Correct |
65 ms |
16064 KB |
Output is correct |
14 |
Correct |
355 ms |
10976 KB |
Output is correct |
15 |
Correct |
346 ms |
10816 KB |
Output is correct |
16 |
Correct |
300 ms |
14332 KB |
Output is correct |
17 |
Correct |
326 ms |
13580 KB |
Output is correct |
18 |
Correct |
337 ms |
13436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
31 ms |
16844 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
31 ms |
16844 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
588 KB |
Output is correct |
3 |
Correct |
1 ms |
704 KB |
Output is correct |
4 |
Correct |
1 ms |
460 KB |
Output is correct |
5 |
Correct |
1 ms |
460 KB |
Output is correct |
6 |
Correct |
1 ms |
848 KB |
Output is correct |
7 |
Correct |
1 ms |
588 KB |
Output is correct |
8 |
Correct |
4 ms |
992 KB |
Output is correct |
9 |
Correct |
3 ms |
972 KB |
Output is correct |
10 |
Correct |
4 ms |
1732 KB |
Output is correct |
11 |
Correct |
5 ms |
1740 KB |
Output is correct |
12 |
Correct |
4 ms |
1612 KB |
Output is correct |
13 |
Correct |
65 ms |
16064 KB |
Output is correct |
14 |
Correct |
355 ms |
10976 KB |
Output is correct |
15 |
Correct |
346 ms |
10816 KB |
Output is correct |
16 |
Correct |
300 ms |
14332 KB |
Output is correct |
17 |
Correct |
326 ms |
13580 KB |
Output is correct |
18 |
Correct |
337 ms |
13436 KB |
Output is correct |
19 |
Runtime error |
31 ms |
16844 KB |
Execution killed with signal 11 |
20 |
Halted |
0 ms |
0 KB |
- |