Cod sursa(job #3030535)

Utilizator BadHero112Ursu Vasile BadHero112 Data 17 martie 2023 18:33:44
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.54 kb
#include <bits/stdc++.h>
using ll=long long;
#define S second
#define F first
#define endl '\n'
#define spid ios_base::sync_with_stdio(false);cin.tie(NULL);
const int mod=1e9+7;
const double pi=3.14159265359;
const int maxn=200001;
using namespace std;

int n;

unordered_map<int,int> A;

int main(){
	ifstream cin("hashuri.in");
	ofstream cout("hashuri.out");
	cin>>n;
	while(n--){
		int c, x;
		cin>>c>>x;
		if(c==1)A[x]=1;
		else if(c==2)A.erase(x);
		else{
			if(A.count(x))cout<<1<<endl;
			else cout<<0<<endl;
		}
	}
}