QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#629195 | #9428. Be Positive | KIRITO1211# | WA | 1ms | 3708kb | C++23 | 859b | 2024-10-11 08:36:50 | 2024-10-11 08:36:50 |
Judging History
answer
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define int long long
using ll = long long;
using i64 = long long;
const int mod = 998244353;
// #define DEBUG
// 线段树合并信息
void solve() {
int n;std::cin>>n;
if(n % 4 == 0 || n == 1){
std::cout<<"impossible\n";
return;
}
int tp = ((n) / 4) * 4 + 1;
std::cout<<tp<<' ';
int res = tp;
for(int i = 0;i < n;i++){
if(i == tp) continue;
res ^= i;
std::cout<<i<<' ';
}
//std::cerr<<res<<'\n';
std::cout<<'\n';
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int t = 1;
// int res = 0;
// for(int i = 1;i <= 1145;i++) res |= i;
// std::cerr<<res<<'\n';
std::cin>>t;
while (t--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3708kb
input:
4 1 2 3 4
output:
impossible 1 0 1 0 2 impossible
result:
ok 4 test cases (4 test cases)
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3668kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
impossible 1 0 1 0 2 impossible 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 6 impossible 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
result:
wrong answer not permutation (test case 5)