
高精度问题
文章平均质量分 75
nianiajr
http://www.liangjiarui.com/
展开
-
高精度运算类bign(非负整数)模板
#include#includeusing namespace std;const int maxn = 200;struct bign{ //定义类结构bign int len, s[maxn]; bign() { //bign()称为构造函数,目的在于对该储存大数的数组进行初始化 memset(s, 0, sizeof(s));原创 2013-02-21 23:41:22 · 1033 阅读 · 0 评论 -
hdu 4762
分蛋糕,求所有草莓落在一块蛋糕上的概率,假设其中一颗草莓在一块蛋糕上,剩下的n-1颗草莓与其落在同一区域的概率就是(1/m)^(n-1);最后再乘上草莓数即Cn即可出解,不过这里数据很大得用到高精度计算。#include#include #includeusing namespace std;struct bign{//高精度运算类 int len, s[30];原创 2013-10-02 18:54:22 · 857 阅读 · 0 评论