# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1050137 |
2024-08-09T07:39:09 Z |
anton |
Lottery (CEOI18_lot) |
C++17 |
|
219 ms |
65536 KB |
#include<bits/stdc++.h>
using namespace std;
int N, L, Q;
int dist(vector<int>& a, vector<int>& b){
int d= 0;
for(int i = 0; i<L; i++){
if(a[i]!=b[i]){
d++;
}
}
return d;
}
signed main(){
cin>>N>>L;
vector<int> a(N);
for(int i = 0; i<N; i++){
cin>>a[i];
}
vector<vector<int>> inters;
vector<vector<int>> adj(N-L+1);
for(int i = 0; i<N-L+1; i++){
vector<int> inter;
for(int j = i; j<i+L; j++){
inter.push_back(a[j]);
}
inters.push_back(inter);
}
for(int cur = 0; cur<N-L+1; cur++){
for(int other= cur+1; other<N-L+1; other++){
int d = dist(inters[cur], inters[other]);
adj[cur].push_back(d);
adj[other].push_back(d);
}
}
cin>>Q;
for(int i = 0; i<Q; i++){
int k;
cin>>k;
for(int inter_id= 0; inter_id <N-L+1; inter_id++){
int r =0;
for(auto e: adj[inter_id]){
if(e<=k){
r++;
}
}
cout<<r<<" ";
}
cout<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
860 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
860 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
32 ms |
16752 KB |
Output is correct |
14 |
Correct |
205 ms |
14868 KB |
Output is correct |
15 |
Correct |
219 ms |
14672 KB |
Output is correct |
16 |
Correct |
171 ms |
16468 KB |
Output is correct |
17 |
Correct |
184 ms |
16212 KB |
Output is correct |
18 |
Correct |
188 ms |
16164 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
80 ms |
65536 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
80 ms |
65536 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
2 ms |
604 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
2 ms |
860 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
32 ms |
16752 KB |
Output is correct |
14 |
Correct |
205 ms |
14868 KB |
Output is correct |
15 |
Correct |
219 ms |
14672 KB |
Output is correct |
16 |
Correct |
171 ms |
16468 KB |
Output is correct |
17 |
Correct |
184 ms |
16212 KB |
Output is correct |
18 |
Correct |
188 ms |
16164 KB |
Output is correct |
19 |
Runtime error |
80 ms |
65536 KB |
Execution killed with signal 9 |
20 |
Halted |
0 ms |
0 KB |
- |