Pagini recente » Cod sursa (job #232036) | Borderou de evaluare (job #373043) | Diferente pentru problema/adlic intre reviziile 1 si 3 | Cod sursa (job #1987132) | Cod sursa (job #2978835)
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,t,x;
unordered_map <int,bool>a;
int main()
{
f>>n;
while(n--)
{
f>>t>>x;
if(t==1)
{
auto it = a.find(x);
if(it==a.end())
a.insert({x,1});
}
else
if(t==2)
{
auto it = a.find(x);
if(it!=a.end())
a.erase(x);
}
else
{
auto it =a.find(x);
if(it!=a.end())
g<<1<<'\n';
else
g<<0<<'\n';
}
}
return 0;
}