QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189401 | #6762. Hotpot | ucup-team004 | RE | 1ms | 3468kb | C++20 | 916b | 2023-09-27 14:17:13 | 2023-09-27 14:17:13 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n, k, m;
std::cin >> n >> k >> m;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
a[i]--;
}
std::vector<int> have(k), happy(n);
for (int i = 0; i < 2 * n; i++) {
int x = i % n;
happy[x] += have[a[x]];
have[a[x]] ^= 1;
}
for (int i = 0; i < n; i++) {
happy[i] *= m / (2 * n);
}
for (int i = 0; i < m % (2 * n); i++) {
int x = i % n;
happy[i] += have[a[x]];
have[a[x]] ^= 1;
}
for (int i = 0; i < n; i++) {
std::cout << happy[i] << " \n"[i == n - 1];
}
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3468kb
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...