Submit Info #68404

Problem Lang User Status Time Memory
Associative Array cpp PlayErphil AC 1093 ms 31.93 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 706 ms 31.93 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 1055 ms 20.28 MiB
many_0set_sparse_00 AC 209 ms 2.27 MiB
max_random_00 AC 1092 ms 22.06 MiB
max_random_01 AC 1093 ms 23.21 MiB
max_random_02 AC 1065 ms 24.44 MiB
random_00 AC 351 ms 10.91 MiB
random_01 AC 422 ms 12.52 MiB
random_02 AC 574 ms 16.64 MiB
sparse_keys_00 AC 216 ms 3.82 MiB
sparse_keys_01 AC 254 ms 4.57 MiB
unordered_map_killer_00 AC 670 ms 31.89 MiB
unordered_map_killer_01 AC 669 ms 31.89 MiB
unordered_map_killer_02 AC 675 ms 31.89 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; }