/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Accepted 3ms 600.0 KiB
#3 Accepted 3ms 512.0 KiB
#4 Accepted 3ms 604.0 KiB
#5 Accepted 13ms 896.0 KiB
#6 Accepted 4ms 616.0 KiB
#7 Accepted 19ms 1.105 MiB
#8 Accepted 20ms 1.418 MiB

Code

#include <bits/stdc++.h>
//#define int long long
#define ll long long
#define ull unsigned long long
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define max_ele(v) *max_element(v.begin(), v.end())
#define min_ele(v) *min_element(v.begin(), v.end())
#define SORT(v) sort(v.begin(), v.end())
#define REVERSE(v) reverse(v.begin(), v.end())
#define REV_SORT(v) sort((v).begin(), (v).end(), greater<>())
#define vint vector<int>
#define vll vector<ll>
#define vch vector<char>
#define vstr vector<string>
#define vcust vector<custom>
#define u_set unordered_set
#define sint set<int>
#define sll set<ll>
#define sch set<char>
#define u_map unordered_map
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define mii map<int, int>
#define mll map<ll, ll>
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define setbit(x) __builtin_popcount(x)
#define lead_zero(x) __builtin_clz(x)
#define trail_zero(x) __builtin_ctz(x)
#define coutall(v) for(auto &&it : v) cout<<it<<" "
#define coutnl(v) for(auto &&it : v) cout<<it<<'\n'
#define cinall(v) for(auto &&it : v) cin >> it
using namespace std;
const ll Inf = LLONG_MAX >> 1;
const int mod = 1e9 + 7;

void debug_mode() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

struct custom {
    int a;
    char b;
    string c;
};

bool isPrime(int num) {
    if (num <= 1) return false;
    for (int i = 2; i * i <= num; ++i) {
        if (num % i == 0) return false;
    }
    return true;
}

bool power_of_two(int n) {
    if (n == 0)
        return false;
    return !(n & (n - 1));
}

int msb_set(int n) {
    int pos = -1;
    while (n) {
        pos++;
        n >>= 1;
    }
    return pos;
}

bool is_set(int n, int i) {
    return (n & (1 << i));
}

void solve();

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
//    debug_mode();
    // fileIO();
    int TestCase = 1;
    cin >> TestCase;
    int case_no = 1;
    while (TestCase--) {
        // cout << "Case " << case_no << ": ";
        solve();
        case_no++;
        // cout << '\n';
    }
    return 0;
}

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

Information

Submit By
Type
Submission
Problem
P1009 XOR Love
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-04 04:02:57
Judged At
2024-03-04 15:29:10
Judged By
Score
100
Total Time
20ms
Peak Memory
1.418 MiB