Pagini recente » Cod sursa (job #581451) | Cod sursa (job #3240821) | Cod sursa (job #2641748) | Cod sursa (job #1870861) | Cod sursa (job #1376620)
#include <fstream>
#include <map>
using namespace std;
ifstream is ("hashuri.in");
ofstream os ("hashuri.out");
map <int,int> M;
int N, type, x, cnt;
int main()
{
is >> N;
for(int i = 1; i <= N; ++i)
{
is >> type >> x;
switch(type) {
case 1:
if(M.find(x) == M.end()) M[x] = 1;
break;
case 2:
M.erase(x);
break;
case 3:
if(M.find(x) == M.end()) os << "0\n";
else os << "1\n";
}
}
is.close();
os.close();
return 0;
}