1 #define ADDITION '+' 2 #define SUBSTRACTION '-' 3 #define MULTIPLICATION '*' 4 #define DIVISION '/' 5 6 7 class Solution { 8 public: 9 se...
分类:
其他好文 时间:
2015-02-18 14:03:44
阅读次数:
149
The problem:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.My analysis:The idea behind ...
分类:
其他好文 时间:
2015-02-13 06:58:04
阅读次数:
188
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...
分类:
其他好文 时间:
2015-02-11 18:24:46
阅读次数:
144
标题:Multiply Strings通过率: 20.8%难度:中等Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be ...
分类:
其他好文 时间:
2015-02-11 16:00:30
阅读次数:
115
传送门:Katu Puzzl题意:n个点,点的取值可以是0或者1。m条边,有权值,有运算方式(并,或,异或),要求和这条边相连的两个点经过边上的运算后的结果是边的权值。问你有没有可能把每个点赋值满足所有边的要求。分析:每个点必须取一个值满足所有限制条件,明显的two-sat模型。AND 结果为1:建...
分类:
其他好文 时间:
2015-02-10 18:16:22
阅读次数:
150
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.class Solution {public: int divide(in...
分类:
其他好文 时间:
2015-02-10 14:46:30
阅读次数:
174
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...
分类:
其他好文 时间:
2015-02-10 14:38:57
阅读次数:
143
题目链接:Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
这道题的要求是计算大数乘法。其中大数...
分类:
其他好文 时间:
2015-02-10 09:16:09
阅读次数:
114
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.思路:用 divisor 右移,计算出最大的位数,然后不断比较 更新过的divi...
分类:
其他好文 时间:
2015-02-09 17:36:31
阅读次数:
218
主要注意分析几种特殊的输入:
1 不规则的输入,但是有效:"-3924x8fc","+432"
2 无效格式,"++c","++1"
3 数据溢出
其中数据溢出的判断:
To deal with overflow, inspect the current number before multiplication. If the current number is greater than...
分类:
其他好文 时间:
2015-02-08 16:57:54
阅读次数:
125