Submit Info #66392

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 439 ms 43.01 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 360 ms 42.92 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 394 ms 21.56 MiB
many_0set_sparse_00 AC 102 ms 2.31 MiB
max_random_00 AC 416 ms 23.08 MiB
max_random_01 AC 424 ms 22.38 MiB
max_random_02 AC 439 ms 24.00 MiB
random_00 AC 158 ms 11.73 MiB
random_01 AC 189 ms 12.86 MiB
random_02 AC 314 ms 20.07 MiB
sparse_keys_00 AC 110 ms 3.82 MiB
sparse_keys_01 AC 132 ms 4.59 MiB
unordered_map_killer_00 AC 371 ms 42.93 MiB
unordered_map_killer_01 AC 363 ms 43.01 MiB
unordered_map_killer_02 AC 361 ms 42.89 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; }