제출 #444735

#제출 시각아이디문제언어결과실행 시간메모리
444735nickyrioHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
0 / 100
3066 ms14308 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...