# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
503897 |
2022-01-09T06:38:43 Z |
Ai7081 |
Lottery (CEOI18_lot) |
C++17 |
|
3000 ms |
8652 KB |
#include <bits/stdc++.h>
using namespace std;
#define N 100005
int n, L, a[N], q, x;
vector<vector<int>> cnt;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> n >> L;
cnt.assign(n-L+5, vector<int>(L+5, 0));
for (int i=1; i<=n; i++) cin >> a[i];
for (int i=1; i<=n-L+1; i++) {
for (int j=1; j<=n-L+1; j++) {
if (i==j) continue;
int c = 0;
for (int k=0; k<L; k++) {
if (a[i+k]!=a[j+k]) c++;
}
cnt[i][c]++;
}
}
for (int i=1; i<=n-L+1; i++) {
for (int j=1; j<=L; j++) {
cnt[i][j] += cnt[i][j-1];
}
}
cin >> q;
while (q--) {
cin >> x;
for (int i=1; i<=n-L+1; i++) cout << cnt[i][x] << ' ';
cout << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
3 ms |
332 KB |
Output is correct |
9 |
Correct |
3 ms |
332 KB |
Output is correct |
10 |
Correct |
2 ms |
332 KB |
Output is correct |
11 |
Correct |
3 ms |
332 KB |
Output is correct |
12 |
Correct |
2 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
3 ms |
332 KB |
Output is correct |
9 |
Correct |
3 ms |
332 KB |
Output is correct |
10 |
Correct |
2 ms |
332 KB |
Output is correct |
11 |
Correct |
3 ms |
332 KB |
Output is correct |
12 |
Correct |
2 ms |
332 KB |
Output is correct |
13 |
Correct |
29 ms |
464 KB |
Output is correct |
14 |
Correct |
517 ms |
3884 KB |
Output is correct |
15 |
Correct |
479 ms |
3884 KB |
Output is correct |
16 |
Correct |
488 ms |
1984 KB |
Output is correct |
17 |
Correct |
374 ms |
2568 KB |
Output is correct |
18 |
Correct |
487 ms |
2580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
843 ms |
1056 KB |
Output is correct |
2 |
Correct |
1399 ms |
1228 KB |
Output is correct |
3 |
Correct |
590 ms |
1152 KB |
Output is correct |
4 |
Execution timed out |
3054 ms |
8652 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
843 ms |
1056 KB |
Output is correct |
2 |
Correct |
1399 ms |
1228 KB |
Output is correct |
3 |
Correct |
590 ms |
1152 KB |
Output is correct |
4 |
Execution timed out |
3054 ms |
8652 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
3 ms |
332 KB |
Output is correct |
9 |
Correct |
3 ms |
332 KB |
Output is correct |
10 |
Correct |
2 ms |
332 KB |
Output is correct |
11 |
Correct |
3 ms |
332 KB |
Output is correct |
12 |
Correct |
2 ms |
332 KB |
Output is correct |
13 |
Correct |
29 ms |
464 KB |
Output is correct |
14 |
Correct |
517 ms |
3884 KB |
Output is correct |
15 |
Correct |
479 ms |
3884 KB |
Output is correct |
16 |
Correct |
488 ms |
1984 KB |
Output is correct |
17 |
Correct |
374 ms |
2568 KB |
Output is correct |
18 |
Correct |
487 ms |
2580 KB |
Output is correct |
19 |
Correct |
843 ms |
1056 KB |
Output is correct |
20 |
Correct |
1399 ms |
1228 KB |
Output is correct |
21 |
Correct |
590 ms |
1152 KB |
Output is correct |
22 |
Execution timed out |
3054 ms |
8652 KB |
Time limit exceeded |
23 |
Halted |
0 ms |
0 KB |
- |