25A codeforces - IQ Test
Solution in C++
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define pii pair<int,int>
int n,t,od,eve,ct_o,ct_e;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n;
for(int i=0;i<n;i++)
{
cin>>t;
if(t%2)od=i+1,ct_o++;
else eve=i+1,ct_e++;
}
cout<<((ct_o>ct_e)?eve:od);
return 0;
}
Aarbatheome John Hansen https://wakelet.com/wake/BLLMT-Fe9_piSNu4D8XzO
ردحذفbestthinkgaboo