#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 |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2499 ms |
10132 KB |
Output is correct |
2 |
Correct |
2532 ms |
43240 KB |
Output is correct |
3 |
Correct |
2542 ms |
42908 KB |
Output is correct |
4 |
Correct |
2573 ms |
42960 KB |
Output is correct |
5 |
Correct |
2743 ms |
43036 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
261 ms |
1248 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |