Submission #989744

#TimeUsernameProblemLanguageResultExecution timeMemory
989744tch1cherinHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
17 / 100
3080 ms5460 KiB
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr)->sync_with_stdio(false); int N, M; cin >> N >> M; vector<int> W(N); for (int &value : W) { cin >> value; } while (M--) { int L, R, K; cin >> L >> R >> K; L--, R--; int current = 0; bool good = true; for (int i = L; i <= R; i++) { current = max(current, W[i]); if (W[i] < current) { if (W[i] + current > K) { good = false; } } } cout << int(good) << "\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...