Submit Info #64830

Problem Lang User Status Time Memory
Associative Array cpp TazrianTahlil AC 390 ms 22.07 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 336 ms 22.07 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 358 ms 14.41 MiB
many_0set_sparse_00 AC 106 ms 2.33 MiB
max_random_00 AC 390 ms 16.11 MiB
max_random_01 AC 388 ms 16.57 MiB
max_random_02 AC 390 ms 16.93 MiB
random_00 AC 137 ms 7.42 MiB
random_01 AC 170 ms 10.92 MiB
random_02 AC 210 ms 11.80 MiB
sparse_keys_00 AC 113 ms 3.83 MiB
sparse_keys_01 AC 134 ms 4.58 MiB
unordered_map_killer_00 AC 318 ms 22.05 MiB
unordered_map_killer_01 AC 326 ms 22.04 MiB
unordered_map_killer_02 AC 317 ms 22.05 MiB

#include <bits/stdc++.h> using ll=long long; using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int Q,m; ll k,v; cin>>Q; unordered_map<ll,ll> a; while(Q--) { cin>>m; if(m==0) { cin>>k>>v; a[k]=v; } else { cin>>k; if(a.count(k)==1) { cout<<a[k]<<'\n'; } else { cout<<"0\n"; } } } return 0; }