#include<bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
const int MAXN = 1e6+10;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int n, m;
int a[MAXN], w;
int l, r, k;
int go[MAXN];
void read()
{
cin >> n >> m;
for (int i = 1; i <= n; ++ i)
{
cin >> a[i];
}
int j = 1;
for (int i = 1; i <= n; ++ i)
{
j = max(j, i);
while(j < n && a[j] <= a[j+1])j ++;
go[i] = j;
//cout << go[i] << " ";
}
//cout << endl;
for (int i = 1; i <= m; ++ i)
{
cin >> l >> r >> k;
if(go[l] < r)cout << 0 << endl;
else cout << 1 << endl;
}
}
int main()
{
speed();
read();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
298 ms |
10172 KB |
Output is correct |
2 |
Correct |
281 ms |
10064 KB |
Output is correct |
3 |
Correct |
289 ms |
10068 KB |
Output is correct |
4 |
Correct |
276 ms |
10068 KB |
Output is correct |
5 |
Correct |
275 ms |
10068 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
24 ms |
6748 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |