145612025-01-16 10:06:21AGergoIntervallumXOR kihíváscpp17Wrong answer 30/100467ms5708 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    cin.tie(0);
    iostream::sync_with_stdio(0);

    int q,d; cin >>q;

    for(int i = 0; i < q; i++)
    {
        cin >> d;

        if(d%4 == 0)
        {
            cout << d << " " << pow(2,32-__builtin_clz(d))-1 <<endl;
        }
        else if(d%4 == 1)
        {
            cout << 1 << " " << d << endl;
        }
        else if(d%4 == 2)
        {
            cout << d+1 << " " << pow(2,32-__builtin_clz(d))-1 <<endl;;
        }
        else if(d%4 == 3)
        {
            cout << 0 << " " << d << endl;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
subtask215/15
2Accepted3ms316 KiB
subtask315/15
3Accepted370ms3124 KiB
subtask40/20
4Wrong answer1ms316 KiB
subtask50/50
5Wrong answer467ms5684 KiB
6Wrong answer455ms5708 KiB