제출 #329753

#제출 시각아이디문제언어결과실행 시간메모리
329753RainbowbunnyHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
8 / 100
3089 ms14224 KiB
#include <bits/stdc++.h> using namespace std; int n, m; int w[1000005]; int main() { // freopen("Input.txt", "r", stdin); cin >> n >> m; for(int i = 1; i <= n; i++) { cin >> w[i]; } for(int i = 1; i <= m; i++) { int l, r, x; cin >> l >> r >> x; bool ok = true; for(int j = l; j <= r; j++) { for(int k = j + 1; k <= r; k++) { if(w[j] > w[k] and (w[j] + w[k] > x)) { ok = false; } } } if(ok) { cout << 1 << '\n'; } else { cout << 0 << '\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...