Cod sursa(job #1803025)
| Utilizator | Data | 10 noiembrie 2016 21:34:43 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.74 kb |
#include <fstream>
#include <set>
using namespace std;
fstream fin("hashuri.in");
ofstream fout("hashuri.out");
set <int> s;
int i,q,x,n;
int main()
{
fin>>n;
for(i=0;i<n;i++)
{
fin>>q>>x;
if (q == 1)
{
if (s.find(x) == s.end())
s.insert(x);
}
else
if(q == 2)
{
if (s.find(x) != s.end())
s.erase(s.find(x));
}
else
if(q == 3)
{
if (s.find(x) != s.end())
fout << "1\n";
else
fout << "0\n";
}
}
return 0;
}
