Pagini recente » Cod sursa (job #719928) | Cod sursa (job #1769848) | Cod sursa (job #1293114) | Cod sursa (job #3150996) | Cod sursa (job #1097146)
#include <stdio.h>
#include <map>
using namespace std;
int main()
{
freopen("hashuri.in" ,"r",stdin);
freopen("hashuri.out","w",stdout);
int N; scanf("%d", &N);
int OPTION,VALUE;
std::map<int,bool> MyMap;
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;
}