Menu Sidebar
Menu

July 2020

Max Dot Product of Two Subsequences

给两个数组, 求两个数组中的同长度的子序列(不是子数组)中最大的dot product. 首先确定dot product是: 通过观察可以看到axbx和ayby是对应的, 并且这题求最值, 所以用dp. let dp[i][j] = the largest dot product of two arrays start with i and j respectively dp[0][0] = the largest dot product of two arrays start with 0 and 0, which is the product of first numbers of two arrays. dp[i][0] (dp[0][j]) is the largest dot product […]

Newer Posts

书脊

这青苔碧瓦堆, 俺曾睡风流觉, 将五十年兴亡看饱.

July 2020
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031