Problem 15 Lattice paths (组合数学)
2016-10-26 23:02
429 查看
Lattice paths
Problem 15
Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.How many such routes are there through a 20×20 grid?
|
代码:
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
long long ans1=1;
int j=1;
for(int i=21;i<=40;i++)
{
ans1=(ans1*i)/j;
j++;
if(j>20)break;
}
cout<<ans1<<endl;
return 0;
}
相关文章推荐
- projecteuler---->problem=15----Lattice paths
- CodeForces 340 C.Tourist Problem(组合数学)
- 2016 UESTC Training for Math Problem A-谭爷的黑暗沙拉(组合数学)
- ACM学习历程—SNNUOJ 1116 A Simple Problem(递推 && 逆元 && 组合数学 && 快速幂)(2015陕西省大学生程序设计竞赛K题)
- BZOJ 2302([HAOI2011]Problem c-组合数学)
- POJ 2282 The Counting Problem,组合数学
- Codeforces Round #144 (Div. 1), problem: (B) Table DP 组合数学
- Problem 15 Lattice paths
- Project Euler:Problem 15 Lattice paths
- Problem 15:Lattice paths
- Project Euler Problem 15 Lattice paths
- Problem 15:Lattice paths
- joj 1172 The Equation Problem 组合数学
- LightOJ 1102 Problem Makes Problem(组合数学)
- POJ 2282-The Counting Problem(组合数学_区间计数)
- SPOJ 26777 ANTP - Mr. Ant & His Problem(组合数学)
- [HYSBZ/BZOJ2301]Problem b [莫比乌斯反演+分块] 【组合数学】
- Codeforces Round #439 (Div. 2) Problem C (Codeforces 869C) - 组合数学
- BZOJ2302: [HAOI2011]Problem c|动态规划|组合数学
- CodeForces 15 E.Triangles(组合数学+dp)