Submission #499168

#TimeUsernameProblemLanguageResultExecution timeMemory
499168sireanu_vladHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
34 / 100
3070 ms6272 KiB
#include <iostream> using namespace std; int n, m, w[1000001], wmax, l, r, k; void read() { cin >> n >> m; for(int i = 1; i <= n; ++i) cin >> w[i]; } bool solve() { wmax = 0; cin >> l >> r >> k; for(int i = l; i <= r; ++i) { if(w[i] < wmax && wmax + w[i] > k) return 0; wmax = max(wmax, w[i]); } return 1; } int main() { read(); while(m--) cout << solve() << '\n'; 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...