Submit Info #65857

Problem Lang User Status Time Memory
Associative Array cpp (anonymous) AC 1740 ms 62.50 MiB

ケース詳細
Name Status Time Memory
2_powers_00 AC 1298 ms 62.50 MiB
example_00 AC 1 ms 0.42 MiB
many_0set_00 AC 1650 ms 25.03 MiB
many_0set_sparse_00 AC 393 ms 2.32 MiB
max_random_00 AC 1697 ms 26.87 MiB
max_random_01 AC 1725 ms 29.45 MiB
max_random_02 AC 1740 ms 33.07 MiB
random_00 AC 639 ms 16.75 MiB
random_01 AC 766 ms 18.61 MiB
random_02 AC 995 ms 27.68 MiB
sparse_keys_00 AC 421 ms 3.84 MiB
sparse_keys_01 AC 500 ms 4.57 MiB
unordered_map_killer_00 AC 1187 ms 62.41 MiB
unordered_map_killer_01 AC 1178 ms 62.44 MiB
unordered_map_killer_02 AC 1173 ms 62.39 MiB

#include <math.h> #include <string> #include <map> #include <set> #include <iostream> #include <vector> #include <algorithm> #include <limits.h> using namespace std; long long q, thing; long long num, whatever; //string cow; int main(){ // freopen("notlast.in","r",stdin); // freopen("notlast.out","w",stdout); map<long long, long long> cows; cin >> q; for(long long i = 0; i<q; i++){ cin >> num; if(num == 0){ cin >> thing >> whatever; cows[thing] = whatever; } else{ cin >> thing; cout << cows[thing] << endl; } } }