Cod sursa(job #2681402)

Utilizator martinmiere133Cranga Antonio martinmiere133 Data 5 decembrie 2020 13:18:21
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.73 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");
map<int,int> m;
int main()
{

   int n;
   int op , x;
   f>>n;
   while(n--)
   {

       f>>op>>x;
       if(op == 1 && m.find(x) == m.end())
       {
           m[x] = 1;
       }
       else if(op == 2)
       {
           m.erase(x);
       }
       else if(op == 3)
       {
           g<<(m.find(x) != m.end())<<'\n';
       }
   }
  return 0;
}