This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
#define LL long long
#define Kultivator ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int Mxn = 1e6 + 7;
const LL Mod = 1e9 + 7;
const LL Inf = 1e14 + 7;
const int K = 450;
int N, M, Mood[Mxn / K], W[Mxn], Max_value[Mxn / K], Pref[Mxn];
int main(){
Kultivator;
cin >> N >> M;
Pref[0] = 1;
for(int i = 0; i < N; i++){
cin >> W[i];
if(i > 0 && W[i] < W[i - 1]){
Pref[i] = 0;
} else {
Pref[i] = 1;
}
}
while(M--){
int L, R, X;
cin >> L >> R >> X;
L--, R--;
if(Pref[R] - Pref[L] != R - L) cout << "0\n";
else cout << "1\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |