(Problem 15)Lattice paths
2024-10-18 21:16:32
Starting in the top left corner of a 22 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 2020 grid?
题目大意:
从一个22网格的左上角开始,有6条(不允许往回走)通往右下角的路。
对于2020的网格,这样的路有多少条?
// (Problem 15)Lattice paths
// Completed on Tue, 11 Feb 2014, 23:58
// Language: VC++2010
//
// 版权所有(C)acutus (mail: acutus@126.com)
// 博客地址:http://www.cnblogs.com/acutus/
#include<iostream>
#include<cmath>
using namespace std; long long a[][]; int main()
{
int i;
for(i = ; i < ; i++)
{
a[][i] = ;
a[i][] = ;
}
for (i = ; i < ; i++)
for (int j = ; j < ; j++)
a[i][j] = a[i][j-] + a[i-][j];
cout<<a[][]<<endl;
return ;
}
Answer:
|
137846528820 |
最新文章
- map 和 vector 的erase函数说明
- (十三) [终篇] 一起学 Unix 环境高级编程 (APUE) 之 网络 IPC:套接字
- Mina、Netty、Twisted一起学(五):整合protobuf
- View相关知识学习总结
- 【2016-10-10】【坚持学习】【Day1】【观察者模式】
- Swift3.0语言教程使用编码创建和初始化字符串
- C# Process执行bat
- servlet&;jsp高级:第三部分
- jquery 判断是否 ie6 ie7 ie8
- 获取iOS设备属性
- python数据类型——数字类型
- Dynamics CRM项目实例之九:CRM 2015的产品中的捆绑销售
- 第四节,目标检测---YOLO系列
- 3Delight feats. OpenVDB
- centOS7docker安装oracle
- python学习笔记(10)--组合数据类型(序列类型)
- [转]MySQL事务学习-->;隔离级别
- 铁乐学python26_hashlib+configparser+logging模块
- 一般处理程序中,获取session
- Kernel Mode, User Mode