2730 | 2023-01-19 14:37:58 | kristof | IntervallumXOR kihívás | cpp11 | Accepted 100/100 | 488ms | 2924 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;
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1880 KiB | ||||
subtask2 | 15/15 | ||||||
2 | Accepted | 4ms | 2120 KiB | ||||
subtask3 | 15/15 | ||||||
3 | Accepted | 488ms | 2340 KiB | ||||
subtask4 | 20/20 | ||||||
4 | Accepted | 2ms | 2524 KiB | ||||
subtask5 | 50/50 | ||||||
5 | Accepted | 323ms | 2672 KiB | ||||
6 | Accepted | 451ms | 2924 KiB |