제출 #1316710

#제출 시각아이디문제언어결과실행 시간메모리
1316710blackscreen1Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++20
8 / 100
3094 ms8276 KiB
#include <bits//stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset; #define ll long long #define iloop(m, h) for (auto i = m; i != h; i += (m < h ? 1 : -1)) #define jloop(m, h) for (auto j = m; j != h; j += (m < h ? 1 : -1)) #define kloop(m, h) for (auto k = m; k != h; k += (m < h ? 1 : -1)) #define pll pair<ll, ll> #define INF 1000000000000000 #define MOD1 1000000007 #define MOD2 998244353 #define MOD3 1000000009 ll n, m, a[1000005]; pair<pll, pll> b[1000005]; ll ans[1000005], cptr = 0; vector<pll> checks; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m; iloop(0, n) cin >> a[i]; iloop(0, m) { cin >> b[i].first.second >> b[i].first.first >> b[i].second.first; bool can = 1; b[i].first.first--, b[i].first.second--; jloop(b[i].first.second, b[i].first.first + 1) kloop(j, b[i].first.first + 1) if (a[j] > a[k] && a[j] + a[k] > b[i].second.first) {can = 0; break;} cout << can << "\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...