Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:
其他好文 时间:
2016-01-11 22:07:22
阅读次数:
104
Quesiton from:https://leetcode.com/problems/divide-two-integers/题目:Divide two integers without using multiplication, division and mod operator.If it i...
分类:
其他好文 时间:
2016-01-04 06:36:50
阅读次数:
129
题目链接题意:n*m的一个乘法表,从小到大排序后,输出第k个数(1?≤?n,?m?≤?5·105;1?≤?k?≤?n·m)分析:对于k之前的数,排名小于k;k之后的数大于,那么就能够採用二分。LL n, m, k;LL fun(LL goal){ LL t = 0, ret = 0; w...
分类:
其他好文 时间:
2015-12-28 20:28:17
阅读次数:
181
Matrix Chain MultiplicationSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is ...
分类:
其他好文 时间:
2015-12-28 15:46:51
阅读次数:
191
题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-n...
分类:
其他好文 时间:
2015-12-25 13:38:22
阅读次数:
216
题目链接给一串数, 拿出一个数i的代价是a[i-1]*a[i]*a[i+1], 第一个数和最后一个数不能拿, 求拿走剩下的数的代价的最小值。#include #include #include #include #include #include #include #include #include...
分类:
其他好文 时间:
2015-12-24 10:41:05
阅读次数:
110
题目:Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.看讨论区大神的思路:In this ...
分类:
其他好文 时间:
2015-12-22 01:11:18
阅读次数:
231
题意:给一个序列,每次选一个数(记为b),计算左边离他最近的数(记为a),右边离他最近的数(记为c),计算a*b*c,sum+=a*b*c 重复操作直到剩下开头结尾两个数不同的方案对应不同的sum 计算最小的sum值分析:典型的区间dp,dp[i][j]表示把从i到j所有的数都选走得到的最小值dp[...
分类:
其他好文 时间:
2015-12-21 23:40:10
阅读次数:
162
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.这个题分了两种解法,本质都是一样的:方法一:都是每次减去divisor的2^i ...
分类:
其他好文 时间:
2015-12-21 20:20:59
阅读次数:
174
题目描述:(链接)Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are...
分类:
其他好文 时间:
2015-12-21 12:06:31
阅读次数:
135