QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#623881#9428. Be PositiveVamilioWA 0ms3844kbC++14673b2024-10-09 14:17:562024-10-09 14:17:59

Judging History

This is the latest submission verdict.

  • [2024-10-09 14:17:59]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3844kb
  • [2024-10-09 14:17:56]
  • Submitted

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)