这个题思路没有任何问题,但还是做了近三个小时,其中2个多小时调试 得到的经验有以下几点: 像这道题主要坑在了第三点上,以后要注意避免 以下是AC代码 ...
分类:
其他好文 时间:
2016-08-07 10:53:40
阅读次数:
179
题目链接:http://poj.org/problem?id=1651 思路:除了头尾两个数不能取之外,要求把所有的数取完,每取一个数都要花费这个数与相邻两个数乘积的代价,需要这个代价是最小的 用dp[i][j]表示区间[i,j]的最小代价,那么就有dp[i][j]=min(dp[i][k]+dp[ ...
分类:
其他好文 时间:
2016-08-03 10:08:11
阅读次数:
118
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg ...
分类:
其他好文 时间:
2016-08-02 06:33:34
阅读次数:
129
这是一个相对简单的模拟,因为运算规则已经告诉了我们,并且比较简单,不要被吓到…… 思路:多项式除以另外一个多项式,如果能除,那么他的最高次一定被降低了,如果最高次不能被降低,那说明已经无法被除,就是题目要求输出的膜了,降低最高次的方法很简单,只要被除式的最高次 >= 除式的最高次,就将除式的最高次升 ...
分类:
其他好文 时间:
2016-07-31 17:34:32
阅读次数:
91
Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Divide two integers without using mu ...
分类:
其他好文 时间:
2016-07-14 02:48:06
阅读次数:
285
题目 Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT 链接 https://leetcode.com/problems/div ...
分类:
其他好文 时间:
2016-07-09 14:59:02
阅读次数:
169
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg ...
分类:
编程语言 时间:
2016-06-28 18:14:42
阅读次数:
169
1. 问题描述 Given two numbers represented as strings, return multiplication of the numbers as a string.Note:The numbers can be arbitrarily large and are n ...
分类:
其他好文 时间:
2016-06-16 23:22:59
阅读次数:
332