摘要:
不互质的中国剩余定理……链接http://acm.hdu.edu.cn/showproblem.php?pid=3579#include#include#include#include#includeusing namespace std;int n,m;int extend_gcd(int a,int b,int &x,int &y){ int m; if(b==0) { x=1; y=0; return a; } else { m=extend_gcd(b,a%b,x,y); int t=x; x=y; y=t-a/b*y; } return m;}int main(){ 阅读全文
摘要:
主要考察卡特兰数,大数乘法,除法……链接http://acm.hdu.edu.cn/showproblem.php?pid=1134#include#include#include#include#includeusing namespace std;int an[102][102];void mul(int i){ int k,j,t=0,a=4*i-2,b=i+1,temp; k=100; while(an[i-1][k]9) k--; for(j=0;j9) { t=an[i][j]/10; an[i][j]%=10; } else t=0; } while(t!=0) { an[i][ 阅读全文