Submit Info #67261

Problem Lang User Status Time Memory
Associative Array cpp RTnF AC 1219 ms 22.10 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 1132 ms 22.09 MiB
example_00 AC 1 ms 0.41 MiB
many_0set_00 AC 1095 ms 14.37 MiB
many_0set_sparse_00 AC 392 ms 2.27 MiB
max_random_00 AC 1173 ms 16.12 MiB
max_random_01 AC 1190 ms 16.49 MiB
max_random_02 AC 1219 ms 16.94 MiB
random_00 AC 449 ms 7.43 MiB
random_01 AC 543 ms 10.84 MiB
random_02 AC 681 ms 11.82 MiB
sparse_keys_00 AC 430 ms 3.82 MiB
sparse_keys_01 AC 509 ms 4.48 MiB
unordered_map_killer_00 AC 1046 ms 22.00 MiB
unordered_map_killer_01 AC 1018 ms 22.01 MiB
unordered_map_killer_02 AC 1016 ms 22.10 MiB

#line 1 "Array/AssociativeArray.test.cpp" #define PROBLEM "https://judge.yosupo.jp/problem/associative_array" #line 2 "Template/SmallTemplate.cpp" #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; constexpr ll MOD = 1e9 + 7; constexpr ll INF = 1e+18; constexpr ld EPS = 1e-12L; constexpr ld PI = 3.14159265358979323846L; #line 3 "Array/AssociativeArray.test.cpp" int main() { unordered_map<ll, ll> mp; int q; cin >> q; while(q--) { int type; ll k; cin >> type >> k; if(type) { if(mp.count(k)){ cout << mp[k] << '\n'; }else{ cout << "0\n"; } } else { ll x; cin >> x; mp[k] = x; } } }