Submission #333668

#TimeUsernameProblemLanguageResultExecution timeMemory
333668vipghn2003Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
17 / 100
3078 ms12648 KiB
#include<bits/stdc++.h> using namespace std; const int N=1e6+5; int n,m,a[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; while(m--) { int l,r,k; cin>>l>>r>>k; int mx=0; int res=1; for(int i=l;i<=r;i++) { if(mx>a[i]&&mx+a[i]>k) res=0; mx=max(mx,a[i]); } cout<<res<<'\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...