Cod sursa(job #2743587)
Utilizator | Data | 23 aprilie 2021 12:05:46 | |
---|---|---|---|
Problema | Hashuri | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.58 kb |
#include <bits/stdc++.h>
using namespace std;
unordered_map<int, bool> m;
int main()
{
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, com, x;
f>>n;
for(short i=0; i<n; ++i)
{
f>>com>>x;
if(com==1)
{
if(m.find(x) == m.end())
m[x]=1;
}
else
if(com == 2)
m.erase(x);
else
if(m.find(x) == m.end())
g<<0<<"\n";
else
g<<1<<"\n";
}
return 0;
}