POJ PKU 2613 模拟
(2010-04-29 15:14:45)
标签:
pojpku2613it |
分类: 杂题 |
compute the the result of dividing C(p,q) by C(r,s)
解题报告:
所有的数字都可以分解成素数的乘积,所以最后分子和分母可以拆分成最简的几个素数。
卡精度,从分子的项开始乘,大于100000000时,除分母的项,直到小于100000000。
代码如下:
#include<iostream>
#include<cmath>
#include <iomanip>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
#define size 1230
#define mmax 50000
#define maxn 10000
#define maxp 10000
int ud[2][size], p, q, r, s, x[10004][size], cnt1, cnt2;
char mk[maxn];
double up[mmax], down[mmax];
int prime[maxp], pnum;
void Prime(int n)
{
}
void judge(int pos)
{
}
void jeogia(int n)
{
}
void merge(int a, int b, int c, int pos)
{
}
void minu()
{