Cod sursa(job #2971234)

Utilizator sandry24Grosu Alexandru sandry24 Data 26 ianuarie 2023 21:00:52
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.71 kb
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
 
void solve(){
    int n;
    cin >> n;
    set<int> s;
    for(int i = 0; i < n; i++){
        int t, x;
        cin >> t >> x;
        if(t == 1)
            s.insert(x);
        else if(t == 2)
            s.erase(x);
        else
            cout << s.count(x) << '\n';
    }
}  
 
int main(){
    freopen("hashuri.in", "r", stdin);
    freopen("hashuri.out", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}