Pagini recente » Profil petrutsx | Cod sursa (job #2842669) | Cod sursa (job #2141256) | Cod sursa (job #3149964) | Cod sursa (job #1097145)
#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; }
else if( OPTION == 2 ){ MyMap.erase(VALUE); }
else if( OPTION == 3 ) printf("%d\n", (MyMap.find( VALUE ) != MyMap.end()) );
}
return 0;
}