Submit Info #68507

Problem Lang User Status Time Memory
Associative Array cpp iamvaruag AC 417 ms 43.00 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 366 ms 42.91 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 379 ms 21.59 MiB
many_0set_sparse_00 AC 98 ms 2.32 MiB
max_random_00 AC 401 ms 23.11 MiB
max_random_01 AC 417 ms 22.49 MiB
max_random_02 AC 415 ms 23.93 MiB
random_00 AC 181 ms 11.81 MiB
random_01 AC 229 ms 12.93 MiB
random_02 AC 335 ms 20.07 MiB
sparse_keys_00 AC 108 ms 3.84 MiB
sparse_keys_01 AC 129 ms 4.61 MiB
unordered_map_killer_00 AC 386 ms 43.00 MiB
unordered_map_killer_01 AC 373 ms 42.96 MiB
unordered_map_killer_02 AC 374 ms 42.95 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; unordered_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! */