Submission #956439

#TimeUsernameProblemLanguageResultExecution timeMemory
956439Darren0724Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
8 / 100
3065 ms8284 KiB
#include <bits/stdc++.h> using namespace std; #define LCBorz ios_base::sync_with_stdio(false); cin.tie(0); #define int long long #define all(x) x.begin(), x.end() #define endl '\n' const int N=200005; const int INF=1e18; int32_t main() { LCBorz; int n,q;cin>>n>>q; vector<int> v(n); for(int i=0;i<n;i++){ cin>>v[i]; } for(int i=0;i<q;i++){ int l,r,c;cin>>l>>r>>c; l--,r--; int flag=1; for(int j=l;j<=r;j++){ for(int k=j+1;k<=r;k++){ if(v[j]<=v[k])continue; if(v[j]+v[k]>c)flag=0; } } cout<<flag<<endl; } return 0; }
#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...