Pagini recente » Cod sursa (job #2923345) | Cod sursa (job #1056046) | Cod sursa (job #1188170) | Cod sursa (job #1072551) | Cod sursa (job #1097147)
#include <stdio.h>
#include <map>
using namespace std;
std::map<int,int> MyMap;
int main()
{
freopen("hashuri.in" ,"r",stdin);
freopen("hashuri.out","w",stdout);
int N; scanf("%d", &N);
int OPTION,VALUE;
for(; N; --N ){
scanf("%d%d", &OPTION, &VALUE );
if( OPTION == 1 ){ if( MyMap.find( VALUE ) == MyMap.end() ) MyMap[VALUE]=1; continue; }
if( OPTION == 2 ){ MyMap.erase(VALUE); continue; }
if( OPTION == 3 ) printf("%d\n", (MyMap.find( VALUE ) != MyMap.end()) );
}
return 0;
}