Cod sursa(job #2745633)
Utilizator | Data | 26 aprilie 2021 20:57:34 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map<int, int> h;
int n, y;
long long x;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin>>n;
for (int i = 0; i < n; ++i) {
fin>>y>>x;
if (y == 1)
h[x] = 1;
else if (y == 2)
h.erase(x);
else
fout<<h[x]<<endl;
}
return 0;
}