Cod sursa(job #1097145)
| Utilizator | Data | 3 februarie 2014 02:15:05 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.56 kb |
#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;
}
