QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#709460 | #6762. Hotpot | KiharaTouma# | WA | 1ms | 3768kb | C++14 | 1.4kb | 2024-11-04 14:49:47 | 2024-11-04 14:49:47 |
Judging History
answer
//qoj6762
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 + 10;
int T, n, k, m, a[N], ans[N];
int pl[N];
signed main(){
scanf("%lld", &T);
while(T--){
scanf("%lld%lld%lld", &n, &k, &m);
for(int i = 0; i < n; ++ i){
scanf("%lld", &a[i]);
}
if(m < n + n){
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("%lld ", ans[i]);
ans[i] = a[i] = 0;
}
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
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 '