← 返回 citadel 的题目列表Expected Position of Element in Probabilistic LRU Cache Access
类型:online_judge
citadel
In an LRU Cache where each accessed element is moved to the front, assume there are n elements, each with a probability Pi of being accessed. Calculate the expected position of an element upon access.
Example
Input
3
0.2 0.5 0.3