QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#600525 | #8838. Jesse's Job | xydCatGirl# | WA | 0ms | 3552kb | C++14 | 701b | 2024-09-29 17:08:12 | 2024-09-29 17:08:14 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
constexpr int N = 2e5 + 5;
int T, n;
int p[N], q[N];
void solve() {
std::cin >> n; int ans1 = 0, ans2 = 0, max = 0;
for (int i = 1; i <= n; i++) std::cin >> p[i], q[p[i]] = i;
for (int i = 1; i <= n; i++) max = std::max(max, p[i]), ans1 += p[i] == max;
max = 0;
for (int i = 1; i <= n; i++) max = std::max(max, q[i]), ans2 += q[i] == max;
if (ans1 > ans2) for (int i = 1; i <= n; i++) std::cout << i << " \n"[i == n];
else for (int i = 1; i <= n; i++) std::cout << q[i] << " \n"[i == n];
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cin >> T;
while (T--) solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3552kb
input:
3 2 2 1 4 2 1 4 3 6 3 5 4 2 6 1
output:
2 1 2 1 4 3 1 2 3 4 5 6
result:
wrong answer Participant didn't find permutation (test case 1)