-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_Hayato_and_School.cpp
74 lines (70 loc) · 1.56 KB
/
A_Hayato_and_School.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Jai shree ram
#include<bits/stdc++.h>
using namespace std;
#define scan(arr) for(auto &x : arr) cin>>x;
#define print(arr) for(auto &x : arr) cout<<x<<" "; cout<<endl;
const int N=1e3+10;
// int b[N]={0};
// int c[N]={0};
int main()
{
int t;
cin >> t;
while (t--)
{
vector<int> b;
vector<int> c;
int n, co = 0, ce = 0;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
for (int i = 0; i < n; i++)
{
if (a[i] % 2 == 0)
{
ce++;
b.push_back(i);
}
else
{
co++;
c.push_back(i);
}
}
if (ce < 2 && co <= 2){
cout << "NO" << '\n';
continue;
}
if(co==0){
cout<<"NO"<<'\n';
continue;
}
else
{
cout << "YES" << '\n';
if (co >= 3)
{
cout << c[0]+1 << " " << c[1]+1 << " " << c[2]+1 << "\n";
continue;
}
else
{
cout << b[0]+1 << " " << b[1]+1 << " " << c[0]+1 << "\n";
continue;
}
}
}
}
bool isPowerOfTwo(int n)
{
if (n == 0)
return false;
return (ceil(log2(n)) == floor(log2(n)));
}
if(isPowerOfTwo(x-3)){
cout<<"YES"<<'\n';
}
else cout<<"NO"<<'\n';