Pagini recente » Cod sursa (job #408654) | Cod sursa (job #659558) | Cod sursa (job #2357534) | Cod sursa (job #2403033) | Cod sursa (job #1155706)
#include <iostream>
#include <fstream>
#include <map>
#define TEST 666133
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, nr, type, x;
map<int, int> m;
int main()
{
f >> n;
nr = 0;
for(int i = 0; i < n; ++i)
{
f >> type >> x;
x %= TEST;
if(type == 1 && m.find(x) == m.end())
m[x] = nr++;
if(type == 2)
m.erase(x);
if(type == 3)
g << (m.find(x) != m.end()) << "\n";
}
}