QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#661296#9428. Be PositiveEunoiayWA 0ms3576kbC++20522b2024-10-20 15:40:322024-10-20 15:40:35

Judging History

你现在查看的是最新测评结果

  • [2024-10-20 15:40:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3576kb
  • [2024-10-20 15:40:32]
  • 提交

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)