QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#676176 | #9428. Be Positive | LianYan | WA | 0ms | 3688kb | C++20 | 638b | 2024-10-25 20:34:09 | 2024-10-25 20:34:10 |
Judging History
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)