Cod sursa(job #3031142)
Utilizator | Data | 18 martie 2023 20:52:55 | |
---|---|---|---|
Problema | Hashuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
#include <bits/stdc++.h>
using namespace std ;
ifstream fin("hashuri.in") ;
ofstream fout("hashuri.out") ;
unordered_map <int,int> f ;
int n,op,x ;
int main()
{
fin>>n ;
for(int i=1; i<=n; ++i)
{
fin>>op>>x ;
if(op==1) f[x]=1 ;
else if(op==2) f.erase(x) ;
else fout<<f[x]<<'\n' ;
}
return 0 ;
}