Submit Info #21104

Problem Lang User Status Time Memory
Associative Array cpp Believe AC 495 ms 43.21 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 366 ms 43.21 MiB
example_00 AC 1 ms 0.67 MiB
many_0set_00 AC 475 ms 21.91 MiB
many_0set_sparse_00 AC 102 ms 2.59 MiB
max_random_00 AC 430 ms 23.34 MiB
max_random_01 AC 471 ms 22.78 MiB
max_random_02 AC 495 ms 24.28 MiB
random_00 AC 159 ms 12.04 MiB
random_01 AC 200 ms 13.21 MiB
random_02 AC 288 ms 20.40 MiB
sparse_keys_00 AC 111 ms 4.17 MiB
sparse_keys_01 AC 131 ms 4.80 MiB
unordered_map_killer_00 AC 333 ms 43.21 MiB
unordered_map_killer_01 AC 337 ms 43.20 MiB
unordered_map_killer_02 AC 357 ms 43.21 MiB

#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int,null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> #define ordered_set_pair tree<pair<int,int>,null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update> #define ordered_set_mutiset tree<int,null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> typedef long long int ll; typedef long double ld; typedef unsigned long long int ull; typedef pair<int,int> pi; #define PI 3.1415926535897932384 #define FOR(i,vv,n) for(ll i=vv;i<n;i++) #define FORR(i,n,vv) for(ll i=n-1;i>=vv;i--) #define ve vector #define maxind(v) (max_element(v.begin(),v.end())-v.begin()) #define minind(v) (min_element(v.begin(),v.end())-v.begin()) #define maxe(v) *max_element(v.begin(),v.end()) #define mine(v) *min_element(v.begin(),v.end()) #define pb push_back #define pf push_front #define ppb pop_back #define ppf pop_front #define eb emplace_back #define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define mp make_pair #define M 1000000007ll #define INF 1000000000000000000ll #define PRECISE cout.precision(18); #define all(v) v.begin(),v.end() #define BS(v,n) binary_search(all(v),n) #define srt(v) sort(v.begin(),v.end()) #define rsrt(v) sort(all(v),greater <ll>()) #define uni(v) v.resize(unique(all(v))-v.begin()) #define F first #define S second #define GET(i,p) get<p>(i) int main(){ // #ifndef ONLINE_JUDGE // // for getting input from input.txt // freopen("input.txt", "r", stdin); // // for writing output to output.txt // freopen("output.txt", "w", stdout); // #endif FAST //PRECISE ll q; cin>>q; unordered_map <ll,ll> m; FOR(i,0,q){ ll x; cin>>x; if(x==1){ ll y;cin>>y; cout<<m[y]<<"\n"; } else{ ll i,j; cin>>i>>j; m[i]=j; } } return 0; }