摘要:
D 重排列 思路: upper_bound(a+1,a+1+n,b[i])-a-1记录的是在a[i]中第一个大于b[i]的地址, lower_bound(a+1,a+1+n,b[i])-a-1记录的是在a[i]中第一个不小于b[i]的地址 内部的思想是二分 a 1 1 2 3 b 1 2 3 4 c 阅读全文
摘要:
思路: 先依次预处理每个数字是第几大,然后依次按大小插入到树状数组中,每插入一个数判断现在数组中比当前数小的有多少个, 逐层更新下去,更新到k层,把k层数值加起来即可 #include<iostream> #include<stdio.h> #include<algorithm> using nam 阅读全文
摘要:
A - Send Boxes to Alice (Easy Version) https://vjudge.net/contest/345984#problem/A This is the easier version of the problem. In this version,(1≤n≤105 阅读全文
摘要:
B - Everyone is a Winner! On the well-known testing system MathForces, a draw of n rating units is arranged. The rating will be distributed according 阅读全文