求前n个Catalan数的和mod m的值——可作为求a/b mod m的模版
摘要:
#include <iostream>#include <string.h>#include <stdio.h>usingnamespace std;#define N 110typedef longlong lld;int n,m,p;int sm[N],sa[N];lld sum,res;void extgcd(int a, int b, int& x, int& y){ if (b ==0) { x=1; y=0; return; } extgcd(b, a % b, x, y); int t = x; x = y; y = t - a 阅读全文
posted @ 2011-09-17 20:48 Moon_1st 阅读(345) 评论(0) 推荐(0) 编辑