# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
397139 |
2021-05-01T14:16:58 Z |
ollel |
Lottery (CEOI18_lot) |
C++17 |
|
3000 ms |
65540 KB |
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
int n, l;
vi arr;
vvi ksim;
vvi difs;
void precomp()
{
rep(seq,0,n-l+1) {
rep(i,0,l) {
rep(seq2, 0, n-l+1) {
if (seq == seq2) continue;
if (arr[seq + i] != arr[seq2 + i]) difs[seq][seq2]++;
}
}
}
rep(i, 0, n-l+1) {
rep(j, 0, n-l+1) {
if (i == j) continue;
ksim[i].pb(difs[i][j]);
}
}
rep(i,0,n-l+1) sort(ksim[i].begin(), ksim[i].end());
}
int main()
{
cin>>n>>l;
arr.resize(n);
rep(i,0,n) cin>>arr[i];
difs.resize(n); rep(i,0,n-l+1) difs[i].assign(n-l+1, 0);
ksim.resize(n);
precomp();
int q, k;
cin >> q;
rep(i,0,q) {
cin >> k;
rep(i, 0, n-l+1) {
int x = upper_bound(ksim[i].begin(), ksim[i].end(), k) - ksim[i].begin();
cout << x << " ";
}
cout << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
332 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
332 KB |
Output is correct |
7 |
Correct |
2 ms |
336 KB |
Output is correct |
8 |
Correct |
14 ms |
460 KB |
Output is correct |
9 |
Correct |
13 ms |
460 KB |
Output is correct |
10 |
Correct |
9 ms |
1100 KB |
Output is correct |
11 |
Correct |
8 ms |
1100 KB |
Output is correct |
12 |
Correct |
11 ms |
1100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
332 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
332 KB |
Output is correct |
7 |
Correct |
2 ms |
336 KB |
Output is correct |
8 |
Correct |
14 ms |
460 KB |
Output is correct |
9 |
Correct |
13 ms |
460 KB |
Output is correct |
10 |
Correct |
9 ms |
1100 KB |
Output is correct |
11 |
Correct |
8 ms |
1100 KB |
Output is correct |
12 |
Correct |
11 ms |
1100 KB |
Output is correct |
13 |
Correct |
158 ms |
32068 KB |
Output is correct |
14 |
Execution timed out |
3065 ms |
7372 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
40 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
40 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
332 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
6 |
Correct |
2 ms |
332 KB |
Output is correct |
7 |
Correct |
2 ms |
336 KB |
Output is correct |
8 |
Correct |
14 ms |
460 KB |
Output is correct |
9 |
Correct |
13 ms |
460 KB |
Output is correct |
10 |
Correct |
9 ms |
1100 KB |
Output is correct |
11 |
Correct |
8 ms |
1100 KB |
Output is correct |
12 |
Correct |
11 ms |
1100 KB |
Output is correct |
13 |
Correct |
158 ms |
32068 KB |
Output is correct |
14 |
Execution timed out |
3065 ms |
7372 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |