Submit Info #68356

Problem Lang User Status Time Memory
Associative Array cpp PlayErphil AC 877 ms 31.96 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 703 ms 31.86 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 843 ms 20.24 MiB
many_0set_sparse_00 AC 211 ms 2.27 MiB
max_random_00 AC 877 ms 22.03 MiB
max_random_01 AC 874 ms 23.19 MiB
max_random_02 AC 875 ms 24.41 MiB
random_00 AC 313 ms 10.90 MiB
random_01 AC 376 ms 12.58 MiB
random_02 AC 496 ms 16.72 MiB
sparse_keys_00 AC 217 ms 3.91 MiB
sparse_keys_01 AC 254 ms 4.60 MiB
unordered_map_killer_00 AC 669 ms 31.88 MiB
unordered_map_killer_01 AC 674 ms 31.82 MiB
unordered_map_killer_02 AC 668 ms 31.96 MiB

#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); long long q; cin >> q; map<long long, long long> a; while (q--) { long long query, k; cin >> query >> k; if (query == 1) { if (a.find(k) != a.end()) cout << a[k] << endl; else cout << 0 << endl; } else { long long v; cin >> v; a[k] = v; } } return 0; }