Created
July 24, 2017 21:37
-
-
Save MohamedTaha98/e303d1a2d84c5aaa69632127525dfaab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main () { | |
long n; | |
cin >> n; | |
long ar[n]; | |
bool won = false; | |
for (int i = 0; i < n; i++) | |
cin >> ar[i]; | |
for (int i = 0; i < n; i++) { | |
if (ar[i] % 2 == 0) { | |
if (won == true) | |
won = false; | |
else | |
won = true; | |
} | |
if (won == true) | |
cout << 1 << endl; | |
else | |
cout << 2 << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment