Submit Info #67049

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 806 ms 62.50 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 508 ms 62.46 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 637 ms 25.08 MiB
many_0set_sparse_00 AC 104 ms 2.32 MiB
max_random_00 AC 806 ms 26.85 MiB
max_random_01 AC 764 ms 29.55 MiB
max_random_02 AC 763 ms 33.05 MiB
random_00 AC 236 ms 16.77 MiB
random_01 AC 283 ms 18.72 MiB
random_02 AC 398 ms 27.77 MiB
sparse_keys_00 AC 115 ms 3.84 MiB
sparse_keys_01 AC 131 ms 4.55 MiB
unordered_map_killer_00 AC 486 ms 62.50 MiB
unordered_map_killer_01 AC 475 ms 62.41 MiB
unordered_map_killer_02 AC 477 ms 62.45 MiB

#include <bits/stdc++.h> using namespace std; typedef long long ll; // size_t read() // { // bool minus=false; // char c=getchar(); // while(c!='-'&&c<'0'||c>'9') c.getchar(); // } int main() { ios::sync_with_stdio(false); cin.tie(0); int q;cin>>q; int c;ll k,v; map<ll,ll> m; for(int i=0;i<q;i++) { cin>>c; if(c) { cin>>k; cout<<m[k]<<"\n"; } else { cin>>k>>v; m[k]=v; } } }