Cod sursa(job #1895505)

Utilizator cristicretancristi cretan cristicretan Data 27 februarie 2017 23:50:59
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
#include <bits/stdc++.h>
#define NMax 1000001
#define mod 666013
using namespace std;

ifstream f("hashuri.in");
ofstream g("hashuri.out");

int n, foo, x;
multiset<int> H;

int main()
{
    f >> n;
    for(int i = 1; i <= n; ++i)
    {
        f >> foo >> x;
        if(foo == 1) H.insert(x);
        if(foo == 2) H.erase(x);
        if(foo == 3 && H.find(x) != H.end()) g << 1 << '\n';
        else if (foo == 3) g << 0 << '\n';
    }
    return 0;
}