Cod sursa(job #2574038)

Utilizator MihclerioVladimir Chim Mihclerio Data 5 martie 2020 20:05:25
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.91 kb
#pragma GCC optimize("Ofast")
/*
       /\__/\
      ( • - •)
        /  >🍪

  why hack me, better eat a cookie
*/
#include<bits/stdc++.h>

#define Plan_B() cout<<"HESOYAM"

#define all(s) s.begin(),s.end()
#define rc(x) return cout<<x,0

#define pb push_back
#define mp make_pair
#define fr first
#define sc second

typedef long long ll;

const ll nmax=2e5+3;
const ll mod=998244353;
const ll inf=2e9+3;

using namespace std;

#define DEBUG

int main()
{
#ifdef DEBUG
  freopen("hashuri.in","r",stdin);
  freopen("hashuri.out","w",stdout);
#endif
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);

  int t;
  cin>>t;
  set<int>s;
  while(t--)
  {
    int k,x;
    cin>>k>>x;
    if(k==1) s.insert(x);
    if(k==2) s.erase(x);
    if(k==3) cout<<(s.find(x)!=s.end())<<"\n";
  }

}