QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#322293 | #6762. Hotpot | Yarema# | WA | 0ms | 3536kb | C++14 | 1.1kb | 2024-02-06 19:36:49 | 2024-02-06 19:36:50 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
const int N = 100'447;
int cnt[N];
void solve()
{
int n, k, m;
cin >> n >> k >> m;
VI a(n), pos(n);
FOR (i, 0, n)
{
cin >> a[i];
a[i]--;
pos[i] = cnt[a[i]];
cnt[a[i]]++;
}
int cycl = m / n;
VI ans(n);
FOR (i, 0, n)
{
if (cnt[a[i]] & 1)
ans[i] = cycl / 2;
else if (pos[i] & 1)
ans[i] = cycl / 2 * 2;
}
set<int> s;
m -= cycl / 2 * 2 * n;
FOR (i, 0, m)
{
int j = i % n;
if (s.count(a[j]))
{
ans[j]++;
s.erase(a[j]);
}
else
s.insert(a[j]);
}
FOR (i, 0, k)
{
cnt[i] = 0;
}
FOR (i, 0, n)
cout << ans[i] << ' ';
cout << '\n';
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
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 '