
组合数学
__铭
这个作者很懒,什么都没留下…
展开
-
poj 1942 Paths on a Grid
j求 aCb 的值, 可以用 拆分阶乘,逐项相除,再乘以前面所有项之积 while(b > 0) sum *= (double)a--/(double)b--; Description Imagine you are attending your math lesson at school. Once again, you are bored because you原创 2015-08-26 11:11:13 · 357 阅读 · 0 评论 -
poj 1019 Number Sequence
#include #include #include #include #include #include #include #include #include #include #define RR freopen("in.txt","r",stdin) #define WW freopen("out.txt","w",stdin) #define LL long long原创 2015-08-26 10:12:41 · 428 阅读 · 0 评论 -
Codeforces Round #343 (Div. 2) Far Relative’s Birthday Cake
大致题意: 给出一个n*n的矩阵,求有多少对C在同一行或同一列 方法: 遍历每一行,求出每一行中C的数量,然后利用组合数学的排列组合求出方案数 遍历每一列,同上 。。。。。 A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 mega原创 2016-02-21 09:44:44 · 688 阅读 · 0 评论