QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#709442#6762. HotpotKiharaTouma#WA 0ms3920kbC++141.4kb2024-11-04 14:46:252024-11-04 14:46:26

Judging History

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

  • [2024-11-04 14:46:26]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3920kb
  • [2024-11-04 14:46:25]
  • 提交

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 '