Submission #569664

# Submission time Handle Problem Language Result Execution time Memory
569664 2022-05-27T15:25:29 Z SSRS Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
0 / 100
2575 ms 32160 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  vector<int> w(N);
  for (int i = 0; i < N; i++){
    cin >> w[i];
  }
  vector<int> S(N);
  S[0] = 0;
  for (int i = 0; i < N - 1; i++){
    S[i + 1] = S[i];
    if (w[i + 1] > w[i]){
      S[i + 1]++;
    }
  }
  for (int i = 0; i < M; i++){
    int l, r, k;
    cin >> l >> r >> k;
    l--;
    if (S[r - 1] - S[l] == 0){
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2575 ms 32160 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 230 ms 1496 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -