#include template using pQueue = __gnu_pbds::priority_queue; //> auto it = pq.push(5); // O(1) pq.modify(it, 6); // O(log n) pq.erase(it); // O(log n) pq.join(pq2); // O(1) pq.swap(pq2); // O(1) #include using namespace __gnu_pbds; template using Tree = tree, rb_tree_tag, tree_order_statistics_node_update>; T.order_of_key(x); // number of elements strictly less than x auto it = T.find_by_order(k); // k-th element template struct chash { const uint64_t C = ll(2e18 * acos(-1)) | 199; // random odd size_t operator()(T o) const { return __builtin_bswap64(hash()(o) * C); }}; template using hashMap = gp_hash_table>; template using hashSet = gp_hash_table>;