Pagini recente » Cod sursa (job #1886959) | Cod sursa (job #1460770) | Cod sursa (job #1801633) | Cod sursa (job #1622064) | Cod sursa (job #1423512)
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map<int, int> smth;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int N;
fin >> N;
for (int op, x; N; N--){
fin >> op >> x;
if (op == 1)
if(!smth.count(x))
smth[x] = 1;
if (op == 2)
if(smth.count(x))
smth[x] = 0;
if (op == 3)
fout << smth[x] << '\n';
}
return 0;
}