之前写过用vector.string实现大数加法,现在用java的BigDecimal类,代码简单很多.但是在online-judge上,java的代码运行时间和内存大得多. java大数加法:求a+b import java.util.*; import java.io.*; import java.lang.String; import java.math.BigDecimal; public class p1036 { public static void main(String[] ar
Train Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10372 Accepted Submission(s): 5543 Problem Description As we all know the Train Problem I, the boss of the Ignatius Train Sta
Product Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Description The problem is to multiply two integers X, Y. (0<=X,Y<10250) Input The input will consist of a set of pairs of lines. Each line in pair cont
题目链接: Segment Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description Silen August does not like to talk with others.She like to find some interesting problems. Today she finds an interesting pro
题目链接:51nod 1027大数乘法 直接模板了. #include<cstdio> #include<cstring> using namespace std; ; ; ; int alen, blen; int ans_len; char a1[N], b1[N]; ], b[]; ]; ], int &len){ memset(c, , sizeof(c)); int L = strlen(s); len = L / DLEN; if(L%DLEN) len++;
一. 题目 Exponentiation Time Limit: 500MS Memory Limit: 10000K Total Submissions: 156373 Accepted: 38086 Description Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of
1023 Have Fun with Numbers (20)(20 分) Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number consisting exac