Pagini recente » Diferente pentru blog/cpp11 intre reviziile 52 si 32 | Diferente pentru blog/cpp11 intre reviziile 52 si 49 | Problema saptamanii - Segmente | Diferente pentru utilizator/[email protected] intre reviziile 1 si 2 | Diferente pentru blog/cpp11 intre reviziile 36 si 37
Diferente pentru
blog/cpp11 intre reviziile
#36 si
#37
Nu exista diferente intre titluri.
Diferente intre continut:
using namespace std;
// Some user defined magic constants used for hashing.
const int B = 31;
const int MOD = 666013;
const int P = 666013;
// Courtesy of Adrian Budau
struct myhash {
size_t operator()(const vector<int>& v) const {
size_t value = 1;
for (auto x: v) {
value = (value * B + hash<int>()(x)) % MOD;
value = value * P + hash<int>()(x);
}
return value;
}
vector<int> v = {1, 2, 3};
s.insert(v);
==
You don't need to worry about collisions, $unordered_set$ and $unordered_map$ will take care of that for you.
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.