Cod sursa(job #2744883)
Utilizator | Data | 25 aprilie 2021 14:34:27 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n,p;
string x;
int main(){
unordered_map<string, int> hash_table;
fin>>n;
for(int i=0; i<n; i++){
fin>>p>>x;
if(p==1)
hash_table[x]=1;
if(p==2)
hash_table[x]=0;
if(p==3)
fout<<hash_table[x]<<'\n';
}
}