Cod sursa(job #2107035)
Utilizator | Data | 16 ianuarie 2018 18:22:07 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
set<int>A;
int main()
{
int N;
f>>N;
for(int i=1;i<=N;i++)
{ int x,y;
f>>x>>y;
if(x==1) A.insert(y);
if(x==2) A.erase(y);
if(x==3) g<<(A.find(y)!=A.end())<<'\n';
}
return 0;
}