Cod sursa(job #2681397)

Utilizator martinmiere133Cranga Antonio martinmiere133 Data 5 decembrie 2020 13:08:05
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.72 kb
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cstring>
#include <fstream>
#include <algorithm>
#include <set>
#include <bitset>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#define INF 1e9
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int main()
{
   map<int,int> mapa;
   int n;
   f>>n;
   while(n--)
   {
       int op , x;
       f>>op>>x;
       if(op == 1)
       {
           mapa[x] = 1;
       }
       else if(op == 2)
       {
           mapa[x] =0 ;
       }
       else if(op == 3)
       {
           g<<(mapa[x] == 1 ? 1 : 0);g<<'\n';
       }
   }
  return 0;
}