摘要: 以下是三种高精度算术的模版: 高精度加法: string s="0123456789",s1,s2; int ss1[1005],ss2[1005],len; void dashu(string s1,int ss1[]) { for(int i=s1.length()-1;i>=0;i--) { for(int j=0;jlen2) len=l... 阅读全文
posted @ 2016-02-28 16:32 &ATM 阅读(251) 评论(0) 推荐(0)
摘要: (~ ̄▽ ̄)~* 找规律 //初始化为B[i]=A[i] //然后由V=|A[1]-B[1]|+|A[2]-B[2|+|A[3]-B[3]| // +|B[1]-B[2]|+|B[2]-B[3]| //可以知道,如果要V尽可能小,那么对于B[2]的取值, //则要求B[2]到A[2] B[1] B[3]的距离尽可能小, //在数轴上可以看出,只要B[2]=中位数(A[2],B[1],... 阅读全文
posted @ 2016-02-28 16:17 &ATM 阅读(274) 评论(0) 推荐(0)
摘要: (~ ̄▽ ̄)~* 水 //水题;潜力^e为正数(e为2时都可以)的儿子都可以去上战场了, //英文要看懂,exponent指数,不超过3的正数 #include #include #include #include using namespace std; int main() { int n,e,son[105]; while(~scanf("%d",&n)) { ... 阅读全文
posted @ 2016-02-28 16:15 &ATM 阅读(141) 评论(0) 推荐(0)
摘要: (~ ̄▽ ̄)~* 这道题涉及高精度除法,模板如下: char s[1005]; char division[1005];//存储进行高精度除法的数据 bool bignum_div(int x) { int tot=0,num=0; for(int i=0;s[i];i++) { num=num*10+s[i]-'0'; division... 阅读全文
posted @ 2016-02-28 16:03 &ATM 阅读(247) 评论(0) 推荐(0)
……