#include <bits/stdc++.h>
#define ll long long
#define fort(x , y) for(int y = 1 ; y <= x ; y++)
#define pb push_back
#define pf push_front
#define ppb pop_back
#define int long long
#define F first
#define S second
using namespace std;
const int N = 1e6 + 5;
const int NN = 1e9 + 7;
int n,m,w[N],l,r,k,p[N],b[N],used[N],vos[N];
vector <int> g[N];
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin >> n >> m;
for(int i = 1 ; i <= n ; i++){
cin >> w[i];
}
//sort(b + 1 , b + n + 1);
for(int j = 1 ; j <= m ; j++){
cin >> l >> r >> k;
if(l == r){
cout << 1 << '\n';
continue;
}
bool ok = 1;
for(int i = l ; i < r ; i++){
if(w[i] > w[i + 1]){
ok = 0;
break;
}
}
if(ok == 1){
cout << 1 << '\n';
}
else{
cout << 0 << '\n';
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
27228 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
27228 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
360 ms |
36176 KB |
Output is correct |
2 |
Correct |
382 ms |
36224 KB |
Output is correct |
3 |
Correct |
353 ms |
36180 KB |
Output is correct |
4 |
Correct |
362 ms |
36268 KB |
Output is correct |
5 |
Execution timed out |
3063 ms |
34484 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
41 ms |
27484 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
27228 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
27228 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |