Submit Info #66193

Problem Lang User Status Time Memory
Associative Array cpp Nachia AC 663 ms 31.95 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 428 ms 31.86 MiB
example_00 AC 1 ms 0.45 MiB
many_0set_00 AC 615 ms 20.36 MiB
many_0set_sparse_00 AC 105 ms 2.29 MiB
max_random_00 AC 650 ms 22.13 MiB
max_random_01 AC 663 ms 23.22 MiB
max_random_02 AC 657 ms 24.45 MiB
random_00 AC 222 ms 10.92 MiB
random_01 AC 285 ms 12.48 MiB
random_02 AC 391 ms 16.77 MiB
sparse_keys_00 AC 115 ms 3.95 MiB
sparse_keys_01 AC 133 ms 4.57 MiB
unordered_map_killer_00 AC 399 ms 31.87 MiB
unordered_map_killer_01 AC 396 ms 31.82 MiB
unordered_map_killer_02 AC 396 ms 31.95 MiB

#include<bits/stdc++.h> using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main() { map<ULL, ULL> A; int Q; cin >> Q; while (Q--) { int c; cin >> c; if (c == 0) { ULL k, v; cin >> k >> v; A[k] = v; } if (c == 1) { ULL k; cin >> k; auto i = A.find(k); if(i == A.end()) cout << "0\n"; else cout << i->second << "\n"; } } return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;