QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#559423 | #8835. Goodman | snow# | WA | 0ms | 3548kb | C++23 | 881b | 2024-09-11 21:59:36 | 2024-09-11 21:59:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
ll a[n + 1] = {0},b[n+1]={0},c[n+1]={0};
map<ll, ll> mp;
map<ll, ll> p;
for (ll i = 1; i <= n; i++)
{
cin >> a[i];
b[a[i]]=i;
}
for(ll i=1;i<=n;i++)
{
if(a[i]==i)
cout<<i;
}
for(ll i=1;i<=n;i++)
{
if(a[i]!=i&&c[i]==0)
{
cout<<i;
c[i]=1;
if(c[b[i]]==0)
{
cout<<b[i];
c[b[i]]=1;
}
}
}
cout<<'\n';
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3548kb
input:
2 4 1 2 3 4 6 6 5 4 3 2 1
output:
1234 162534
result:
wrong answer Integer parameter [name=q] equals to 1234, violates the range [1, 4] (test case 1)