← 返回 citadel 的题目列表Weighted Insertion-Deletion with Random Sampling
类型:online_judge
Implement a data structure that supports weighted insertion and deletion, and allows for random sampling by weight.
Example
Input
"insert 5, insert 10, delete 5, sample"
Output
"10 or another weighted result"