# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
490504 | fuad27 | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 3071 ms | 8352 KiB |
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;
const long long N = 1e6 + 10;
int main () {
int n, m;
cin >> n >> m;
long long arr[n];
for(int i = 0;i<n;i++)cin>>arr[i];
while(m--) {
int l, r, m;
cin >> l >> r >> m;
long long MAX = 0, MIN = 1e18;
bool check = true;
for(int i = l-1;i<r;i++) {
if(abs(MAX - arr[i]) > m) {
check=0;
}
MAX = max(MAX, arr[i]);
}
cout << check << endl;
}
}
Compilation message (stderr)
# | 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... |