Cod sursa(job #1097150)
| Utilizator | Data | 3 februarie 2014 02:21:43 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.57 kb |
#include <stdio.h>
#include <map>
using namespace std;
std::map<int,int> MyMap;
int N,NR;
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]= ++NR; continue; }
if( OPTION == 2 ){ MyMap.erase(VALUE); continue; }
if( OPTION == 3 ) printf("%d\n", (MyMap.find( VALUE ) != MyMap.end()) );
}
return 0;
}
