2729 | 2023-01-19 14:35:07 | kristof | IntervallumXOR kihívás | cpp11 | Wrong answer 0/100 | 500ms | 2848 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;
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1884 KiB | ||||
subtask2 | 0/15 | ||||||
2 | Wrong answer | 4ms | 2264 KiB | ||||
subtask3 | 0/15 | ||||||
3 | Wrong answer | 301ms | 2224 KiB | ||||
subtask4 | 0/20 | ||||||
4 | Wrong answer | 2ms | 2452 KiB | ||||
subtask5 | 0/50 | ||||||
5 | Wrong answer | 326ms | 2844 KiB | ||||
6 | Time limit exceeded | 500ms | 2848 KiB |