• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            我叫張小黑
            張小黑的掙扎生活
            posts - 66,  comments - 109,  trackbacks - 0

             

             1#include<iostream>
             2using namespace std;
             3#define Max_N 100
             4#define Max 60
             5typedef struct bigint{
             6    int data[Max];
             7    int len;
             8    friend bigint operator+(bigint,bigint);
             9    friend bigint operator*(bigint,bigint);
            10    void operator=(const bigint&y){
            11        this->len=y.len;
            12        for(int i=0;i<y.len;i++)
            13            this->data[i]=y.data[i];
            14    }
            15}BIGINT;
            16BIGINT Trees[Max_N+1];
            17BIGINT operator+(BIGINT x,BIGINT y)
            18{
            19    BIGINT r;
            20    int rlen=x.len>y.len?x.len:y.len;
            21    int tmp,i,jinwei=0;
            22    for(i=0;i<rlen;i++){
            23        tmp=x.data[i]+y.data[i]+jinwei;
            24        r.data[i]=tmp%10;
            25        jinwei=tmp/10;}
            26    if(jinwei)r.data[rlen++]=jinwei;
            27    r.len=rlen;
            28    return r;
            29}
            30void print(BIGINT x)
            31{
            32    for(int i=x.len-1;i>=0;i--)
            33        printf("%d",x.data[i]);
            34    printf("\n");
            35}
            36BIGINT operator*(BIGINT x,BIGINT y)
            37{
            38    BIGINT r;
            39    int i,j;
            40    memset(r.data,0,sizeof(r.data));
            41    r.len=x.len+y.len;
            42    for(i=0;i<x.len;i++)
            43        for(j=0;j<y.len;j++)
            44            r.data[i+j]+=x.data[i]*y.data[j];
            45    for(i=0;i<r.len;i++){
            46        r.data[i+1]+=r.data[i]/10;
            47        r.data[i]%=10;}
            48    while(r.data[i]){
            49        r.data[i+1]+=r.data[i];
            50        r.data[i]%=10;
            51        i++;}
            52    while(i>=0&&!r.data[i])i--;
            53    r.len=i+1;
            54    return r;
            55}
            56void init()
            57{
            58    int i,j;
            59    memset(Trees,0,sizeof(Trees));
            60    Trees[0].data[0]=1;
            61    Trees[0].len=1;
            62    for(i=1;i<=Max_N;i++)
            63        for(j=0;j<i;j++)
            64            Trees[i]=Trees[i]+Trees[j]*Trees[i-j-1];
            65}
            66int main()
            67{
            68    int n;
            69    init();
            70    while(scanf("%d",&n)!=EOF)
            71        print(Trees[n]);
            72    return 0;
            73}
            posted on 2008-03-02 17:10 zoyi 閱讀(217) 評(píng)論(2)  編輯 收藏 引用 所屬分類: acm

            FeedBack:
            # re: ecnu 1850 高精度~~
            2008-03-05 19:06 | 張棚
            好模板...
            頂..
            借用了,呵呵。  回復(fù)  更多評(píng)論
              
            # re: ecnu 1850 高精度~~
            2008-03-06 21:36 | zoyi
            厄~~就是小強(qiáng)的摸版阿,我就是重載了運(yùn)算符  回復(fù)  更多評(píng)論
              
            歡迎光臨 我的白菜菜園

            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            常用鏈接

            留言簿(8)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊(cè)

            acmer

            online judge

            隊(duì)友

            技術(shù)

            朋友

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            无码任你躁久久久久久老妇App| 91精品免费久久久久久久久| 香蕉久久夜色精品国产小说| 国产精品久久自在自线观看| 成人a毛片久久免费播放| 国产精品激情综合久久| 精品久久久久久综合日本| 精品久久久久中文字幕一区| 老男人久久青草av高清| 国产91久久精品一区二区| 99久久无码一区人妻| 久久婷婷国产剧情内射白浆| 91久久婷婷国产综合精品青草 | 久久久久国产一级毛片高清板 | 久久精品九九亚洲精品| 久久99精品久久久久久齐齐| 久久99久国产麻精品66| 一本伊大人香蕉久久网手机| 国内精品久久久久影院薰衣草 | 国产精品综合久久第一页| 囯产精品久久久久久久久蜜桃 | 欧洲精品久久久av无码电影| 久久成人国产精品一区二区| 久久综合狠狠综合久久| 欧美亚洲另类久久综合婷婷 | 亚洲AV成人无码久久精品老人| 久久精品无码一区二区app| 久久久久女人精品毛片| 亚洲国产成人精品无码久久久久久综合 | 国产成人精品免费久久久久| 亚洲国产成人久久精品影视| 区久久AAA片69亚洲| 99久久99久久精品国产片果冻| 日本高清无卡码一区二区久久| 久久精品人人槡人妻人人玩AV| 久久精品国产99久久久香蕉| 久久99精品久久久久久久久久| 亚洲另类欧美综合久久图片区| 亚洲中文字幕无码久久2020| 久久人人爽人爽人人爽av| 91久久香蕉国产熟女线看|