Pagini recente » Diferente pentru utilizator/bibilutza intre reviziile 2 si 3 | Cod sursa (job #663477) | Diferente pentru utilizator/arkiny intre reviziile 26 si 25 | Cod sursa (job #1472240) | Diferente pentru blog/resourcehog intre reviziile 8 si 9
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
* use_resources(name, quantity) which does resources[name] += quantity (quantity can also be negative)
* get_approximate_max() 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?
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.