QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#661296 | #9428. Be Positive | Eunoiay | WA | 0ms | 3576kb | C++20 | 522b | 2024-10-20 15:40:32 | 2024-10-20 15:40:35 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
int n;
cin >> n;
if (n == 1 || n % 4 == 0) {
cout << "impossible\n";
return;
}
vector<int> o(n);
iota(o.begin(), o.end(), 0);
for (int i = 3; i < n; i += 4) {
swap(o[i], o[i - 1]);
}
for (int i = 0; i < n; i++) {
cout << o[i] << " \n"[i == n - 1];
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
4 1 2 3 4
output:
impossible 0 1 0 1 2 impossible
result:
wrong answer xor equals zero (test case 2)