Submission #444736

#TimeUsernameProblemLanguageResultExecution timeMemory
444736nickyrioHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
0 / 100
3095 ms4212 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> w(n); for (int i = 0; i < n; ++i) cin >> w[i]; for (int i = 0; i < m; ++i) { int l, r, k; cin >> l >> r >> k; int mx = w[l], ans = 0; for (int j = l + 1; j <= r; ++j) { if (mx > w[j]) ans = max(ans, mx + w[j]); mx = max(mx, w[j]); } cout << (ans <= k) << '\n'; } }
#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...