QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#523735#6762. Hotpot18953267621RE 0ms3840kbC++141.2kb2024-08-18 17:14:282024-08-18 17:14:29

Judging History

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

  • [2024-08-18 17:14:29]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3840kb
  • [2024-08-18 17:14:28]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e6 + 5;
int n, k, m;
void solve()
{
   cin >> n >> k >> m;
    vector<int> cnt(2*n+5);
    vector<int> man(2*n+5);
    vector<int> a(2*n + 5);


    
    
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        
    }
    int y = m / (n*2);
    if (y >= 1)
    {
        for (int i = 0; i < n * 2; i++)
        {

             if (cnt[a[i%n]] == 0) cnt[a[i%n]]++;
             else
             {
                cnt[a[i%n]]--;
                man[i%n]++;
             }
        }
        for (int i = 0; i < n; i++)
        {
            man[i] = man[i] * y;
        }


    }
    int u = m % (n*2);
    for (int i = 0; i < u; i++)
    {

        if (cnt[a[i % n]] == 0) cnt[a[i % n]]++;
        else
        {
            cnt[a[i % n]]--;
            man[i % n]++;
        }
    }

    

    for (int i = 0; i < n; i++)
    {
        if(i==0) cout << man[i];
        else  cout <<" "<< man[i];
    }
    cout << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >>t;
    while (t--)solve();
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3840kb

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:

ok 4 lines

Test #2:

score: -100
Runtime Error

input:

1000
2 73 291100997
46 23
40 2 11764377
1 2 2 2 1 2 2 2 1 2 2 2 2 1 1 1 2 2 2 1 2 2 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 2 1 1
29 20 781370886
4 9 7 4 10 4 1 6 19 15 20 9 20 18 7 4 7 13 18 4 13 13 10 15 15 9 20 5 3
53 95 911403367
44 41 65 63 37 8 15 9 47 83 44 91 23 89 59 60 5 19 77 24 73 35 30 79 1 94 92...

output:

72775249 72775249
147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147054 147054 147055 147054 147055 147054 147055 147054 147055 147054 147055 147054 147055 147054 147055 147055 147054 147054 147055 147054 147055 147054
13...

result: