제출 #1093946

#제출 시각아이디문제언어결과실행 시간메모리
1093946stdfloatHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
컴파일 에러
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'; } }

컴파일 시 표준 에러 (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);
      |                                                         ^~~~~~~~~~~