青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 100,  comments - 15,  trackbacks - 0
  2010年10月5日
/*
 * poj1423.cpp
 *  
 *  Created on: 2010-10-5
 *      Author: wyiu
 
*/

#include 
<cstdio>
#include 
<cstring>
#include 
<cmath>
using namespace std;

const double PI = 3.1415926535897932384626433832795;

const double E = 2.71828182845904523536;

int main()
{
    
int m, n;
    
double t;
    
int result;

    scanf(
"%d"&m);

    
while(m--)
    {
        scanf(
"%d"&n);

        t 
= 0.5*log10(2.0*PI*n)+n*log10(n/E);
        result 
= (int)t;
        result
++;
        printf(
"%d\n", result);
        fflush(stdout);
    }
    
return 0;
}
posted @ 2010-10-05 17:08 wyiu 閱讀(460) | 評(píng)論 (0)編輯 收藏
/*
 * hit1214.cpp
 *  
 *  Created on: 2010-10-3
 *      Author: wyiu
 
*/
#include 
<iostream>
#include 
<string>
#include 
<cstdio>
#include 
<cstring>
using namespace std;

unsigned f[]
={112358132134,
        
5589144233377610987159725844181,
        
67651094617711286574636875025121393196418317811514229,
        
83204013462692178309352457857028879227465,14930352,24157817,39088169,63245986,
        
102334155165580141267914296433494437,701408733113490317018363119032971215073
};

bool check(string s)
{
    
for(int i=0; i<s.length()-1; i++)
        
if(s[i]=='1' && s[i+1]=='1')
            
return false;
    
return true;
}
int main()
{
    
int n;
    unsigned val;
    
int len;
    
string s;
    
int i;

    scanf(
"%d"&n);

    
while(n--)
    {
        cin
>>s;

        val 
= 0;
        len 
= s.length();
        
for(i=len-1; i>=0--i)
        {
            
if(s[i] == '1')
            val 
+= f[len-i];
        }
        printf(
"%u in decimal, ", val);
        fflush(stdout);

        
if(check(s))
        {
            printf(
"already in standard form\n");
            fflush(stdout);
            
continue;
        }

        
for(i=0; i<len && s[i]=='0'; i++);
        
string stds(s.substr(i, len-i));

        
bool changed;
        
while(!check(stds))
        {
            
for(i=0, changed=false; i<stds.length()-1; i++)
            {
                
if(stds[i]=='1' && stds[i+1]=='1')
                {
                    stds[i]
='0';
                    stds[i
+1]='0';
                    
if(i==0)
                        stds 
= string("1")+stds;
                    
else stds[i-1]='1';
                    changed 
= true;
                }
                
if(changed)
                    
break;
            }
        }

        cout
<<"whose standard form is "<<stds<<endl;

    }
    
return 0;
}
posted @ 2010-10-05 15:13 wyiu 閱讀(367) | 評(píng)論 (0)編輯 收藏
  2010年10月4日
/*
 * 5_9_Strategy.cpp
 *  
 *  Created on: 2010-9-25
 *      Author: wyiu
 
*/

class Compositor
{
public:
    
virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                    
int componentCount, int lineWidth, int breaks) = 0;

protected:
    Compositor();

};

//------------------------------------------------------------------------
class Composition
{
public:
    Composition(Compositor 
*);
    
void repair();

private:
    Compositor 
*_compositor;
    Component 
*_components;
    
int _componentCount;
    
int _lineWidth;
    
int *_lineBreaks;
    
int _lineCount;
};

void Composition::repair()
{
    Coord 
*natural;
    Coord 
*stretchability;
    Coord 
*shrinkability;
    
int componentCount;
    
int *breaks;

    
//prepare the arrays with the desired component sizes
    
//

    
//determine where the breaks are:
    int breakCount;
    breakCount 
= _compositor->compose(natural, stretchability, shrinkability,
                                        componentCount, _lineWidth, breaks);

    
//lay out components according to breaks
    
//
}

//--------------------------------------------------------------------
//subclass of Compositor
class SimpleCompositor : public Compositor
{
public:
    SimpleCompositor();

    
virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                    
int componentCount, int lineWidth, int breaks);

    
//
};

class TeXCompositor : public Compositor
{
public:
    TeXCompositor();

    
virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                    
int componentCount, int lineWidth, int breaks);

    
//
};

class ArrayCompositor : public Compositor
{
public:
    ArrayCompositor();

    
virtual int compose(Coord natural[], Coord stretch[], Coord shrink[],
                    
int componentCount, int lineWidth, int breaks);

    
//
};

//-----------------------------------------
//using example
int main()
{
    
//

    Composition 
*quick = new Composition(new SimpleCompositor);
    Composition 
*slick = new Composition(new TeXCompositor);
    Composition 
*iconic = new Composition(new ArrayCompositor);

    
//.

    
return 0;
}
posted @ 2010-10-04 12:27 wyiu 閱讀(330) | 評(píng)論 (0)編輯 收藏
  2010年10月3日
F0=0F1=1F2=1F3=2F4=3
F5=5F6=8F7=13F8=21F9=34
F10=55F11=89F12=144F13=233F14=377
F15=610F16=987F17=1,597F18=2,584F19=4,181
F20=6,765F21=10,946F22=17,711F23=28,657F24=46,368
F25=75,025F26=121,393F27=196,418F28=317,811F29=514,229
F30=832,040F31=1,346,269F32=2,178,309F33=3,524,578F34=5,702,887
F35=9,227,465F36=14,930,352F37=24,157,817F38=39,088,169F39=63,245,986
F40=102,334,155F41=165,580,141F42=267,914,296F43=433,494,437F44=701,408,733
F45=1,134,903,170F46=1,836,311,903F47=2,971,215,073F48=4,807,526,976F49=7,778,742,049
int f[47]={0112358132134,
        
5589144233377610987159725844181,
        
67651094617711286574636875025121393196418317811514229,
        
83204013462692178309352457857028879227465,14930352,24157817,39088169,63245986,
        
102334155165580141267914296433494437,70140873311349031701836311903
};
posted @ 2010-10-03 18:13 wyiu 閱讀(458) | 評(píng)論 (0)編輯 收藏
/*
 * 1250.cpp
 *  
 *  Created on: 2010-10-3
 *      Author: wyiu
 
*/

#include 
<cstdio>
#include 
<cstring>
using namespace std;

int n;
int f[5][2100];

void init()
{
    memset(f, 
0sizeof(f));
    f[
0][0= 1;
    f[
1][0= 1;
    f[
2][0= 1;
    f[
3][0= 1;
    n
--;
}

int fib()
{
    
if(n < 4return 1;

    
int i, j, r, t, m;
    
for(i=4, m=1; i<=n; i++)
    {
        
for(j=0, r=0; j<m; j++)
        {
            t 
= f[(i-1)%5][j]+f[(i-2)%5][j]+f[(i-3)%5][j]+f[(i-4)%5][j] + r;
            f[i
%5][j] = t % 10;
            r 
= t / 10;
        }
        
if(r > 0)
        {
            f[i
%5][j] = r;
            m
++;
        }
    }
    
return m;
}

void display(int m)
{
    
int j;
    
for(j=m-1; j>=0; j--)
    {
        printf(
"%d", f[n%5][j]);
    }
    printf(
"\n");
    fflush(stdout);
}

int main()
{
    
while(scanf("%d"&n) != EOF)
    {
        init();
        
int m = fib();
        display(m);
    }
    
return 0;
}
posted @ 2010-10-03 17:40 wyiu 閱讀(511) | 評(píng)論 (0)編輯 收藏
/*
 * 1568.cpp
 *  
 *  Created on: 2010-10-2
 *      Author: wyiu
 
*/
#include 
<cstdio>
#include 
<cmath>
using namespace std;

int main()
{

    
int f[30];
    f[
0]=0;
    f[
1]=1;
    
for(int i=2; i<=20; i++)
    {
        f[i] 
= f[i-1+ f[i-2];
    }

    
int n;
    
while(scanf("%d"&n) != EOF)
    {
        
if(n <= 20)
        {
            printf(
"%d\n", f[n]);
            fflush(stdout);
            
continue;
        }
        
double a = -0.5*log10(5+ n*(log10(0.5*(1+sqrt(5.0))));
        
double r = a - int(a);
        
double b = pow(10, r);
        
while(b < 1000)
        {
            b
*=10;
        }
        printf(
"%d\n"int(b));
        fflush(stdout);
    }
    
return 0;
}
posted @ 2010-10-03 16:42 wyiu 閱讀(457) | 評(píng)論 (0)編輯 收藏
/*
 * 3070.cpp
 *  
 *  Created on: 2010-10-2
 *      Author: wyiu
 
*/
#include 
<cstdio>
using namespace std;
struct Matrix
{
    
int a11, a12;
    
int a21, a22;
};

Matrix mutilMatrix(Matrix a, Matrix b)
{
    Matrix c;
    c.a11 
= (a.a11*b.a11+a.a12*b.a21 ) % 10000;
    c.a12 
= (a.a11*b.a12+a.a12*b.a22 ) % 10000;
    c.a21 
= (a.a21*b.a11+a.a22*b.a21 ) % 10000;
    c.a22 
= (a.a21*b.a12+a.a22*b.a22 ) % 10000;
    
return c;

}

Matrix powerMatrix(
int n)
{
    
if(n == 0)
    {
        Matrix m0 ;
        m0.a11
=1;
        m0.a12
=0;
        m0.a21
=0;
        m0.a22
=1;
        
return  m0;
    }
    
else
    {
        Matrix a, b;
        a 
= powerMatrix(n/2);
        b 
= mutilMatrix(a, a);
        
if(n%2 != 0)
        {
            Matrix m1 ;
            m1.a11
=1;
            m1.a12
=1;
            m1.a21
=1;
            m1.a22
=0;

            b 
= mutilMatrix(b, m1);
        }
        
return b;
    }

}

int main()
{
    
int n;
    
while(scanf("%d"&n) != EOF)
    {
        
if(n == -1)
            
break;

        Matrix r 
= powerMatrix(n);

        printf(
"%d\n", r.a12);
        fflush(stdout);
    }
    
return 0;
}
posted @ 2010-10-03 16:41 wyiu 閱讀(249) | 評(píng)論 (0)編輯 收藏
  2010年10月2日
/*
 * 1021.cpp
 *  
 *  Created on: 2010-10-2
 *      Author: wyiu
 
*/

#include 
<cstdio>
#include 
<cstring>
using namespace std;

int f[1000001];

int main()
{
    f[
0]=7%3;
    f[
1]=11%3;
    
for(int i=2; i<=1000000; i++)
    {
        f[i] 
= (f[i-1+ f[i-2]) % 3;
    }

    
int x;
    
while(scanf("%d"&x) != EOF)
    {
        
if(f[x] == 0)
            printf(
"yes\n");
        
else printf("no\n");
        fflush(stdout);
    }
    
return 0;
}
posted @ 2010-10-02 16:48 wyiu 閱讀(248) | 評(píng)論 (0)編輯 收藏
  2010年3月31日
//推出同余式后直接上算法導(dǎo)論結(jié)論
#include <iostream>
using namespace std;
__int64 extgcd(__int64 a, __int64 b, __int64 
&x, __int64 &y)
{
    
if(b==0)
    
{
        x
=1,y=0;return a;
    }

    __int64 r
=extgcd(b,a%b,x,y);
    __int64 t
=x; x=y; y=t-a/b*y;
    
return r;
}

int main()
{
    __int64 x,y,m,n,l,k,t;
    __int64 a,b,c,d;
    
while(scanf("%I64d%I64d%I64d%I64d%I64d",&x,&y,&n,&m,&l)!=EOF)
    
{

        a
=m-n;
        b
=x-y;
        
if(m-n<0)
        
{
            a
=-a;
            b
=(-b+l)%l;
        }

        
else b=(b+l)%l;
        d
=extgcd(a,l,k,t);
        
if(b%d) { printf("Impossible\n"); continue;}
        k
=(k*(b/d)%l+l)%(l/d);

        printf(
"%I64d\n", k);
    }

    
return 0;
}


posted @ 2010-03-31 22:54 wyiu 閱讀(765) | 評(píng)論 (0)編輯 收藏

A+C*X=B(%2^K)
C*X=B-A(%2^K)
令a=c,b=B-A,n=2^K;
 利用以下結(jié)論(具體證明見《算法導(dǎo)論):
推論1:方程ax=b(mod n)對(duì)于未知量x有解,當(dāng)且僅當(dāng)gcd(a,n) | b。
推論2:方程ax=b(mod n)或者對(duì)模n有d個(gè)不同的解,其中d=gcd(a,n),或者無解。
定理1:設(shè)d=gcd(a,n),假定對(duì)整數(shù)x和y滿足d=ax+by(比如用擴(kuò)展Euclid算法求出的一組解)。如果d | b,則方程ax=b(mod n)有一個(gè)解x0滿足x0=x*(b/d) mod n 。特別的設(shè)e=x0+n,方程ax=b(mod n)的最小整數(shù)解x1=e mod (n/d),最大整數(shù)解x2=x1+(d-1)*(n/d)。
定理2:假設(shè)方程ax=b(mod n)有解,且x0是方程的任意一個(gè)解,則該方程對(duì)模n恰有d個(gè)不同的解(d=gcd(a,n)),分別為:xi=x0+i*(n/d) mod n 。

a*x=b(%n) => a*x+n*y=b
d=ext_gcd(a,n,x0,y0)
最小整數(shù)解x1=(x0*(b/d)%n+n)%(n/d);
  

#include <iostream>
using namespace std;
__int64 exgcd(__int64 a, __int64 b, __int64 
&x, __int64 &y)
{
    
if(b==0)
    
{
        x
=1;y=0;return a;
    }

    __int64 r
=exgcd(b, a%b, x, y);
    __int64 t
=x;x=y;y=t-a/b*y;
    
return r;
}

int main()
{
    __int64 A,B,C,K;
    __int64 a,b,n,d,x,y,e;
    
while(scanf("%I64d%I64d%I64d%I64d",&A,&B,&C,&K)!=EOF)
    
{
        
if(A==0 && B==0 && C==0 && K==0break;
        a
=C;
        n
=((__int64)1<<K); //小心溢出
        b=B-A;
        d
=exgcd(a, n, x, y);
        
if(b%d) {printf("FOREVER\n"); continue;}
        e
=x*(b/d)%n+n;
        printf(
"%I64d\n",e%(n/d));
    }

    
return 0;
}
;
posted @ 2010-03-31 22:48 wyiu 閱讀(407) | 評(píng)論 (0)編輯 收藏
僅列出標(biāo)題  下一頁
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            性做久久久久久久免费看| 亚洲午夜av电影| 亚洲成色精品| 性欧美video另类hd性玩具| 国语自产在线不卡| 老司机一区二区三区| 午夜精品视频在线观看| 久久九九99| 欧美高清一区| 亚洲精品久久久蜜桃| 欧美在线视频免费观看| 亚洲免费在线看| 国产毛片久久| 欧美在线观看一区二区| 亚洲日本欧美| 欧美三级网址| 欧美在线不卡| 欧美激情精品久久久久久蜜臀| 尤物九九久久国产精品的分类| 国内欧美视频一区二区| 亚洲免费电影在线| 亚洲影音先锋| 亚洲在线观看视频网站| 亚洲国产精品一区二区尤物区| 国产主播精品| 欧美激情欧美激情在线五月| 91久久午夜| 亚洲乱亚洲高清| 在线日韩日本国产亚洲| 欧美激情精品久久久久久大尺度| 亚洲欧美日韩天堂一区二区| 欧美在线观看天堂一区二区三区| 国产午夜精品久久久久久久| 久久成人久久爱| 亚洲欧美日韩国产成人| 欧美va天堂在线| 午夜在线精品偷拍| 欧美一级黄色网| 久久久久免费视频| 欧美激情第一页xxx| 亚洲午夜精品一区二区| 狠狠久久婷婷| 在线精品观看| 影音先锋中文字幕一区二区| 国产精品午夜久久| 国产精品高清网站| 欧美午夜精品久久久久免费视| 日韩一二三区视频| 亚洲欧洲精品一区二区三区波多野1战4| 一区二区三区在线观看国产| 欧美日韩中文在线| 国产欧美日韩视频一区二区三区| 欧美a级一区| 欧美大片在线观看一区二区| 久久免费视频在线观看| 久久xxxx精品视频| 久久婷婷麻豆| 国产视频精品va久久久久久| 亚洲视频一二| 亚洲一区二区在线视频| 亚洲国产精品一区在线观看不卡 | 欧美激情中文字幕一区二区| 91久久午夜| 亚洲精品在线观看免费| 99热免费精品在线观看| 欧美激情欧美激情在线五月| 欧美一区二视频| 亚洲电影免费在线观看| 亚洲国产精品久久精品怡红院| 夜夜嗨av色一区二区不卡| 黄色一区二区在线观看| 国内精品伊人久久久久av影院| 狠狠v欧美v日韩v亚洲ⅴ| 国产综合色在线视频区| 亚洲激情国产| 久久久精品五月天| 亚洲午夜精品17c| 国产精品女主播| 亚洲一级电影| 日韩视频免费观看高清完整版| 欧美中文字幕在线播放| 欧美日本三级| 一区二区电影免费观看| 欧美大秀在线观看| 午夜精品一区二区三区在线视| 欧美激情视频一区二区三区在线播放| 国产伦精品一区二区三| 欧美在线免费看| 亚洲欧美成人一区二区在线电影 | 欧美福利视频在线| 国产精品露脸自拍| 亚洲精品乱码久久久久久蜜桃麻豆| 亚洲成色www久久网站| 久久久国产精品一区| 亚洲黄色成人久久久| 亚洲深夜福利网站| 欧美视频二区36p| 久久久久久尹人网香蕉| 亚洲婷婷综合久久一本伊一区| 久久成人一区| 最近中文字幕日韩精品| 欧美大片91| 欧美激情一区二区久久久| 亚洲三级毛片| 一区二区三欧美| 黄色亚洲在线| 99精品国产在热久久| 国产欧美日韩综合一区在线播放| 午夜精品在线| 美女精品视频一区| 久久久久欧美| 国产欧美欧美| 亚洲宅男天堂在线观看无病毒| 国产婷婷色一区二区三区在线 | 久久久久久欧美| 男人天堂欧美日韩| 国产日韩欧美一二三区| 麻豆成人91精品二区三区| 欧美日产在线观看| 亚洲伊人网站| 欧美手机在线| 夜夜狂射影院欧美极品| 亚洲国产视频一区二区| 久久久久看片| 在线电影欧美日韩一区二区私密| av成人手机在线| 99av国产精品欲麻豆| 午夜精品久久久久影视| 亚洲在线成人精品| 国产欧美一区二区精品仙草咪| 亚洲精品视频在线| 国产一区视频在线看| 午夜一区在线| 欧美在线一二三四区| 国产精品手机视频| 欧美亚洲色图校园春色| 欧美大片在线影院| 一道本一区二区| 国产亚洲成精品久久| 99一区二区| 亚洲综合日韩在线| 国产一区美女| 欧美激情免费观看| 最新亚洲激情| 欧美日韩影院| 亚洲一区二区综合| 久久中文字幕一区二区三区| 欧美日韩免费一区| 性xx色xx综合久久久xx| 亚洲视频1区| 国产欧美一区二区精品仙草咪 | 久久久久91| 猛男gaygay欧美视频| 在线不卡a资源高清| 欧美一区二区三区久久精品茉莉花 | 欧美日韩一区二区视频在线| 欧美一区日韩一区| 国产精品日日做人人爱| 欧美亚洲一区二区在线观看| 99国产精品久久久久久久久久| 另类尿喷潮videofree| 麻豆精品视频在线观看视频| 欧美偷拍另类| 久久午夜国产精品| 午夜精品亚洲| 亚洲美女电影在线| 午夜精品成人在线| 欧美刺激性大交免费视频| 99这里只有久久精品视频| 免费久久99精品国产自| 一区二区三区精品视频| 国产精品va在线播放| 亚洲欧美激情视频| 在线亚洲成人| 免费成人av在线| 久久夜色精品| 欧美插天视频在线播放| 欧美一区二区三区男人的天堂| 亚洲国产精品成人va在线观看| 国产一区二区三区丝袜| 久久国产欧美精品| 亚洲精品日韩一| 欧美 日韩 国产一区二区在线视频| 亚洲欧洲精品一区二区| 欧美天天综合网| 欧美激情一区二区三区全黄| 亚洲人成欧美中文字幕| 久久精品国产免费| 欧美一区二区三区四区在线观看| 亚洲精品1234| 亚洲国产综合在线看不卡| 国产精品人人做人人爽人人添| 欧美色图一区二区三区| 免费日韩av| 欧美成人一区二区三区| 免费视频最近日韩| 日韩天天综合| 亚洲一级一区| 久久综合福利| 亚洲精品视频在线观看免费|