QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#667505 | #9422. Two-star Contest | Schoolbag | WA | 0ms | 3592kb | C++20 | 1.2kb | 2024-10-22 23:42:02 | 2024-10-22 23:42:02 |
Judging History
answer
#include <algorithm>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef map<int, int> mii;
typedef unordered_map<int, int> umii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vc;
typedef vector<long long> vl;
typedef vector<vector<long long>> vll;
typedef __int128_t int128;
#define rep(x, y, z) for(int x = (y); x <= (z); x++)
#define per(x, y ,z) for(int x = (y); x >= (z); x--)
#define yes cout << "YES\n"
#define no cout << "NO\n"
//#define int long long
//const int N = 1e5 + 5;
//const int mod = 1e9 + 7;
//const ll inf = 1e18;
void solve(){
int n; cin >> n;
int tmp = 0;
rep(i, 0, n - 1){
tmp ^= i;
}
if(tmp == 0){
cout << "impossible\n";
return;
}
vi a;
tmp = 0;
rep(i, 0, n - 1){
if((tmp ^ i) == 0){
a.push_back(i + 1), a.push_back(i);
tmp = tmp ^ i ^ (i + 1);
i++;
}
else{
tmp = tmp ^ i;
a.push_back(i);
}
}
for(int res : a) cout << res << ' ';
cout << '\n';
}
signed main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int __ = 1; cin >> __;
while(__--){
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
5 3 4 5 5 1 3 -1 -1 2 -1 5 -1 5 3 3 -1 -1 4 2 3 10 10000 5 0 -1 1 10 10 10 2 3 10 10 1 2 3 100 4 5 6 2 3 10 100 1 2 3 10 4 5 6 2 3 10000 100 -1 -1 -1 1 -1 -1 -1
output:
1 0 2 impossible 1 0 2 4 3 1 0 2 4 3 impossible
result:
wrong answer Token parameter [name=yesno] equals to "1", doesn't correspond to pattern "Yes|No" (test case 1)