Cod sursa(job #1604532)
Utilizator | Data | 18 februarie 2016 13:12:28 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
using namespace std;
set<int>x;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
int n,a,b;
fin>>n;
for(int i=1;i<=n;i++)
{
fin>>a>>b;
if(a==1&&x.count(b)==0) x.insert(b);
if(a==2&&x.count(b)==1) x.erase(b);
if(a==3)
{
fout<<x.count(b)<<"\n";
}
}
}