Submit Info #68018

Problem Lang User Status Time Memory
Associative Array cpp q_va629 AC 434 ms 42.98 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 360 ms 42.98 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 410 ms 21.63 MiB
many_0set_sparse_00 AC 101 ms 2.32 MiB
max_random_00 AC 417 ms 23.05 MiB
max_random_01 AC 423 ms 22.42 MiB
max_random_02 AC 434 ms 23.96 MiB
random_00 AC 160 ms 11.78 MiB
random_01 AC 188 ms 12.91 MiB
random_02 AC 262 ms 20.12 MiB
sparse_keys_00 AC 111 ms 3.83 MiB
sparse_keys_01 AC 132 ms 4.59 MiB
unordered_map_killer_00 AC 336 ms 42.96 MiB
unordered_map_killer_01 AC 337 ms 42.90 MiB
unordered_map_killer_02 AC 336 ms 42.90 MiB

#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair<int, int>; using pdd = pair<ld, ld>; using pll = pair<ll, ll>; using pli = pair<ll, int>; using pil = pair<int, ll>; template <typename T> using Graph = vector<vector<T>>; const int MOD = 998244353; const ld PI = acos(-1); int main() { cin.tie(0); ios::sync_with_stdio(false); int Q; cin >> Q; unordered_map<ll, ll> mp; while (Q--) { int t; ll k; cin >> t >> k; if (t) { cout << mp[k] << "\n"; } else { ll v; cin >> v; mp[k] = v; } } return 0; }