# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
259956 | 2020-08-08T21:01:10 Z | peuch | Lottery (CEOI18_lot) | C++17 | 539 ms | 65540 KB |
#include<bits/stdc++.h> using namespace std; const int MAXN = 10010; int n, l, q; int v[MAXN]; int freq[MAXN]; map<vector<int>, int> code; int cnt; int main(){ scanf("%d %d", &n, &l); for(int i = 1; i <= n; i++) scanf("%d", &v[i]); int fim = 1; vector<int> aux; vector<int> values; while(fim < l){ aux.push_back(v[fim]); fim++; } while(fim <= n){ aux.push_back(v[fim]); fim++; if(code[aux] == 0) code[aux] = ++cnt; freq[code[aux]]++; values.push_back(code[aux]); for(int i = 0; i < l - 1; i++) swap(aux[i], aux[i + 1]); aux.pop_back(); } scanf("%d", &q); for(int i = 1; i <= q; i++){ int k; scanf("%d", &k); for(int i = 0; i < values.size(); i++) printf("%d ", freq[values[i]] - 1); printf("\n"); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 512 KB | Output is correct |
2 | Correct | 5 ms | 512 KB | Output is correct |
3 | Correct | 8 ms | 640 KB | Output is correct |
4 | Correct | 31 ms | 2432 KB | Output is correct |
5 | Runtime error | 539 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 512 KB | Output is correct |
2 | Correct | 5 ms | 512 KB | Output is correct |
3 | Correct | 8 ms | 640 KB | Output is correct |
4 | Correct | 31 ms | 2432 KB | Output is correct |
5 | Runtime error | 539 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 1 ms | 384 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |