# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
962905 |
2024-04-14T09:34:26 Z |
LucaIlie |
Lottery (CEOI18_lot) |
C++17 |
|
2 ms |
604 KB |
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2000;
int v[MAX_N], diff[MAX_N][MAX_N], good[MAX_N][MAX_N + 1];
int main() {
int n, k;
cin >> n >> k;
for ( int i = 0; i < n; i++ )
cin >> v[i];
for ( int i = 0; i < n; i++ ) {
for ( int j = i + 1; j < n; j++ ) {
if ( v[i] == v[j] )
continue;
int l = min( k, i + 1 );
for ( int o = 0; o < l; o++ )
diff[i - o][j - o]++;
}
}
for ( int i = 0; i < n; i++ ) {
for ( int j = i + 1; j < n; j++ ) {
good[i][diff[i][j]]++;
good[j][diff[i][j]]++;
}
}
for ( int i = 0; i < n; i++ ) {
for ( int j = 1; j <= n; j++ )
good[i][j] += good[i][j - 1];
}
int q;
cin >> q;
while ( q-- ) {
int m;
cin >> m;
for ( int i = 0; i <= n - k; i++ )
cout << good[i][m] - 1 << " ";
cout << "\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
448 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
448 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
448 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |