/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 2ms 344.0 KiB
#2 Accepted 2ms 352.0 KiB
#3 Accepted 2ms 544.0 KiB
#4 Wrong Answer 2ms 480.0 KiB

Code

#include <bits/stdc++.h>
#define int long long
#define sqrtl(x) sqrt(x)
using namespace std;

namespace solve {
  namespace test_case {
    void main() {
      int n, k; cin >> n >> k;
      vector<int> a(n);
      for (auto &x: a) cin >> x;
      int i (0), j(n); 
      while (a[i + 1] > a[i]) i++;
      while (a[j - 1] > a[j]) j--;
      if (j - i <= k) cout << "YES\n" << i + 1 << ' ' << j << '\n'; 
      else cout << "NO\n";

    }
  }

  void main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t (1); // cin >> t; 
    while (t--) {
      test_case::main();
    }
  }
}

signed main() { solve::main(); }

Information

Submit By
Type
Submission
Problem
P1120 Stairway to the Skyline
Contest
Brain Booster #7
Language
C++17 (G++ 13.2.0)
Submit At
2024-11-05 15:16:19
Judged At
2024-11-11 02:31:01
Judged By
Score
4
Total Time
2ms
Peak Memory
544.0 KiB