Submit Info #65297

Problem Lang User Status Time Memory
Associative Array cpp-acl (anonymous) AC 822 ms 62.45 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 523 ms 62.45 MiB
example_00 AC 1 ms 0.42 MiB
many_0set_00 AC 710 ms 25.07 MiB
many_0set_sparse_00 AC 110 ms 2.32 MiB
max_random_00 AC 673 ms 26.82 MiB
max_random_01 AC 671 ms 29.54 MiB
max_random_02 AC 822 ms 33.08 MiB
random_00 AC 319 ms 16.82 MiB
random_01 AC 391 ms 18.71 MiB
random_02 AC 550 ms 27.69 MiB
sparse_keys_00 AC 118 ms 3.88 MiB
sparse_keys_01 AC 138 ms 4.57 MiB
unordered_map_killer_00 AC 491 ms 62.45 MiB
unordered_map_killer_01 AC 492 ms 62.45 MiB
unordered_map_killer_02 AC 494 ms 62.45 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; }