Submission #490508

#TimeUsernameProblemLanguageResultExecution timeMemory
490508fuad27Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
17 / 100
3066 ms8116 KiB
#include<bits/stdc++.h> using namespace std; const long long N = 1e6 + 10; int main () { int n, m; cin >> n >> m; long long arr[n]; for(int i = 0;i<n;i++)cin>>arr[i]; while(m--) { int l, r, m; cin >> l >> r >> m; long long MAX = arr[l-1],ans = 0; for(int i = l;i<r;i++) { MAX = max(arr[i],MAX); if(arr[i] < MAX) ans = max(ans, MAX+arr[i]); } cout << (ans <= m) << 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...