Pagini recente » Cod sursa (job #209235) | Cod sursa (job #297134) | Borderou de evaluare (job #1641036) | Cod sursa (job #2081819) | Cod sursa (job #3230326)
#include <bits/stdc++.h>
#define mod 666013
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,c,x,k;
unordered_map <int,int> a;
/*bool findx(int x)
{
int k=x%mod;
for (auto a:h[k] )
if ( a==x )
return 1;
return 0;
}
void insertx (int x)
{
int k=x%mod;
h[k].push_back(x);
}
void erasex (int x)
{
int k=x%mod;
vector <int> cpy;
for (auto a:h[k] )
if ( a!=x )
cpy.push_back(a);
h[k]=cpy;
}*/
int main()
{
f >> n;
for (int i=1; i<=n; i++ )
{
f >> c >> x;
if ( c==1 )
a[x]++;
else if ( c==2 && a[x] )
a[x]--;
else
g << a[x] << '\n';
}
return 0;
}