Cod sursa(job #2933208)

Utilizator ciacliboiiiciacli stefan ciacliboiii Data 4 noiembrie 2022 20:36:54
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <bits/stdc++.h>

using namespace std;
map<long long, int>m;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
void ins(int x)
{
    m[x] = 1;
}
void ers(int x)
{
    m[x] = 0;
}
void ct(int x)
{
    fout << m[x] << '\n';
}
int main()
{
   int nrop, op, x;
   fin >> nrop;
   for(int j = 1; j <= nrop; ++ j)
   {
       fin >> op >> x;
       if(op == 1)
        ins(x);
       else if(op == 2)
        ers(x);
       else
        ct(x);
   }
    return 0;
}