Cod sursa(job #1819194)

Utilizator Fanika123Tanasa Stefan Fanika123 Data 30 noiembrie 2016 12:54:02
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.46 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");

map <int,bool> h;
int n;

int main()
{
    int op,x;

    fin>>n;
    while(n--)
    {
        fin>>op>>x;
        if (op==1) h[x]=true;
        else if (op==2) h[x]=false;
        else
        {
            if (h[x]==true) fout<<"1\n";
            else fout<<"0\n";
        }
    }
    fin.close();
    fout.close();
    return 0;
}