QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#615075#9428. Be PositiveYinyuDreamWA 0ms3576kbC++20752b2024-10-05 17:33:582024-10-05 17:33:58

Judging History

你现在查看的是最新测评结果

  • [2024-10-05 17:33:58]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3576kb
  • [2024-10-05 17:33:58]
  • 提交

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)