Submit Info #65608

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 842 ms 62.49 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 519 ms 62.49 MiB
example_00 AC 1 ms 0.41 MiB
many_0set_00 AC 715 ms 25.11 MiB
many_0set_sparse_00 AC 109 ms 2.33 MiB
max_random_00 AC 722 ms 26.82 MiB
max_random_01 AC 794 ms 29.46 MiB
max_random_02 AC 842 ms 33.07 MiB
random_00 AC 298 ms 16.77 MiB
random_01 AC 383 ms 18.60 MiB
random_02 AC 523 ms 27.72 MiB
sparse_keys_00 AC 118 ms 3.90 MiB
sparse_keys_01 AC 135 ms 4.54 MiB
unordered_map_killer_00 AC 492 ms 62.48 MiB
unordered_map_killer_01 AC 487 ms 62.42 MiB
unordered_map_killer_02 AC 493 ms 62.43 MiB

#include <cstdio> #include <map> using namespace std; int main() { int n; scanf("%d", &n); map<long long, long long> m; for(int i = 0; i < n; i++) { long long temp, key, value; scanf("%lld", &temp); if(temp == 0) { scanf("%lld %lld", &key, &value); m[key] = value; } else { scanf("%lld", &key); printf("%lld\n", m[key]); } } return 0; }