Cod sursa(job #1563626)
Utilizator | Data | 6 ianuarie 2016 13:24:25 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
map <int , int> v;
int i , t , n , nr , x;
int main()
{
fin>>n;
for(i=1;i<=n;i++)
{
fin>>t>>x;
if(t==1 && v.find(x)==v.end()) v[x]=++nr;
else if(t==2) v.erase(x);
else fout<< bool(v.find(x)!=v.end());
}
}