Pagini recente » Cod sursa (job #2110768) | Cod sursa (job #2495332) | Cod sursa (job #1121109) | Cod sursa (job #221462) | Cod sursa (job #1051617)
#include<fstream>
#include<unordered_map>
using namespace std;
ifstream f ("elmaj.in");
ofstream g("elmaj.out");
unordered_map <int,int> map;
int n,i,x,t;
int main ()
{
f >> n;
maxx = 0;
for (i = 1; i <= n; i++)
{
f >> t >> x;
if (t == 1 && map[x] == 0)
map[x] = 1;
if (t == 2 && map[x] == 1)
map[x] = 0;
if (t == 3 && map[x] == 1)
g << 1 << "\n";
else g << 0 << "\n";
}
f.close();
g.close();
return 0;
}