QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#615075 | #9428. Be Positive | YinyuDream | WA | 0ms | 3576kb | C++20 | 752b | 2024-10-05 17:33:58 | 2024-10-05 17:33:58 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+10;
void solve(){
int n;
cin>>n;
if(n==1||n%4==0){
cout<<-1<<endl;
return;
}
vector<int> ans;
ans.push_back(1);
ans.push_back(0);
int now=2;
while(true){
ans.push_back(now);
ans.push_back(now+2);
ans.push_back(now+1);
ans.push_back(now+3);
now+=4;
if(now>=n){
break;
}
}
while(ans.back()>=n){
ans.pop_back();
}
for(int i=0;i<ans.size();i++){
cout<<ans[i]<<" ";
}
cout<<endl;
}
int main(){
int T;
cin>>T;
while(T--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
4 1 2 3 4
output:
-1 1 0 1 0 2 -1
result:
wrong answer Token parameter [name=first] equals to "-1", doesn't correspond to pattern "[0-9a-z]*" (test case 1)