QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#709460#6762. HotpotKiharaTouma#WA 1ms3768kbC++141.4kb2024-11-04 14:49:472024-11-04 14:49:47

Judging History

你现在查看的是最新测评结果

  • [2024-11-04 14:49:47]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3768kb
  • [2024-11-04 14:49:47]
  • 提交

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 '