• <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 閱讀(211) 評論(2)  編輯 收藏 引用 所屬分類: acm

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

            <2008年3月>
            2425262728291
            2345678
            9101112131415
            16171819202122
            23242526272829
            303112345

            常用鏈接

            留言簿(8)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊

            acmer

            online judge

            隊友

            技術

            朋友

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久亚洲AV成人无码| 久久99精品久久久久久久久久| 国产精品99久久免费观看| 久久成人国产精品| 久久精品视频91| 亚洲综合精品香蕉久久网| 久久国产精品久久精品国产| 久久最新免费视频| 婷婷伊人久久大香线蕉AV| 久久国产热这里只有精品| 2021国产精品午夜久久| 久久精品国产亚洲沈樵| 国内精品久久久久影院薰衣草| 99久久国产综合精品麻豆| 免费一级欧美大片久久网| 久久噜噜电影你懂的| A级毛片无码久久精品免费| 91超碰碰碰碰久久久久久综合| 国产香蕉久久精品综合网| 国产综合精品久久亚洲| 99国产精品久久| 久久久亚洲欧洲日产国码aⅴ| 亚洲国产小视频精品久久久三级 | 久久久久国产一区二区三区| 久久九九精品99国产精品| 亚洲国产精品狼友中文久久久| 国产精品久久毛片完整版| 99蜜桃臀久久久欧美精品网站| 久久久WWW成人| 91久久精品无码一区二区毛片| 无码国产69精品久久久久网站| 国产精品一区二区久久精品涩爱 | 国内精品伊人久久久久影院对白 | 伊人久久精品无码二区麻豆| 久久久91人妻无码精品蜜桃HD | 久久国内免费视频| 一极黄色视频久久网站| 午夜精品久久影院蜜桃| 无码国内精品久久人妻麻豆按摩| 久久久久国色AV免费观看| 中文国产成人精品久久亚洲精品AⅤ无码精品 |