Submission #898092

#TimeUsernameProblemLanguageResultExecution timeMemory
898092LitusianoHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
8 / 100
3094 ms4184 KiB
#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; while(q--){ int l,r,k; cin>>l>>r>>k; l--; r--; int mx = 0; for(int i = l; i <= r; i++){ for(int j = i+1; j<=r; j++){ if(v[i] > v[j]) mx = max(mx,v[i] + v[j]); // ill have to swap them } } if(mx > 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...