Pagini recente » Cod sursa (job #2291397) | Istoria paginii runda/ason/clasament | Cod sursa (job #1492966) | Cod sursa (job #350279) | Cod sursa (job #886727)
Cod sursa(job #886727)
#include <fstream>
#include <map>
std::ifstream in("hashuri.in");
std::ofstream out("hashuri.out");
std::map<int, int> a;
void op1(int x)
{
if ( a[x] == 0 ) a[x] = 1;
}
void op2 (int x)
{
if ( a[x] == 1 ) a[x] = 0;
}
int op3 (int x)
{
if ( a[x] == 1 ) return 1;
else return 0;
}
int main()
{
int n;
in >> n;
for (int i = 0; i < n; ++i)
{
int a,b;
in >> a >> b;
if ( a == 1 ) op1(b);
else if ( a == 2 ) op2(b);
else if ( a == 3 ) out << op3(b) << '\n';
}
in.close();
out.close();
return 0;
}