2011年8月31日

ACM PKU 3734 Blocks

摘要: 题目描述:http://poj.org/problem?id=3734递推公式:E(t)=(1+t+t^2/2!+......+..)^2*(1+t^2/2!+t^4/4!+..+)^2 =e^2t*((e^t+e^-t)/2)^2 =1/4(e^4t+2*e^2t) =sigma(1/4*[4^n+2*2^n]*t^n/n!) n=0,1,2,,, ==> a(n)=1/4(4^n+2*2^n)#include <iostream>#include <cstring>#include <cstdio>const int M = 10007;using 阅读全文

posted @ 2011-08-31 20:48 _Clarence 阅读(143) 评论(0) 推荐(0) 编辑

ACM PKU 1061 青蛙的约会

摘要: 题目描述:http://poj.org/problem?id=1061#include <cstring>#include <cstdio>long long x,y,m,n,L,X,Y;long long gcd(long long a, long long b){ if(b==0)return a; else return gcd(b,a%b);}long long ext_gcd(long long a,long long b,long long& x,long long& y){ long long t,ret; if (!b) { x=1... 阅读全文

posted @ 2011-08-31 18:28 _Clarence 阅读(151) 评论(0) 推荐(0) 编辑

导航