Submit Info #67255

Problem Lang User Status Time Memory
Associative Array cpp piddy AC 560 ms 62.49 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 378 ms 62.49 MiB
example_00 AC 1 ms 0.41 MiB
many_0set_00 AC 534 ms 25.05 MiB
many_0set_sparse_00 AC 53 ms 2.34 MiB
max_random_00 AC 464 ms 26.83 MiB
max_random_01 AC 487 ms 29.53 MiB
max_random_02 AC 560 ms 32.96 MiB
random_00 AC 173 ms 16.72 MiB
random_01 AC 207 ms 18.68 MiB
random_02 AC 322 ms 27.74 MiB
sparse_keys_00 AC 59 ms 3.82 MiB
sparse_keys_01 AC 68 ms 4.55 MiB
unordered_map_killer_00 AC 355 ms 62.46 MiB
unordered_map_killer_01 AC 354 ms 62.47 MiB
unordered_map_killer_02 AC 357 ms 62.45 MiB

#include <iostream> struct fast_I { private : char c = ' '; bool neg; template<typename T> T& read(T& n) { n = 0; neg = false; while (c == ' ' || c == '\n') c = getchar(); if (c == '-') { neg = true; c = getchar(); } while ('0' <= c && c <= '9') { (n *= 10) += c - '0'; c = getchar(); } n = (neg ? -n : n); return n; } public : template<typename T> T& operator()(T& t) { return read(t); } template<typename Top, typename... Rest> void operator()(Top&& top, Rest&&... rest) { read(top); operator()(std::forward<Rest>(rest)...); } }; template<> std::string& fast_I::read(std::string& s) { s.clear(); while (c == ' ' || c == '\n') c = getchar(); while (c != ' ' && c != '\n') { s.push_back(c); c = getchar(); } return s; } fast_I in; #include <map> int main() { int Q; in(Q); std::map<long long, long long> mp; while (Q--) { int t; long long k, v; in(t, k); if (t == 0) { in(v); mp[k] = v; } else std::cout << mp[k] << '\n'; } }