Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, m, res;
- cin >> n;
- int i = 0;
- while (n >= 2)
- {
- m = 2;
- while (n > m)
- m *= 2;
- n -= m / 2;
- i++;
- }
- if (n == 1) i++;
- if (n == 2) i += 2;
- if (i % 3 == 0) res = 2;
- if (i % 3 == 1) res = 0;
- if (i % 3 == 2) res = 1;
- cout << res << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement