摘要:
您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作: 插入 x 数 删除 x 数(若有多个相同的数,因只删除一个) 查询 x 数的排名(排名定义为比当前数小的数的个数 +1 ) 查询排名为 x 的数 求 x 的前驱(前驱定义为小于 x,且最大的数) 求 x 的后继(后继定义为 阅读全文
摘要:
long long C(int n, int m) { int i; long long sum = 1; for (i = 1; i <= m; i++) { sum *= (n - m + i); } for (i = 1; i <= m; i++) { sum = sum / i; } ret 阅读全文
摘要:
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided t 阅读全文