Submission #889837

#TimeUsernameProblemLanguageResultExecution timeMemory
889837ratiHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
0 / 100
3016 ms4588 KiB
#include <bits/stdc++.h> using namespace std; int m,n; int ar[1000001]; int main(){ cin>>n>>m; for(int i=0;i<n;i++) cin>>ar[i]; for(int i=0;i<m;i++){ int l,r,k; cin>>l>>r>>k; int maxdif=0; int cur=ar[l-1]; for(int j=l;j<r;j++){ if(cur>=ar[j]){ maxdif=max(maxdif,cur+ar[j]); } else{ cur=ar[j]; } } if(maxdif>k) cout<<0<<endl; else cout<<1<<endl; } }
#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...