Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* e319 - 1 */
- /* AC (0.4s, 108KB) */
- #pragma warning( disable : 4996 )
- #include <cstdio>
- #include <cstdint>
- #include <cmath>
- #include <algorithm>
- using namespace std;
- using int16 = short;
- using uint16 = unsigned short;
- using uint = unsigned int;
- using int64 = long long;
- using uint64 = unsigned long long;
- using pii = pair<int, int>;
- /* main code */
- int N, result = 0, x;
- int bit[33]{}, i;
- int main()
- {
- scanf("%d", &N);
- while (N-- && scanf("%d", &x))
- {
- i = 0;
- bit[32] += (x < 0);
- x = abs(x);
- while (x)
- bit[i++] += x & 1, x >>= 1;
- }
- for (i = 0; i < 32; ++i) (bit[i] % 3 ? result |= (1 << i) : 0);
- if (bit[32] % 3) result = -result;
- printf("%d", result);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement