题目链接~~>
解题思路:
我们可以看出,二个数组的和 min = a[ 0 ] + b [ 0 ] , max = a[ n - 1] + b [ m - 1] ,这样我们就可以二分枚举这个区间的所有数,枚举每个数的时候判断它是第几大,你可能会问:怎样判断第几大??? 假如你要查找 x 是第几大,那么可以对比 a 数组中的每个数,让其在 b 数组中查找不大于 x - a[ i ] (这里 x >= a[i ])的数,有几个就表示 a[ i ] 分别加b数组中的这几个数的和小于
x , 这样遍历 a 数组就可以找到 x 在所有的和中是第几大。
代码:
#include<ios......
阅读全文
I feel very happy at the end of my journey (So, unfortunate that
there are no emoticons in blogger ). I finally("finally", because I
have been planning to take this for a long time now) cleared my
Datastage Certification. There are a few things which give you the joy
comparable to getting your certification. I want to thank my friends
Ajay Prakash and SubhaKarthik for giving me the moral support for this
certification.
I had blogged (Road to Datastage Certification) about how all thi......
阅读全文