Cod sursa(job #2759793)

Utilizator RobertAcAcatrinei Robert-Marian RobertAc Data 20 iunie 2021 15:11:29
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <bits/stdc++.h>

using namespace std;
unordered_map<string,bool> m;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
int main(){
    int n;
    in>>n;
    for(;n;n--){
        char c;
        string x;
        in>>c>>x;
        if(c=='1')m[x]=1;
        else if(c=='2')m.erase(x);
        else {if(!m[x]){m.erase(x);out<<0<<'\n';}
              else out<<1<<'\n';
        }
    }
}