QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#709442 | #6762. Hotpot | KiharaTouma# | WA | 0ms | 3920kb | C++14 | 1.4kb | 2024-11-04 14:46:25 | 2024-11-04 14:46:26 |
Judging History
answer
//qoj6762
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int T, n, k, m, a[N], ans[N];
int pl[N];
int main(){
scanf("%d", &T);
while(T--){
scanf("%d%d%d", &n, &k, &m);
for(int i = 0; i < n; ++ i){
scanf("%d", &a[i]);
}
if(m <= n * 3){
for(int i = 0; i < m; ++ i){
if(pl[a[i%n]]){
++ ans[i%n];
-- pl[a[i%n]];
} else {
++ pl[a[i%n]];
}
}
} else {
for(int i = 0; i < n + n; ++ i){
if(pl[a[i%n]]){
++ ans[i%n];
-- pl[a[i%n]];
} else {
++ pl[a[i%n]];
}
}
int k = m / (n + n);
for(int i = 0; i < n; ++ i){
ans[i] *= k;
}
for(int i = 0; i < m % (n+n); ++ i){
if(pl[a[i%n]]){
++ ans[i%n];
-- pl[a[i%n]];
} else {
++ pl[a[i%n]];
}
}
}
for(int i = 1; i <= k; ++ i) pl[i] = 0;
for(int i = 0; i < n; ++ i){
printf("%d ", ans[i]);
ans[i] = 0;
}
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3920kb
input:
4 3 2 6 1 1 2 1 1 5 1 2 2 10 1 2 2 2 10 1 1
output:
0 2 1 2 2 2 0 5
result:
wrong answer 1st lines differ - expected: '0 2 1', found: '0 2 1 '