• <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 - 263, comments - 31, trackbacks - 0, articles - 3
               :: 首頁 :: 新隨筆 ::  :: 聚合  :: 管理

            URAL_1206

            Posted on 2008-12-10 23:06 Hero 閱讀(118) 評論(0)  編輯 收藏 引用 所屬分類: 代碼如詩--ACM
              1 // 1206 C++ Accepted 0.031 209 KB 
              2 
              3 //其實只要兩個數加起來不能有進位就行了
              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 }
            久久66热人妻偷产精品9| 久久伊人色| 久久九九青青国产精品| 成人午夜精品久久久久久久小说| 国产99久久久国产精免费| 久久精品无码av| 97久久国产综合精品女不卡| 无遮挡粉嫩小泬久久久久久久| 久久精品国产第一区二区| 久久人妻少妇嫩草AV蜜桃| 91精品国产综合久久久久久| 久久久久久av无码免费看大片| 奇米综合四色77777久久| 香蕉久久夜色精品国产小说| 精品久久8x国产免费观看| 久久人人爽人人爽人人片AV东京热| 久久人与动人物a级毛片| 伊人热人久久中文字幕| 久久精品国产久精国产一老狼| 久久国产精品99精品国产987| 激情综合色综合久久综合| 亚洲av伊人久久综合密臀性色| 国产精品免费久久久久久久久 | 欧美亚洲国产精品久久| 国产精品久久国产精品99盘| 狠狠色丁香久久婷婷综合_中| 99精品久久久久久久婷婷| 亚洲AV无码久久精品蜜桃| 天堂无码久久综合东京热| 久久精品国产秦先生| 久久精品无码午夜福利理论片| 亚洲国产一成久久精品国产成人综合 | 99久久婷婷国产一区二区| 久久久久无码精品国产| 波多野结衣久久精品| 中文成人久久久久影院免费观看| 中文字幕亚洲综合久久| 久久亚洲国产精品一区二区| 欧美777精品久久久久网| 99久久精品这里只有精品| 99久久国产综合精品五月天喷水|