27292023-01-19 14:35:07kristofIntervallumXOR kihíváscpp11Wrong answer 0/100500ms2848 KiB
#include <iostream>

using namespace std;

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

    int32_t X = 1;
    int32_t Xor = 1;
    int32_t drop = 1;

    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;

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

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


    }

}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1884 KiB
subtask20/15
2Wrong answer4ms2264 KiB
subtask30/15
3Wrong answer301ms2224 KiB
subtask40/20
4Wrong answer2ms2452 KiB
subtask50/50
5Wrong answer326ms2844 KiB
6Time limit exceeded500ms2848 KiB