Cod sursa(job #3319143)
| Utilizator | Data | 30 octombrie 2025 17:56:43 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.57 kb |
#include <iostream>
#include<unordered_map>
#include<fstream>
using namespace std;
unordered_map<int,int> mapa;
int n,i,x,op;
ifstream fcin("hashuri.in");
ofstream fcout("hashuri.out");
int main()
{
fcin>>n;
for(i=1; i<=n; i++)
{
fcin>>op>>x;
if(op==1)
{
if(mapa[x]==0)mapa[x]++;
}
else if(op==2)
{
if(mapa[x]>0)mapa[x]--;
}
else if(op==3)
{
if(mapa[x]>0)fcout<<"1"<<"\n";
else fcout<<"0"<<"\n";
}
}
}
