这个我会 minimum tree, 1) insert A[0] B[0] 2) pop up the smallest, insert A[1]B[0],A[0]B[1] 3) pop up the smallestA[i]B[j] , insert A[i+1]B[j],A[i]B[j+1]... until u get m a tricky point is create an array C[m]=n mean for A[m], you already used A[m]B[n] you can use this to avoid dup
【在 l*****a 的大作中提到】 : 这个我会 : minimum tree, : 1) insert A[0] B[0] : 2) pop up the smallest, insert A[1]B[0],A[0]B[1] : 3) pop up the smallestA[i]B[j] , insert A[i+1]B[j],A[i]B[j+1]... : until u get m : a tricky point is create an array C[m]=n : mean for A[m], you already used A[m]B[n] : you can use this to avoid dup
【在 l*****a 的大作中提到】 : 这个我会 : minimum tree, : 1) insert A[0] B[0] : 2) pop up the smallest, insert A[1]B[0],A[0]B[1] : 3) pop up the smallestA[i]B[j] , insert A[i+1]B[j],A[i]B[j+1]... : until u get m : a tricky point is create an array C[m]=n : mean for A[m], you already used A[m]B[n] : you can use this to avoid dup
l*a
19 楼
1) insert A[0] B[0] 2) pop up the smallest, insert A[1]B[0],A[0]B[1]
【在 f*********d 的大作中提到】 : 1 3 弹出来了 怎么得到 1, 5 呢?
l*a
20 楼
每次不是找最小的吗?
【在 N*****Z 的大作中提到】 : max heap吧
f*d
21 楼
嗯 是的~ 学习了!
【在 l*****a 的大作中提到】 : 1) insert A[0] B[0] : 2) pop up the smallest, insert A[1]B[0],A[0]B[1]