• <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>

            我希望你是我獨家記憶

            一段永遠封存的記憶,隨風(fēng)而去
            posts - 263, comments - 31, trackbacks - 0, articles - 3
               :: 首頁 :: 新隨筆 ::  :: 聚合  :: 管理

            URAL_1206

            Posted on 2008-12-10 23:06 Hero 閱讀(119) 評論(0)  編輯 收藏 引用 所屬分類: 代碼如詩--ACM
              1 // 1206 C++ Accepted 0.031 209 KB 
              2 
              3 //其實只要兩個數(shù)加起來不能有進位就行了
              4 
              5 //按位考慮排列組合--只有最左邊那一位有36種可能--其他有55中可能
              6 
              7 #include <iostream>
              8 using namespace std;
              9 
             10 const int Base=1000000000;
             11 const int Capacity=1000;
             12 typedef long long llong;
             13 struct BigInt{
             14     int Len;
             15     int Data[Capacity];
             16     BigInt():Len(0){}
             17     BigInt(const BigInt &V):Len(V.Len){memcpy(Data,V.Data,Len*sizeof*Data);}
             18     BigInt(int V):Len(0){for(;V>0;V/=Base) Data[Len++]=V%Base;}
             19     BigInt &operator=(const BigInt &V){Len=V.Len;memcpy(Data,V.Data,Len*sizeof*Data);return *this;}
             20     int &operator[](int Index){return Data[Index];}
             21     int operator[](int Index)const{return Data[Index];}
             22 };
             23 int compare(const BigInt &A,const BigInt &B){
             24     if(A.Len!=B.Len) return A.Len>B.Len ? 1:-1;
             25     int i;
             26     for(i=A.Len-1;i>=0 && A[i]==B[i];i--);
             27     if(i<0)return 0;
             28     return A[i]>B[i] ? 1:-1;
             29 }
             30 BigInt operator+(const BigInt &A,const BigInt &B){
             31     int i,Carry(0);
             32     BigInt R;
             33     for(i=0;i<A.Len||i<B.Len||Carry>0;i++){
             34         if(i<A.Len) Carry+=A[i];
             35         if(i<B.Len) Carry+=B[i];;
             36         R[i]=Carry%Base;
             37         Carry/=Base;
             38     }
             39     R.Len=i;
             40     return R;
             41 }
             42 BigInt operator-(const BigInt &A,const BigInt &B){
             43     int i,Carry(0);
             44     BigInt R;
             45     R.Len=A.Len;
             46     for(i=0;i<R.Len;i++){
             47         R[i]=A[i]-Carry;
             48         if(i<B.Len) R[i]-=B[i];
             49         if(R[i]<0) Carry=1,R[i]+=Base;
             50         else Carry=0;
             51     }
             52     while(R.Len>0&&R[R.Len-1]==0) R.Len--;
             53     return R;
             54 }
             55 BigInt operator*(const BigInt &A,const int &B){
             56     int i;
             57     llong Carry(0);
             58     BigInt R;
             59     for(i=0;i<A.Len||Carry>0;i++){
             60         if(i<A.Len) Carry+=llong(A[i])*B;
             61         R[i]=Carry%Base;
             62         Carry/=Base;
             63     }
             64     R.Len=i;
             65     return R;
             66 }
             67 istream &operator>>(istream &In,BigInt &V){
             68     char Ch;
             69     for(V=0;In>>Ch;){
             70         V=V*10+(Ch-'0');
             71         if(In.peek()<=' 'break;
             72     }
             73     return In;
             74 }
             75 ostream &operator<<(ostream &Out,const BigInt &V){
             76     int i;
             77     Out<<(V.Len==0 ? 0:V[V.Len-1]);
             78     for(i=V.Len-2;i>=0;i--for(int j=Base/10;j>0;j/=10) Out<<V[i]/j%10;
             79     return Out;
             80 }
             81 BigInt Bint0(0) ;
             82 BigInt Bint1(1) ;
             83 
             84 int inn ;
             85 
             86 int main()
             87 {
             88     while( scanf( "%d"&inn ) != EOF )
             89     {
             90         BigInt out = Bint1 ;
             91 
             92         out = out * ( (1+8)*8/2 ) ;
             93         int temp = 55 ;
             94 
             95         forint i=2; i<=inn; i++ ) out = out * temp ;
             96 
             97         cout << out << endl ;
             98     }
             99 
            100     return 0 ;
            101 }
            中文国产成人精品久久亚洲精品AⅤ无码精品| 久久综合狠狠综合久久| 久久噜噜电影你懂的| 97超级碰碰碰碰久久久久| 久久精品一区二区三区中文字幕| 欧美激情精品久久久久久| 色88久久久久高潮综合影院| 草草久久久无码国产专区| 亚洲精品国产综合久久一线| 人妻精品久久无码区| 久久影院午夜理论片无码 | 久久精品人人做人人爽电影| 久久九九免费高清视频| 亚洲国产精品无码久久久蜜芽| 精品一区二区久久久久久久网站| 国产精品亚洲综合久久| 国产成人99久久亚洲综合精品| 久久久久亚洲AV无码观看| 精品久久久久久无码免费| 久久精品国产亚洲av麻豆蜜芽| 99久久成人18免费网站| 久久久久人妻一区二区三区vr| 婷婷久久综合九色综合绿巨人| 色噜噜狠狠先锋影音久久| 亚洲国产精品无码久久久秋霞2| 伊色综合久久之综合久久| 思思久久99热免费精品6| 精品水蜜桃久久久久久久| 久久精品人人槡人妻人人玩AV| 久久精品视频一| 亚洲国产视频久久| 伊人色综合久久天天人守人婷| 久久国产精品偷99| 99久久亚洲综合精品成人| 久久久久久久99精品免费观看| 成人综合伊人五月婷久久| 香蕉久久av一区二区三区| 久久香综合精品久久伊人| 久久综合噜噜激激的五月天| 久久亚洲精品无码AV红樱桃| 国产午夜精品久久久久免费视 |