Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* e319 - 2 */
- /* AC (0.3s, 116KB) */
- #pragma warning( disable : 4996 )
- #include <cstdio>
- #include <cstdint>
- using namespace std;
- using int16 = int_fast16_t;
- using int32 = int_fast32_t;
- using int64 = int_fast64_t;
- /* main code */
- int32 N, result = 0, a, b, c, x;
- int main()
- {
- scanf("%d", &N);
- a = b = c = 0;
- while (N-- && scanf("%d", &x))
- {
- c = x & b;
- b &= ~x;
- x &= ~c;
- b |= a & x;
- a ^= x;
- }
- printf("%d", a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement