Submit Info #65856

Problem Lang User Status Time Memory
Associative Array cpp dennisyang AC 1696 ms 62.48 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 1314 ms 62.45 MiB
example_00 AC 1 ms 0.42 MiB
many_0set_00 AC 1590 ms 25.11 MiB
many_0set_sparse_00 AC 386 ms 2.34 MiB
max_random_00 AC 1582 ms 26.85 MiB
max_random_01 AC 1696 ms 29.53 MiB
max_random_02 AC 1624 ms 33.09 MiB
random_00 AC 613 ms 16.72 MiB
random_01 AC 744 ms 18.64 MiB
random_02 AC 895 ms 27.69 MiB
sparse_keys_00 AC 424 ms 3.86 MiB
sparse_keys_01 AC 497 ms 4.52 MiB
unordered_map_killer_00 AC 1198 ms 62.48 MiB
unordered_map_killer_01 AC 1190 ms 62.47 MiB
unordered_map_killer_02 AC 1195 ms 62.39 MiB

#include <iostream> #include <vector> #include <algorithm> #include <array> #include <string> #include <map> #include <string> #include <set> using namespace std; int main() { int q; cin >>q; map<long long, long long> m; for(int i = 0; i < q; i++) { int num; cin >> num; if(num == 0) { long long hi; long long hi2; cin >> hi >> hi2; m[hi] = hi2; } else if(num == 1) { long long hi3; cin >> hi3; cout << m[hi3] << endl; } } }