• <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 閱讀(120) 評論(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 }
            人人狠狠综合久久亚洲88| 18禁黄久久久AAA片| 国产成人久久久精品二区三区| 女人香蕉久久**毛片精品| 久久综合九色综合欧美狠狠| 久久久久亚洲av成人无码电影| 久久91精品国产91| 久久久久四虎国产精品| 香蕉aa三级久久毛片| 看久久久久久a级毛片| 91精品日韩人妻无码久久不卡| 亚洲欧洲精品成人久久曰影片 | 一本久道久久综合狠狠躁AV| 久久久国产乱子伦精品作者| 色综合合久久天天给综看| 久久电影网2021| 亚洲午夜久久久久久噜噜噜| 久久久久香蕉视频| 人人狠狠综合久久88成人| 精品人妻伦一二三区久久| 久久人人爽人人爽人人片av麻烦| 99久久国产综合精品网成人影院| 久久亚洲精品成人AV| 亚洲性久久久影院| 久久久久女教师免费一区| 国产精品9999久久久久| 国产偷久久久精品专区| 亚洲国产精品综合久久网络| 国内精品久久久久久不卡影院 | 亚洲精品tv久久久久久久久 | 久久无码AV一区二区三区| 青青青青久久精品国产 | 欧美黑人激情性久久| 久久久久亚洲AV无码专区网站 | 久久精品九九亚洲精品天堂| 日韩精品无码久久久久久| 欧美性大战久久久久久| 国产精品日韩欧美久久综合| 久久99久久无码毛片一区二区 | 国产成人精品久久亚洲| 日本道色综合久久影院|