Cod sursa(job #2020441)
Utilizator | Data | 10 septembrie 2017 12:29:20 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.48 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_map <int,bool> mp;
int main()
{
int n,x,y;
in >> n;
mp.reserve(n);
mp.max_load_factor(0.25);
while (n--)
{
in >> x >> y;
switch (x)
{
case 1: mp[y] = 1;
break;
case 2: mp[y] = 0;
break;
case 3: out << mp[y] << "\n";
break;
}
}
}