Cod sursa(job #608402)
| Utilizator | Data | 16 august 2011 15:35:56 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.46 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
long long n,i,x;
int o;
set<int> M;
int main() {
f >> n;
for (i=1;i<=n;i++) {
f >> o >> x;
if (o==1) M.insert(x);
if (o==2) M.erase(x);
if (o==3) {
if (M.find(x) != M.end()) g << 1 << '\n';
else g << 0 << '\n';
}
}
f.close();g.close();
return 0;
}
