Cod sursa(job #2400644)

Utilizator The_one_and_onlyMironica Vasile The_one_and_only Data 8 aprilie 2019 23:02:13
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <fstream>
#include <set>
#define mod 576101
typedef unsigned long long ll;
using namespace std;

ifstream cin("hashuri.in");
ofstream cout("hashuri.out");

set<ll> a[mod];
int n;

int main() {
	cin >> n;
	while(n--) {
		ll h;
		int cer;
		cin >> cer >> h;
		switch(cer) {
			case 1:
				a[h % mod].insert(h);
				break;
			case 2:
				a[h % mod].erase(h);
				break;
			case 3:
				cout << (a[h % mod].find(h) != a[h % mod].end()) << '\n';
				break;
		}
	}
	return 0;
}