数论:高精
数论:高精
LSD20164388
如果你过几天就忘了,那么你并没有真正的掌握。
展开
-
UVA - 10643 Facing Problem With Trees(卡特兰数变形+高精)
人生中第一道通过的java题。。。写个题解纪念一下答案就是卡特兰数的变种,可以自己推一下卡特兰数原理如下:令h(0)=1,h(1)=1,catalan数满足递推式:h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)*h(0) (n>=2)例如:h(2)=h(0)*h(1)+h(1)*h(0)=1*1+1*1=2h(3)=h(0)*h(2)+h(1)*h(...原创 2018-05-19 10:20:54 · 335 阅读 · 0 评论 -
HDU 4099 Revenge of Fibonacci(字典树+大数加法)
题意:给你一串数,判断它是否是斐波那契数列前100000(不包括第100000项,WA了一次)项某一项的前缀。给你的数最多不超过40位。 思路:直接构造前100000项斐波那契数列的字典树是肯定超时的,并且我们只需要前40位。然而由于考虑到进位的问题,我们保存它的前60位,也就是说60位以后的进位我们就可以忽略不计了,但是只保存45位就会WA。 #include #inclu原创 2018-06-05 08:37:14 · 225 阅读 · 2 评论 -
2016年ACM/ICPC大连赛区 C题(JAVA高精度求sqrt(5)+威佐夫博弈)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5747 题意:除了数据范围为10^100次方以外就是威佐夫博弈。 关键还是sqrt(5)的精度。网上看到一种二分的求法。顺便整理个板子。 代码: ...原创 2018-10-03 19:06:20 · 249 阅读 · 0 评论 -
ZOJ 3987 Numbers (贪心+JAVA大数)
Numbers Time Limit: 2 Seconds Memory Limit: 65536 KB DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimizes their bitwise or (i.e. and should...原创 2018-10-25 10:11:52 · 293 阅读 · 0 评论 -
LightOJ - 1024 - Eid(唯一分解定理+手写大数乘法)
1024 - Eid PDF (English) Statistics Forum Time Limit:2 second(s) Memory Limit:32 MB In a strange planet there arenraces. They are completely different as well as their food ha...原创 2019-04-07 17:15:40 · 375 阅读 · 0 评论