Cod sursa(job #3245824)
Utilizator | Data | 30 septembrie 2024 19:47:13 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, x, y;
set<int> s;
int main() {
fin >> n;
while(n--) {
fin >> x >> y;
if(x == 1) s.insert(y);
else if(x == 2){
if(s.count(y)) s.erase(y);
}
else {
if(s.count(y)) fout << "1\n";
else fout << "0\n";
}
}
return 0;
}