/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;

void solve()
{
    int n; cin>>n;
    if(n%4==0){
        cout<<n<<endl;
    }
    else if(n%4==1||n==1){
        cout<<1<<endl;
    }
    else if(n%2==2||n==2){
        cout<<n+1<<endl;
    }
    else cout<<0<<endl;
}

int main(){
    int t; cin>>t;
    while(t--) solve();
}

Information

Submit By
Type
Pretest
Problem
P1009 XOR Love
Language
C++17 (G++ 13.2.0)
Submit At
2024-10-03 14:21:38
Judged At
2024-11-11 02:51:28
Judged By
Score
10
Total Time
1ms
Peak Memory
532.0 KiB