# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
898097 | Litusiano | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 2626 ms | 49968 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;
#define endl '\n'
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,q; cin>>n>>q;
vector<int> v(n); for(int& i : v) cin>>i;
vector<int> pre(n+1);
for(int i = 1; i<n; i++){
pre[i+1] = pre[i] + (v[i] < v[i-1]);
}
for(int i : pre) cerr<<i<<" "; cerr<<endl;
while(q--){
int l,r,k; cin>>l>>r>>k;
if(pre[r] - pre[l] == 0) cout<<1<<endl;
else cout<<0<<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... |