Cod sursa(job #2869803)
Utilizator | Data | 11 martie 2022 20:40:28 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.6 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
map<int,bool>h;
int main()
{
int n; in>>n;
for(int i=1;i<=n;i++)
{
int op,x; in>>op>>x;
switch(op)
{
case 1:
{
if(!h[x]) h[x]=1;
break;
}
case 2:
{
if(h[x]) h[x]=0;
break;
}
case 3:
{
out<<h[x]<<'\n';
break;
}
}
}
return 0;
}