-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1380A.cpp
More file actions
44 lines (36 loc) · 955 Bytes
/
1380A.cpp
File metadata and controls
44 lines (36 loc) · 955 Bytes
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
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
bool found = false;
for (int j = 1; j < n - 1 && !found; j++) {
int i = -1, k = -1;
for (int x = 0; x < j; x++) {
if (a[x] < a[j]) {
i = x;
break;
}
}
for (int x = j + 1; x < n; x++) {
if (a[x] < a[j]) {
k = x;
break;
}
}
if (i != -1 && k != -1) {
cout << "YES\n";
cout << i + 1 << " " << j + 1 << " " << k + 1 << "\n";
found = true;
}
}
if (!found) cout << "NO\n";
}
}