Submission #889847

#TimeUsernameProblemLanguageResultExecution timeMemory
889847ratiHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++11
0 / 100
3006 ms9560 KiB
#include <bits/stdc++.h> using namespace std; long long m,n; long long ar[10000001]; int main(){ cin>>n>>m; for(long long i=0;i<n;i++) cin>>ar[i]; for(long long i=0;i<m;i++){ long long l,r,k; cin>>l>>r>>k; long long maxdif=0; long long cur=ar[l-1]; for(long long 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...