Cod sursa(job #1564015)
Utilizator | Mihailescu Ionut Emanuel emii | Data | 7 ianuarie 2016 19:37:39 |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.61 kb |
#include <fstream>
#include<unordered_map>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int main()
{
unordered_map <long long,int> v;
long long n,x,y;
f>>n;
for(long long i=1;i<=n;i++)
{
f>>x>>y;
if(x==1)
v.insert(make_pair(y,1));
else
if(x==2)
if(v.find(y)!=v.end())
v.erase(y);
else;
else
if(v.find(y)!=v.end())
g<<"1\n";
else
g<<"0\n";
}
return 0;
}