fork download
  1. #include <bits/stdc++.h>
  2.  
  3. #define ld long double
  4. #define ll long long
  5. #define pb push_back
  6. #define fin(a, n) for(int i = a; i < n; i++)
  7. #define fjn(a, n) for(int j = a; j < n; j++)
  8. #define all(a) a.begin(),a.end()
  9. #define allr(a) a.rbegin(),a.rend()
  10. #define FAST ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
  11.  
  12. using namespace std;
  13.  
  14. const double pi = acos(-1);
  15. const int N = 200000+5;
  16. const ll oo = 0x3f3f3f3f3f3f3f3f;
  17. const int MOD = 1e9+7;
  18.  
  19. string di[] = {"D","L", "U", "R", "UL", "UR", "DL", "DR"};
  20. int dx[] = {+1, +0, +0, -1, -1, -1, +1, +1};
  21. int dy[] = {+0, -1, +1, +0, -1, +1, -1, +1};
  22. char dc[] = {'D', 'L', 'R', 'U'};
  23.  
  24. void solve() {
  25. int n; cin >> n;
  26. vector<int> v(n);
  27. fin(0, n) cin >> v[i];
  28. fin(1, n-1) {
  29. if (v[i] > v[i-1] && v[i] > v[i+1]) {
  30. cout << "YES\n";
  31. return void(cout << i << " " << i+1 << " " << i+2 << "\n");
  32. }
  33. }
  34. cout << "NO\n";
  35. }
  36.  
  37. int main() {
  38. FAST;
  39. #ifndef ONLINE_JUDGE
  40. freopen("input.txt", "r", stdin);
  41. freopen("output.txt", "w", stdout);
  42. #endif
  43. int tt = 1; cin >> tt;
  44. while (tt--) {
  45. solve();
  46. //cout << "Case #" << c++ << ": ";
  47. }
  48. return 0;
  49. }
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
NO