Submit Info #67262

Problem Lang User Status Time Memory
Associative Array cpp piddy AC 540 ms 62.48 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 374 ms 62.45 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 533 ms 25.12 MiB
many_0set_sparse_00 AC 51 ms 2.27 MiB
max_random_00 AC 522 ms 26.82 MiB
max_random_01 AC 524 ms 29.54 MiB
max_random_02 AC 540 ms 33.01 MiB
random_00 AC 173 ms 16.82 MiB
random_01 AC 253 ms 18.74 MiB
random_02 AC 352 ms 27.66 MiB
sparse_keys_00 AC 57 ms 3.85 MiB
sparse_keys_01 AC 65 ms 4.57 MiB
unordered_map_killer_00 AC 358 ms 62.46 MiB
unordered_map_killer_01 AC 359 ms 62.48 MiB
unordered_map_killer_02 AC 361 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(); } return n *= (neg ? -1 : 1); } public : void setup() const { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } 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() { in.setup(); 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'; } }