高精度
synapse7
这个作者很懒,什么都没留下…
展开
-
UVa 623 500! (高精度阶乘)
623 - 500!Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=564In these days you can more and more often hap原创 2013-09-21 07:06:14 · 1141 阅读 · 0 评论 -
UVa 424 Integer Inquiry (高精度)
424 - Integer InquiryTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=97&page=show_problem&problem=365One of the first users of BIT's ne原创 2013-10-20 19:32:51 · 951 阅读 · 0 评论 -
UVa 10106 Product (高精度)
10106 - ProductTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=97&page=show_problem&problem=1047The ProblemThe problem is to multip原创 2013-10-20 19:45:09 · 808 阅读 · 0 评论 -
UVa 10494 If We Were a Child Again (高精度)
10494 - If We Were a Child AgainTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=97&page=show_problem&problem=1435“Ooooooooooooo原创 2013-10-21 08:03:00 · 908 阅读 · 0 评论 -
UVa 10519 !! Really Strange !! (递推)
10519 - !! Really Strange !!Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1460思路:注意到题目所说“Every two are原创 2013-11-16 16:25:43 · 1066 阅读 · 0 评论 -
UVa 10220 I Love Big Numbers ! (简单高精度)
10220 - I Love Big Numbers !Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1161The ProblemA Japa原创 2013-11-21 20:38:45 · 1744 阅读 · 0 评论 -
UVa 10013 Super long sums (简单高精度)
10013 - Super long sumsTime limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=954The ProblemThe creators of原创 2013-11-21 20:27:54 · 1614 阅读 · 0 评论 -
UVa 324 Factorial Frequencies (高精度)
324 - Factorial FrequenciesTime limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=260In an attempt to bolster he原创 2013-11-08 19:04:32 · 1478 阅读 · 0 评论 -
高精度运算类bign(支持前导零输入)
#include#include#includeusing namespace std;const int maxn = 200;struct bign{ int len, s[maxn]; bign() { memset(s, 0, sizeof(s)); len = 1; } bign(int num) { *this = num; } bign原创 2013-09-27 20:12:56 · 1171 阅读 · 0 评论 -
UVa 10254 The Priest Mathematician (组合数学&规律发现&高精度)
思路:由题目给出的策略得:f(1)=1, f(n)=min{2*f(k)+2^(n-k)-1} (1<=k<=n-1)打印前面几项:1,3,5,9,13,17,25,33,41,49,65,...计算其一阶差分序列Δf(n):2,2,4,4,4,8,8,8,8,16,...发现2^m出现了(m+1)次,m>=0以此为依据预处理所有解。更多的讨论:《具体数学》P16第17题、第25题原创 2013-10-20 12:22:14 · 1676 阅读 · 0 评论 -
UVa 10198 Counting (组合数学&高精度)
思路:用f[i]表示n=i时的答案,则考虑末位数字,如果选择1的话,那么一共有f[i-1]个数,如果是2的话,一共有f[i-2]个数,3有f[i-3]个数,4有f[i-1]个数。所以:f[i]=2*f[i-1]+f[i-2]+f[i-3] (f[1]=2,f[2]=5,f[3]=13)完整代码:原创 2013-10-17 21:04:03 · 1114 阅读 · 0 评论 -
UVa 10247 Complete Tree Labeling (组合数学&高精度)
思路:用ans[i][j]表示深度为j的满i叉树的标号方案数,用node[i][j]表示深度为j的满i叉树的结点数。首先根结点必定是标最小的号码,然后还剩下node[i][j]-1个号码可用,我们要将他们分配给i棵子树,每棵子树得到m=node[i][j-1]个号码。用c[n][k]表示组合数,所以共有c[n[i][j]-1][m]*c[n[i][j]-1-m][m]*c[n[i][j]-1-2*m][m]*…*c[m][m]种分配方案。继续对子树标号,共有ans[i][j-1]^i种情况。故得到递归式:原创 2013-10-19 11:59:45 · 1720 阅读 · 0 评论 -
UVa 10303 How Many Trees? (卡特兰数&高精度)
10303 - How Many Trees?Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1244A binary search tree is a bina原创 2013-10-02 10:38:52 · 1208 阅读 · 0 评论 -
UVa 10023 Square root (高精度&开平方公式)
10023 - Square rootTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=964The ProblemYou are to determinate X by given原创 2013-09-28 11:54:54 · 2165 阅读 · 0 评论 -
在ACM中使用Java的若干方便之处
一、 输入格式标准格式为:Scanner cin = new Scanner (new BufferedInputStream(System.in));较Scanner cin = new Scanner (System.in);更快。import java.io.*;import java.math.*;import java.util.*;import java.转载 2013-10-02 11:10:08 · 1143 阅读 · 0 评论 -
UVa 11375 Matches (DP&高精度)
11375 - MatchesTime limit: 2.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2370We can make digits with matches as shown below:Given N match原创 2013-10-13 11:05:15 · 1376 阅读 · 0 评论 -
UVa 10334 Ray Through Glasses (斐波那契&高精度)
10334 - Ray Through GlassesTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1275Suppose we put two panes of glass back-to-back. How原创 2013-09-26 17:03:13 · 1027 阅读 · 0 评论 -
UVa 10183 How Many Fibs? (统计斐波那契数个数&高精度)
10183 - How Many Fibs?Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=115&page=show_problem&problem=1124Recall the definition of the Fi原创 2013-10-02 14:50:22 · 968 阅读 · 0 评论 -
UVa 10213 How Many Pieces of Land ? (数学&欧拉公式&高精度)
10213 - How Many Pieces of Land ?Time limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1154You are given an elliptical shape原创 2013-09-28 10:51:24 · 1399 阅读 · 0 评论 -
UVa 10157 Expressions (组合数学&高精度)
10157 - ExpressionsTime limit: 10.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=34&page=show_problem&problem=1098Let X be the set of correctly buil原创 2013-10-18 12:35:37 · 1692 阅读 · 0 评论 -
UVa 748 / POJ 1001 Exponentiation (浮点高精度求幂&正则表达式的应用)
str = str.replaceFirst("^0*", "");原创 2013-10-20 23:07:21 · 1461 阅读 · 0 评论