-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHayatoAndSchool.cpp
46 lines (37 loc) · 1002 Bytes
/
HayatoAndSchool.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//https://codeforces.com/contest/1780/problem/A
#include <iostream>
#include<vector>
#include<set>
#include<math.h>
#include<algorithm>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int n,tmp;
cin >> n;
vector<int> evenIdx,oddIdx;
for (int i = 0; i < n; i++) {
cin >> tmp;
if (tmp % 2 == 0) {
evenIdx.push_back(i);
}
else {
oddIdx.push_back(i);
}
}
if (evenIdx.size() >= 2 && oddIdx.size() >=1)
{
cout << "YES\n";
cout << evenIdx[0] + 1 << " " << evenIdx[1] + 1<< " " << oddIdx[0] + 1 << "\n";
}
else if(oddIdx.size()>=3) {
cout << "YES\n";
cout << oddIdx[0] + 1<< " " << oddIdx[1] + 1 << " " << oddIdx[2] + 1<< "\n";
}
else
cout << "NO\n";
}
return 0;
}