QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623881 | #9428. Be Positive | Vamilio | WA | 0ms | 3844kb | C++14 | 673b | 2024-10-09 14:17:56 | 2024-10-09 14:17:59 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+100;
#define gc getchar()
#define rd read()
inline int read(){
int x=0,f=0; char c=gc;
for(;c<'0'||c>'9';c=gc) f|=(c=='-');
for(;c>='0'&&c<='9';c=gc) x=(x<<1)+(x<<3)+(c^48);
return f?-x:x;
}
int n,a[N];
inline int chk(){
for(int i=0,lst=0;i<n;++i){
lst^=a[i];
if(!lst) return 1;
}
return 0;
}
void solve(){
n=rd; if(n==1) return printf("impossible\n"),void();
a[0]=1,a[1]=0; for(int i=2;i<n;++i) a[i]=i;
if(chk()) printf("impossible\n");
else{ for(int i=0;i<n;++i) printf("%d ", a[i]); puts(""); }
}
int main(){
int T=rd;
while(T--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3844kb
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: 0ms
memory: 3808kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
impossible 1 0 1 0 2 impossible impossible impossible impossible impossible impossible impossible
result:
wrong answer Jury has the answer but participant has not (test case 5)