Submission #2800870
Source Code Expand
#include <bits/stdc++.h> using namespace std; int main () { int n; cin >> n; vector<int>v(n); for(int &b : v) cin >> b; int s = 0; for(int b : v) s ^= b; int sc = 0; for(int b : v) sc ^= (b - 1); if(s == 0) { cout << "0" << endl; } else if(sc == 0) { cout << n << endl; } else cout << "-1" << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Cheating Nim |
User | vjudge1 |
Language | C++14 (Clang 3.8.0) |
Score | 0 |
Code Size | 301 Byte |
Status | CE |
Compile Error
./Main.cpp:1:10: fatal error: 'bits/stdc++.h' file not found #include <bits/stdc++.h> ^ 1 error generated.