Submit Info #66391

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 547 ms 43.00 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 372 ms 43.00 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 464 ms 21.61 MiB
many_0set_sparse_00 AC 101 ms 2.32 MiB
max_random_00 AC 528 ms 23.07 MiB
max_random_01 AC 547 ms 22.40 MiB
max_random_02 AC 500 ms 23.93 MiB
random_00 AC 164 ms 11.79 MiB
random_01 AC 208 ms 12.91 MiB
random_02 AC 303 ms 20.13 MiB
sparse_keys_00 AC 110 ms 3.86 MiB
sparse_keys_01 AC 130 ms 4.51 MiB
unordered_map_killer_00 AC 329 ms 42.99 MiB
unordered_map_killer_01 AC 330 ms 42.96 MiB
unordered_map_killer_02 AC 336 ms 42.98 MiB

#include <bits/stdc++.h> #define ALL(t) (t).begin(), (t).end() #define CLR(a) memset((a), 0, sizeof(a)) #define log cerr #define vi vector<int> #define vii vector<vector<int>> #define dump(x) log << #x << " = " << (x) << endl using namespace std; template <class T> void debug(T a, T b) { for (; a != b; ++a) log << *a << ' '; log << endl; } typedef long long int lint; typedef pair<int, int> pi; int q; unordered_map<lint, lint> m; lint c, k, v; int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> q; while (q--) { cin >> c >> k; if (c == 0) { cin >> v; m[k] = v; } else { cout << m[k] << "\n"; } } return 0; }