Cod sursa(job #2588745)

Utilizator KillHorizon23Orban Robert KillHorizon23 Data 25 martie 2020 13:26:51
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.51 kb
#include <bits/stdc++.h>
using namespace std;

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

set < int > v[666013];

int main()
{
    int t, op, x;
    fin >> t;
    while (t--)
    {
        fin >> op >> x;
        if (op != 3)
        {
            if (op == 1)
                v[x % 666013].insert(x);
            else if (op == 2)
                v[x % 666013].erase(x);
        }
        else
            fout << (v[x % 666013].find(x) != v[x % 666013].end()) << "\n";
    }
}