제출 #679974

#제출 시각아이디문제언어결과실행 시간메모리
679974Hacv16Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
8 / 100
3075 ms14260 KiB
#include <bits/stdc++.h> using namespace std; #define fr first #define sc second typedef long long ll; const int MAX = 1e6 + 10; const int INF = 0x3f3f3f3f; int n, m, a[MAX]; int query(int l, int r, int k){ int mx = 0; for(int i = l; i <= r; i++) for(int j = i + 1; j <= r; j++) if(a[i] > a[j]) mx = max(mx, a[i] + a[j]); return (mx <= k); } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; for(int i = 1; i <= n; i++) cin >> a[i]; while(m--){ int l, r, k; cin >> l >> r >> k; cout << query(l, r, 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...