Submit Info #67483

Problem Lang User Status Time Memory
Associative Array cpp Arman001MK AC 1056 ms 62.53 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 779 ms 62.53 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 919 ms 25.07 MiB
many_0set_sparse_00 AC 211 ms 2.32 MiB
max_random_00 AC 965 ms 26.81 MiB
max_random_01 AC 946 ms 29.52 MiB
max_random_02 AC 1056 ms 33.05 MiB
random_00 AC 349 ms 16.79 MiB
random_01 AC 463 ms 18.65 MiB
random_02 AC 636 ms 27.71 MiB
sparse_keys_00 AC 220 ms 3.84 MiB
sparse_keys_01 AC 265 ms 4.59 MiB
unordered_map_killer_00 AC 764 ms 62.44 MiB
unordered_map_killer_01 AC 743 ms 62.47 MiB
unordered_map_killer_02 AC 745 ms 62.46 MiB

#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <unordered_map> #include <unordered_set> #include <algorithm> #include <cstring> #include <cassert> #include <chrono> #include <random> #include <bitset> #include <cstdio> #include <vector> #include <string> #include <stack> #include <queue> #include <ctime> #include <cmath> #include <list> #include <map> #include <set> using namespace std; #define ll long long void fastIO() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } void setIO(string str = "") { fastIO(); if(str != "") { freopen((str + ".in").c_str(), "r", stdin); freopen((str + ".out").c_str(), "w", stdout); } } bool is_prime(int num) { if(num < 2) return false; if(num == 2) return true; if(num%2 == 0) return false; for(int i = 3; i * i <= num; i+=2) if(num%i==0) return false; return true; } int gcd(int a, int b) { while(a!=b) if(a>b)a-=b; else b-=a; return a; } void solve() { map<ll, ll> mp; int t; cin>>t; bool x; ll v, k; for (int i = 0; i < t; ++i) { cin>>x>>k; if(x) cout<<mp[k]<<endl; else { cin>>v; mp[k] = v; } } } int main() { setIO(""); solve(); return 0; }