Submit Info #68192

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 734 ms 62.42 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 520 ms 62.38 MiB
example_00 AC 1 ms 0.42 MiB
many_0set_00 AC 658 ms 25.06 MiB
many_0set_sparse_00 AC 110 ms 2.28 MiB
max_random_00 AC 734 ms 26.82 MiB
max_random_01 AC 686 ms 29.54 MiB
max_random_02 AC 704 ms 33.04 MiB
random_00 AC 247 ms 16.77 MiB
random_01 AC 293 ms 18.67 MiB
random_02 AC 405 ms 27.75 MiB
sparse_keys_00 AC 117 ms 3.80 MiB
sparse_keys_01 AC 136 ms 4.57 MiB
unordered_map_killer_00 AC 489 ms 62.38 MiB
unordered_map_killer_01 AC 489 ms 62.39 MiB
unordered_map_killer_02 AC 487 ms 62.42 MiB

#include <cstdio> #include <map> int main() { int q; scanf("%d", &q); std::map<long long, long long> mp; for (int i = 0; i < q; i++) { int type; scanf("%d", &type); if (type == 0) { long long key, val; scanf("%lld %lld", &key, &val); mp[key] = val; } else { long long key; scanf("%lld", &key); printf("%lld\n", mp[key]); } } return 0; }