27302023-01-19 14:37:58kristofIntervallumXOR kihíváscpp11Accepted 100/100488ms2924 KiB
#include <iostream>

using namespace std;

int main()
{
    int32_t N = 0;
    cin >> N;

    int32_t X = 0;
    int32_t Xor = 0;
    int32_t drop = 0;

    for(int i=0;i<N; i++)
    {
        cin >> X;
        if(X%4 == 0) Xor = X;
        if(X%4 == 1) Xor = 1;
        if(X%4 == 2) Xor = X + 1;
        if(X%4 == 3) Xor = 0;

        drop = X;
        if(X%2 == 0)
        {
            while(X != 0)
            {
                X = X>>1 ;
                drop = drop | X;
            }
        }

    cout << Xor << " " << drop << endl;
        


    }

}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1880 KiB
subtask215/15
2Accepted4ms2120 KiB
subtask315/15
3Accepted488ms2340 KiB
subtask420/20
4Accepted2ms2524 KiB
subtask550/50
5Accepted323ms2672 KiB
6Accepted451ms2924 KiB