Submit Info #67050

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 560 ms 62.47 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 363 ms 62.47 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 504 ms 25.07 MiB
many_0set_sparse_00 AC 50 ms 2.35 MiB
max_random_00 AC 511 ms 26.87 MiB
max_random_01 AC 522 ms 29.57 MiB
max_random_02 AC 560 ms 33.04 MiB
random_00 AC 172 ms 16.81 MiB
random_01 AC 212 ms 18.69 MiB
random_02 AC 322 ms 27.69 MiB
sparse_keys_00 AC 55 ms 3.88 MiB
sparse_keys_01 AC 64 ms 4.51 MiB
unordered_map_killer_00 AC 350 ms 62.46 MiB
unordered_map_killer_01 AC 353 ms 62.47 MiB
unordered_map_killer_02 AC 348 ms 62.45 MiB

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