Cod sursa(job #2303061)

Utilizator Groza_Iulia_DianaGroza Iulia Diana Groza_Iulia_Diana Data 15 decembrie 2018 14:56:52
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.61 kb
#include <bits/stdc++.h>

using namespace std;

int n, nr, x, y;

map<int, int> C;

int main()
{
    freopen("hashuri.in", "r", stdin);
    freopen("hashuri.out", "w", stdout);
    scanf("%d", &n);
    while(n--)
    {
        scanf("%d%d", &x, &y);
        switch(x)
        {
            case 1:
                if(C.find(y)==C.end())
                    C[y]=++nr;
                break;
            case 2:
                C.erase(y);
                break;
            case 3:
                printf("%d\n", C.find(y)!=C.end());
                break;
        }
    }
    return 0;
}