Cod sursa(job #2846646)
Utilizator | Data | 9 februarie 2022 14:37:10 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include<iostream>
#include<fstream>
#include<map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
map<int,int> mapa;
int n;
void operatie()
{
int tip,x;
fin>>tip>>x;
if(tip==1)
mapa[x]=1;
else
if(tip==2)
mapa[x]=0;
else
fout<<mapa[x]<<'\n';
}
int main()
{
ios::sync_with_stdio(false);
fin>>n;
while(n--)
operatie();
return 0;
}