Advertisement
Guest User

Untitled

a guest
Dec 29th, 2019
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <map>
  4. #include <set>
  5. #include <queue>
  6. #include <algorithm>
  7. #include <string>
  8. #include <cmath>
  9. #include <cstdio>
  10. #include <iomanip>
  11. #include <fstream>
  12. #include <cassert>
  13. #include <cstring>
  14. #include <unordered_set>
  15. #include <unordered_map>
  16. #include <numeric>
  17. #include <ctime>
  18. #include <bitset>
  19. #include <complex>
  20. #include <random>
  21.  
  22. using namespace std;
  23.  
  24. #define int long long
  25.  
  26. void solve() {
  27.     int n;
  28.     cin >> n;
  29.     vector<int> a(n);
  30.     for (auto &t : a) {
  31.         cin >> t;
  32.     }
  33.     for (int i = 0; i + 1 < n; i++) {
  34.         if (abs(a[i] - a[i + 1]) > 1) {
  35.             cout << "YES " << i + 1 << ' ' << i + 2 << endl;
  36.             return;
  37.         }
  38.     }
  39.     cout << "NO" << endl;
  40. }
  41.  
  42. signed main() {
  43.     ios_base::sync_with_stdio(false);
  44.     cin.tie(0);
  45.    
  46.     int q;
  47.     cin >> q;
  48.     while (q--) {
  49.         solve();
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement