Cod sursa(job #1076299)
| Utilizator | Data | 10 ianuarie 2014 00:45:09 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.56 kb |
#include <iostream>
#include<fstream>
using namespace std;
int h[1000001];
ifstream f("hashuri.in");
ofstream g("hashuri.out");
void op1(int x)
{
if(h[x]==0)
h[x]=1;
}
void op2(int x)
{
if(h[x]==1)
h[x]=0;
}
int op3(int x)
{
if(h[x]==1)
return 1;
}
int main()
{
int nr,i,x,op;
f>>nr;
for(i=1;i<=nr;i++)
{
f>>op>>x;
if(op==1)
op1(x);
else if(op==2)
op2(x);
else if(op==3)
g<<op3(x)<<endl;
}
return 0;
}
