QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#676176#9428. Be PositiveLianYanWA 0ms3688kbC++20638b2024-10-25 20:34:092024-10-25 20:34:10

Judging History

This is the latest submission verdict.

  • [2024-10-25 20:34:10]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3688kb
  • [2024-10-25 20:34:09]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6 + 10;
int a[N];
void solve()
{
    int n;
    cin >> n;
    if (n % 4 == 0)
    {
        cout << "impossible" << endl;
        return;
    }

    for (int i = 0; i < n; i++)
    {
        a[i] = i;
    }
    a[0] = 1;
    a[1] = 0;
    int t = 4;
    while (t < n)
    {
        a[t] = t - 1;
        a[t - 1] = t;
        t += 4;
    }
    for (int i = 0; i < n; i++)
        cout << a[i] << " ";
    cout << endl;
}

signed main()
{
    int T = 1;
    cin >> T;
    while (T--)
    {
        solve();
    }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3688kb

input:

4
1
2
3
4

output:

1 
1 0 
1 0 2 
impossible

result:

wrong answer not permutation (test case 1)