Submit Info #68503

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 827 ms 62.46 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 510 ms 62.44 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 827 ms 25.06 MiB
many_0set_sparse_00 AC 105 ms 2.27 MiB
max_random_00 AC 774 ms 26.80 MiB
max_random_01 AC 818 ms 29.52 MiB
max_random_02 AC 762 ms 33.07 MiB
random_00 AC 313 ms 16.82 MiB
random_01 AC 291 ms 18.70 MiB
random_02 AC 427 ms 27.69 MiB
sparse_keys_00 AC 114 ms 3.82 MiB
sparse_keys_01 AC 132 ms 4.48 MiB
unordered_map_killer_00 AC 471 ms 62.43 MiB
unordered_map_killer_01 AC 472 ms 62.46 MiB
unordered_map_killer_02 AC 471 ms 62.42 MiB

#include<bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define rep(i,a,b) for(int i=a;i<b;i++) #define all(a) (a).begin(),(a).end() #define ps(x,y) fixed<<setprecision(y)<<x //cout<<ps(ans,5); #define sz(a) ((int) (a).size())//this is to avoid common error in far manager #define fastIO ios::sync_with_stdio(0);cin.tie(0); void IO(){ #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); freopen("error.txt","w",stderr); #endif } void solve(){ int q;cin>>q; map<int,int>m; while(q--){ int fft;cin>>fft; if(fft==0){ int k,v;cin>>k>>v; m[k]=v; } else{ int k;cin>>k; cout<<m[k]<<endl; } } } int32_t main(){ fastIO // IO(); int t=1; //cin>>t; for(int i=1;i<=t;i++){ //cout<<"Case #"<<i<<": "; solve(); } return 0;} /* 1)FIND THAT BICH TEST CASE 2)FIGHT TILL LAST milliSECOND 3)Think!Think!Think!Think!Think!Think!Think!Think!Think! */