#include <bits/stdc++.h>
using namespace std;
const int N=1e6+10;
int a[N];
bool sorted[N];
int main() {
int n,m;
cin>>n>>m;
sorted[0]=true;
for(int i=1; i<=n; i++)
{
cin>>a[i];
if(sorted[i-1] && a[i] >= a[i-1])sorted[i]=true;
}
for(int i=1; i<=m; i++){
int l,r,k;
cin>>l>>r>>k;
bool ans=true;
for(int i=l; i<r; i++){
if(a[i] > a[i+1]){
ans=false;
break;
}
}
cout<<ans<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2195 ms |
31952 KB |
Output is correct |
2 |
Correct |
2196 ms |
32572 KB |
Output is correct |
3 |
Correct |
2165 ms |
32232 KB |
Output is correct |
4 |
Correct |
2201 ms |
32392 KB |
Output is correct |
5 |
Execution timed out |
3026 ms |
15848 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
189 ms |
4432 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |