• <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 }
            久久午夜福利电影| 亚洲国产精品久久久天堂| 久久精品国产乱子伦| 久久久久久久综合综合狠狠| 久久精品一区二区| 国产精品久久久久天天影视| 久久久久人妻一区精品色| 久久国产精品一国产精品金尊| 精产国品久久一二三产区区别| 久久精品国产男包| 亚洲AV成人无码久久精品老人| 亚洲午夜无码久久久久| 亚洲精品乱码久久久久久中文字幕 | 亚洲欧美久久久久9999 | 久久人人爽人人精品视频| 久久毛片免费看一区二区三区| 老司机午夜网站国内精品久久久久久久久| 久久亚洲欧洲国产综合| 亚洲精品国产第一综合99久久| 欧美激情精品久久久久久久| 2021久久精品免费观看| 久久人人爽人人爽人人片AV不| 久久天天躁狠狠躁夜夜网站| 九九久久99综合一区二区| 国产精品99久久久久久宅男| 欧美久久久久久午夜精品| 久久久久久久综合狠狠综合| 亚洲中文字幕无码久久2020| 99久久99这里只有免费费精品| 99久久精品免费看国产一区二区三区| 国产精品gz久久久| 久久婷婷五月综合成人D啪| 久久精品夜夜夜夜夜久久| 91久久精品国产免费直播| 无码八A片人妻少妇久久| 青青青国产精品国产精品久久久久| 久久亚洲2019中文字幕| 2021少妇久久久久久久久久| 一97日本道伊人久久综合影院| www久久久天天com| 久久精品中文字幕大胸|