Pagini recente » Cod sursa (job #2884639) | Cod sursa (job #842719) | Cod sursa (job #1599146) | Cod sursa (job #28195) | Cod sursa (job #1909924)
#include <fstream>
#include <map>
using namespace std;
map <int,int> mp;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,op,x,i;
int main()
{
f >> n;
for ( i = 1; i <= n; i++ )
{
f >> op >> x;
if ( op == 1 )
mp[x] = 1;
if ( op == 2)
mp[x] = 0;
if ( op == 3 && mp[x] == 1)
g << 1 << "\n";
if ( op == 3 && mp[x] == 0)
g << 0 << "\n";
}
return 0;
}