Pagini recente » Diferente pentru problema/pinex intre reviziile 26 si 34 | Diferente pentru problema/viteza2 intre reviziile 2 si 1 | Diferente pentru problema/ab intre reviziile 1 si 19 | Atasamentele paginii Profil vijzor | Diferente pentru blog/resourcehog intre reviziile 6 si 5
Nu exista diferente intre titluri.
Diferente intre continut:
To paraphrase, the problem asks for a data structure with the following operations
* use_resources(name, quantity) which does resources[name] += quantity
* get_approximate_max() which returns name1 such that max(resources[name]) / 2 <= resources[name1] <= max(resources[name])
* get_approximate_top() which returns name1 such that max(resources[name]) / 2 <= resources[name1] <= max(resources[name])
Using a map in combination with heap gives us a solution with O(log n) time for each of the two operations. Can we do better?
Using a map in combination with a hash table gets a solution that has O(log n) complexity for use_resources and get_approximate
_top which is too slow.
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.