Cod sursa(job #1389788)
Utilizator | Data | 16 martie 2015 17:39:55 | |
---|---|---|---|
Problema | Hashuri | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.44 kb |
#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
map <int,int > M;
int main()
{
int T,x,y;
freopen ("hashuri.in","r",stdin);
freopen ("hashuri.out","w",stdout);
scanf("%d", &T);
while(T--)
{
scanf("%d%d", &x,&y);
if(x==1) M[y]++;
if(x==2) M[y]--;
if(x==3)
if(M[y]) printf("1\n");
else printf("0\n");
}
return 0;
}