This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[n + 1];
for(int i = 1; i <= n; ++i) cin >> a[i];
for(int i = 1; i <= m; ++i) {
int l, r, k;
cin >> l >> r >> k;
bool can = 1;
for(int x = l; x <= r; ++x) {
for(int y = x; y <= r; ++y) {
if(a[x] > a[y] && a[x] + a[y] > k) {
can = false;
}
}
}
cout << can << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |