题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3074 Minimum Inversion NumberDescriptionTired of playing computer games, alpc23 is planning to play...
                            
                            
                                分类:
其他好文   时间:
2015-05-29 19:46:09   
                                阅读次数:
150
                             
                    
                        
                            
                            
                                这篇文章主要将要介绍JUnit测试工具的使用。本文中待测试的对象为一个简单的Calculate类,包括加(add),减(substract),乘(multiply),除(divide)四个简单的方法。 1 public class Calculate { 2 3 public st...
                            
                            
                                分类:
其他好文   时间:
2015-05-25 21:50:13   
                                阅读次数:
165
                             
                    
                        
                            
                            
                                BigDecimal类型数字可用来做超大的浮点数的运算该类对象的add()方法做加法运算;multiply()方法做乘法运算calculate 1+1/2!+1/3!+...+1/10!import java.math.BigDecimal;import java.util.Scanner;publ...
                            
                            
                                分类:
编程语言   时间:
2015-05-18 22:33:32   
                                阅读次数:
133
                             
                    
                        
                            
                            
                                1 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-05-17 16:50:18   
                                阅读次数:
159
                             
                    
                        
                            
                            
                                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-05-14 21:59:58   
                                阅读次数:
104
                             
                    
                        
                            
                            
                                题目传送:Multiply game
思路:简单线段树,单点更新,区间求积,这是上次选拔赛选的题,一看题就是线段树,不过当时线段树不太熟,没敢敲,现在看来居然如此轻松,不过注意这里有大量输出,用printf,居然在这里TLE了一次。。。
AC代码:
#include 
#include 
#include 
#include 
#include 
#include 
#inc...
                            
                            
                                分类:
其他好文   时间:
2015-05-14 08:44:50   
                                阅读次数:
135
                             
                    
                        
                            
                            
                                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-05-12 01:35:56   
                                阅读次数:
150
                             
                    
                        
                            
                            
                                阶乘很好求,递归就行了,但对于较大的数,阶乘的结果非常非常大,木有办法,只能用string来处理。
我们用string的乘法来做。经测试,这个程序能运行的最大n值差不多能到3000,和windows上自带的科学计算器差不多:)
string multiply(string num1, string num2) {
        int len1 = num1.size(), len2 = n...
                            
                            
                                分类:
编程语言   时间:
2015-05-10 09:55:30   
                                阅读次数:
132
                             
                    
                        
                            
                            
                                题目链接:点击打开链接
题意:
给定n个点的树
问:
对于以i为根时,把树边黑白染色,使得任意点走到根的路径上不超过一条黑边,输出染色的方案数(mod 1e9+7)
思路:
显然i点的方案数 = i为根的子树的方案数 * 不包括i为根的子树的部分的方案数
首先以i为根的子树求一个方案数down[i]:for all son vj  of i, down[i] = multiply d...
                            
                            
                                分类:
其他好文   时间:
2015-05-09 22:08:20   
                                阅读次数:
156
                             
                    
                        
                            
                            
                                https://leetcode.com/problems/multiply-strings/Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The nu...
                            
                            
                                分类:
其他好文   时间:
2015-05-09 20:18:04   
                                阅读次数:
129