Cod sursa(job #3297343)
Utilizator | Data | 22 mai 2025 14:45:40 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#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;
}