QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#673194 | #9428. Be Positive | yxfql | WA | 0ms | 3684kb | C++20 | 742b | 2024-10-24 21:00:39 | 2024-10-24 21:00:42 |
Judging History
answer
#include <iostream>
#include <vector>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
if (n % 4 == 0 || n % 4 == 3) {
cout << "impossible" << endl;
} else if (n % 4 == 1) {
// Generate sequence: 1, 2, ..., n-1, 0
for (int i = 1; i < n; i++) {
cout << i << " ";
}
cout << 0 << endl;
} else if (n % 4 == 2) {
// Generate sequence: 1, 0, 2, 3, ..., n-1
cout << "1 0 ";
for (int i = 2; i < n; i++) {
cout << i << " ";
}
cout << endl;
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3684kb
input:
4 1 2 3 4
output:
0 1 0 impossible impossible
result:
wrong answer xor equals zero (test case 1)