Cod sursa(job #1921515)
| Utilizator | Data | 10 martie 2017 13:00:16 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f ("hashuri.in");
ofstream t ("hashuri.out");
typedef unordered_map <int,bool> int_hash;
int main()
{
int_hash table;
int n;
f>>n;
for (int type,target;n;--n){
f>>type>>target;
if (type==1)
table.emplace(target,true);
else if (type==2)
table[target]=false;
else if (type==3)
t<<table[target]<<'\n';
}
return 0;
}
