#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef gp_hash_table<
int, null_type, hash<int>, equal_to<int>, direct_mask_range_hashing<int>, linear_probe_fn<>,
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>>
gp;
typedef cc_hash_table<
int, null_type, hash<int>, equal_to<int>, direct_mask_range_hashing<int>,
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>>
cc;
const int N = 3e6;
int getTicks() {
static auto startTime = std::chrono::high_resolution_clock::now();
auto t = std::chrono::high_resolution_clock::now();
return std::chrono::duration_cast<std::chrono::milliseconds>(t - startTime).count();
}
int main() {
gp table;
table.resize(N);
table.set_loads({.25, .5});
int s = getTicks();
for (int i = 0; i < N; i++)
table.insert(i);
for (int i = 0; i < N; i++)
table.erase(i);
cout << getTicks() - s << endl;
s = getTicks();
gp_hash_table<int, null_type> table2;
for (int i = 0; i < N; i++)
table2.insert(i);
for (int i = 0; i < N; i++)
table2.erase(i);
cout << getTicks() - s << endl;
return 0;
}
CiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgojaW5jbHVkZSA8ZXh0L3BiX2RzL2Fzc29jX2NvbnRhaW5lci5ocHA+CnVzaW5nIG5hbWVzcGFjZSBfX2dudV9wYmRzOwp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdHlwZWRlZiBncF9oYXNoX3RhYmxlPAogICAgaW50LCBudWxsX3R5cGUsIGhhc2g8aW50PiwgZXF1YWxfdG88aW50PiwgZGlyZWN0X21hc2tfcmFuZ2VfaGFzaGluZzxpbnQ+LCBsaW5lYXJfcHJvYmVfZm48PiwKICAgIGhhc2hfc3RhbmRhcmRfcmVzaXplX3BvbGljeTxoYXNoX2V4cG9uZW50aWFsX3NpemVfcG9saWN5PD4sIGhhc2hfbG9hZF9jaGVja19yZXNpemVfdHJpZ2dlcjx0cnVlPiwgdHJ1ZT4+CiAgICBncDs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