Pagini recente » Cod sursa (job #1366224) | Cod sursa (job #470087) | Cod sursa (job #1646705) | Cod sursa (job #363041) | Cod sursa (job #393430)
Cod sursa(job #393430)
#include <fstream>
#include <map>
using namespace std;
map<int, int> hash;
int main()
{
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n;
f >> n;
int x, y , i;
for(i = 0; i < n; ++i)
{
f >> x >> y;
if(x == 1 && hash.find( y ) == hash.end())
hash.insert(make_pair(y, 1));
else if(x == 2) hash.erase(y);
else if(x == 3) g << (hash.find(y) != hash.end()) << "\n";
}
return 0;
}