Pagini recente » Cod sursa (job #428428) | Cod sursa (job #1284880) | Istoria paginii runda/simulareoni2011x2/clasament | Profil Djok | Cod sursa (job #1097148)
#include <stdio.h>
#include <map>
using namespace std;
std::map<int,int> MyMap;
int N;
int main()
{
freopen("hashuri.in" ,"r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d", &N);
int OPTION,VALUE;
for(; N; --N ){
scanf("%d%d", &OPTION, &VALUE );
if( OPTION == 1 && 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;
}