Submit Info #65750

Problem Lang User Status Time Memory
Associative Array cpp Duukh AC 1540 ms 62.51 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 1301 ms 62.42 MiB
example_00 AC 1 ms 0.41 MiB
many_0set_00 AC 1380 ms 25.02 MiB
many_0set_sparse_00 AC 383 ms 2.30 MiB
max_random_00 AC 1472 ms 26.82 MiB
max_random_01 AC 1532 ms 29.45 MiB
max_random_02 AC 1540 ms 33.07 MiB
random_00 AC 555 ms 16.70 MiB
random_01 AC 672 ms 18.61 MiB
random_02 AC 877 ms 27.69 MiB
sparse_keys_00 AC 419 ms 3.82 MiB
sparse_keys_01 AC 497 ms 4.58 MiB
unordered_map_killer_00 AC 1187 ms 62.45 MiB
unordered_map_killer_01 AC 1174 ms 62.51 MiB
unordered_map_killer_02 AC 1182 ms 62.49 MiB

#include <bits/stdc++.h> using namespace std; #define fr first #define sc second void setIO(string prob) { freopen((prob + ".in").c_str(), "r", stdin); freopen((prob + ".out").c_str(), "w", stdout); } void setIO() { freopen("input.txt","r", stdin); freopen("output.txt", "w", stdout); } int arr[1001]; int main(){ long long n,a,b,c; cin>>n; map<long long,long long> mp; while(n--){ cin>>a; if(a == 0){ cin>>b>>c; mp[b] = c; } else{ cin>>b; cout<<mp[b]<<endl; } } }