Pagini recente » Cod sursa (job #319464) | Cod sursa (job #2293372) | Cod sursa (job #897144) | Cod sursa (job #1182179) | Cod sursa (job #1076313)
//
// main.cpp
// Test
//
// Created by Alexandru Chelariu on 1/10/14.
// Copyright (c) 2014 Alexandru Chelariu. All rights reserved.
//
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
int main(int argc, const char * argv[])
{
map<int, int> Map;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int N, op, el, nr = 0;
fin >> N;
for(int i = 0; i < N; i++){
fin >> op >> el;
if(op == 1 && Map.find(el) == Map.end()) {
Map[el] = ++nr;
} else if(op == 2) {
Map.erase(el);
} else {
fout << (Map.find(el) != Map.end());
}
}
return 0;
}