Pagini recente » Cod sursa (job #1560616) | Cod sursa (job #736784) | Cod sursa (job #1428460) | Istoria paginii runda/icrisop_color4/clasament | Cod sursa (job #2760827)
//
// main.cpp
// hashuri
//
// Created by Vlad Calomfirescu on 29.06.2021.
//
#include <iostream>
#include <fstream>
#include <unordered_set>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main() {
unordered_set<int> hashh;
int n,op,x;
fin>>n;
for (int i=0; i<n; i++)
{
fin>>op>>x;
if(op==1)
{
hashh.insert(x);
continue;
}
if (op==2)
{
hashh.erase(x);
continue;
}
if(op==3)
{
fout<< (hashh.find(x) != hashh.end())<<endl;
}
// fin>>op;
// switch(op){
// case 1:
// fin>>x;
// hashh.insert(x);
// continue;
// case 2:
// fin>>x;
// hashh.erase(x);
// continue;
// case 3:
// fin>>x;
// if(hashh.find(x) != hashh.end())
// cout<<1<<endl;
// else
// cout<<0<<endl;
// }
}
return 0;
}