Pagini recente » Cod sursa (job #1619584) | wellcodesimulareclasa11-12-9martie | Cod sursa (job #2547908) | Cod sursa (job #2656133) | Cod sursa (job #3297343)
#include <bits/stdc++.h>
using namespace std;
unordered_set <int> st;
int main() {
ifstream fin( "hashuri.in" );
ofstream fout( "hashuri.out" );
int n;
fin >> n;
for ( int i = 1, tip, x; i <= n; i ++ ) {
fin >> tip >> x;
if ( tip == 1 ) {
st.insert( x );
} else if ( tip == 2 ) {
st.erase( x );
} else {
fout << st.count( x ) << '\n';
}
}
return 0;
}