关于楼教主的第一题,感觉最费时间的还是高精度的实现
。实现一万位以上整数基本运算的
万进制高精度
模版就写了快一天(题目里用到大概也有几百位吧)
,只能说太容易出错了,得不断地调试修改。
题目源地址是北大poj1737
题,
题目本身的组合数学的算法是参考某位大牛的文章,在此附上地址
http://hi.baidu.com/accplaystation/item/0b3b4e1654a07548e75e06f9
下面分别是49和50个点时的结果以及源代码,供参考:
49:
下面分别是49和50个点时的结果以及源代码,供参考:
49:
102630135157005507791162 897286704217768073558563 522534520353619073791086 31238572
445483139828762289949878
647004007598114562441288
897543063864595578874322
98148719
591734971030611474690885
904247396313959818854940
592795291449937598794070
51757016
755160795097926623799779
728356364524210524473752
088137141096006790217662
98295142
562256412381640145736443
33472284672
50:
577756298062641319815321
284633539861082132919998
722885657507672188606317
69630192
413406823351870787784176
925235627483488367832092
229178528895225932496008
59338855
724814764410440416662456
329476306676699006233890
696555233449522221141796
60086674
251300523449279256078271
770682664276058349275922
600493471476178420154378
01204857
133343656736539713615246
916548098015836904200601
6
#include "iostream"
#include "string"
#include "cstring"
#include "stdio.h"
using namespace std;
bool remember[55];
struct bigNumber
{
};
bigNumber number[55];
bigNumber bigNumber1,bigNumber2,bigNumber3;
ostream& operator << (ostream& os, constbigNumber& big)//输出高精度数运算符重载
{
}
istream& operator>>(istream& is, bigNumber &big)//输入高精度运算符的重载
{
}
bigNumber operator*(bigNumber big1,bigNumberbig2)//两个高精度数相乘
{
}
bigNumber operator*(bigNumber big,intk)//高精度乘以普通常数(注意常数的大小范围不可太大)
{
}
bigNumber operator+(bigNumber big1,bigNumberbig2)//两个高精度数相加,将和赋在第一个数上
{
}
bigNumber operator/(bigNumber &big1,int k)
{
}
bigNumber function0(int n)
{
}
int main()
{
}