#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int n, m, l[N], r[N], k[N], p[N], a[N];
int main(){
ios::sync_with_stdio(false); cin.tie(nullptr);
cin >> n >> m;
for(int i = 1; i <= n; i++){
cin >> a[i];
p[i] = p[i-1] + (a[i] < a[i-1]);
}
for(int i = 1; i <= m; i++){
cin >> l[i] >> r[i] >> k[i];
if(r[i] - l[i] == 0){
cout << 1 << '\n';
}
else {
cout << (p[r[i]] - p[l[i]] == 0) << '\n';
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
322 ms |
53856 KB |
Output is correct |
2 |
Correct |
323 ms |
54712 KB |
Output is correct |
3 |
Correct |
309 ms |
54608 KB |
Output is correct |
4 |
Correct |
310 ms |
54868 KB |
Output is correct |
5 |
Correct |
311 ms |
54908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
4432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |