Cod sursa(job #3233191)

Utilizator Roman70Maruseac Roman Roman70 Data 2 iunie 2024 18:54:07
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.52 kb
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;


int main()
{   
    freopen("hashuri.in","r",stdin);
    freopen("hashuri.out","w",stdout);
   
   int n;
   cin >> n;
   set<ll>pos;
   while(n--){
       int q;
       cin >> q;
       ll x;
       cin >> x;
       if(q == 1) pos.insert(x);
       if(q == 2) pos.erase(x);
       if(q == 3){
           if(pos.find(x) != pos.end()) cout << 1;
           else cout << 0;
           cout<<"\n";
       }
   }
    
    
    


    return 0;
}