#include <iostream>
using namespace std;
const int N = 5;
int main() {
int arr[N] = {2, 1, 2, 2, 2};
bool d = arr[0]%2!=0;
for (int i = 0; i < N; i++) {
if (arr[i] % 2 == d) {
d = !d;
} else {
cout<<i;
return 0;
}
cout<<0;
#include <iostream>
using namespace std;
const int N = 5;
int main() {
int arr[N] = {2, 1, 2, 2, 2};
bool d = arr[0]%2!=0;
for (int i = 0; i < N; i++) {
if (arr[i] % 2 == d) {
d = !d;
} else {
cout<<i;
return 0;
}
}
cout<<0;
}