Submission #1093946

#TimeUsernameProblemLanguageResultExecution timeMemory
1093946stdfloatHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, q; cin >> n >> q; vector<int> a(n); for (auto &i : a) cin >> i; while (q--) { int l, r, k; cin >> l >> r >> k; l--; r--; unordered_set<int> s; bool tr = true; for (int i = r; i >= l && tr; i--) { tr = (s.empty() || a[i] <= *s.begin() || a[i] + *--s.lower_bound(a[i]) <= k); s.insert(a[i]); } cout << tr << '\n'; } }

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:23:57: error: 'class std::unordered_set<int>' has no member named 'lower_bound'
   23 |    tr = (s.empty() || a[i] <= *s.begin() || a[i] + *--s.lower_bound(a[i]) <= k);
      |                                                         ^~~~~~~~~~~