Cod sursa(job #1987883)

Utilizator ArctopusKacso Peter-Gabor Arctopus Data 1 iunie 2017 13:21:14
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.81 kb
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#include <queue>
#include <climits>
#include <map>
#include <unordered_map>

#define ll long long
#define pb push_back

using namespace std;

 ifstream fin("hashuri.in");
ofstream fout("hashuri.out");

const int NLIM = 1e6 + 10;

int N;
unordered_map< int, int > m;

int main()
{
    ios::sync_with_stdio( false );

    fin >> N;
    while( N-- )
    {
        int t, x;
        fin >> t >> x;

        if( t == 1 )
        {
            m[x] = 1;
        }
        else if( t == 2 )
        {
            m.erase( x );
            //m[x] = 0;
        }
        else
        {
            fout << ( m.find( x ) != m.end() ) << "\n";
            //fout << m[x] << "\n";
        }
    }


    return 0;
}