Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <inttypes.h>
- using namespace std;
- //#define red uint64;
- int main() {
- uint64_t n;
- cin >> n;
- uint64_t res = 0, a;
- cin >> res;
- for (uint64_t i = 1; i < n; i++) {
- cin >> a;
- res = res^a;
- }
- //cout << res%2 << endl;
- uint64_t ans = 0;
- if (res%2 == 1) {cout << 0 << endl; return 0;}
- for (uint64_t k = 1; k < n; k++) {
- uint64_t x = 1;
- uint64_t l = 1;
- for (uint64_t j = k+1; j <= n; j++) {
- x *= j;
- if (l <= n - k && x%l == 0) {
- x /= l; l++;
- }
- }
- //cout << "x = " <<x << endl;
- ans += x;
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement