#include <iostream>
using namespace std;
bool solve(int n, int m, int w[])
{
int l, r, k;
cin >> l >> r >> k;
for (int i=r; i>l; i--)
{
int a = w[i-1], b = w[i];
if (a>b && a+b>k) return 0;
}
return 1;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
int w[n+1] = {-1};
for (int i=1; i<=n; i++) {
cin >> w[i];
}
for (int i=0; i<m; i++) {
cout << solve(n, m, w) << '\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
468 ms |
7836 KB |
Output is correct |
2 |
Correct |
534 ms |
13280 KB |
Output is correct |
3 |
Correct |
498 ms |
15200 KB |
Output is correct |
4 |
Correct |
534 ms |
13972 KB |
Output is correct |
5 |
Execution timed out |
3092 ms |
8452 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2129 ms |
2104 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |