Problem 15:Lattice paths
来源:互联网 发布:菜鸟网络待遇 编辑:程序博客网 时间:2024/06/06 04:00
原题链接:http://projecteuler.net/problem=15
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的网格,这样的路有多少条?
解法1:
规律看这里:http://www.robertdickau.com/lattices.html
php代码:
$len = 21;$arr=array(0=>array_fill(0,$len,1));for($i=1;$i<$len;$i++){$arr[$i][0]=1;for($j=1;$j<$len;$j++){$arr[$i][$j] = $arr[$i][$j-1]+$arr[$i-1][$j];}}
注:题目的中文翻译源自http://pe.spiritzhang.com
- Problem 15:Lattice paths
- Problem 15:Lattice paths
- Problem 15 Lattice paths
- projecteuler---->problem=15----Lattice paths
- Project Euler:Problem 15 Lattice paths
- Problem 15 Lattice paths (组合数学)
- Project Euler Problem 15 Lattice paths
- PE 15 Lattice paths
- project euler 15 Lattice paths
- Lattice paths
- 欧拉项目第15题 Lattice paths
- Lattice paths——格子路径
- [LeetCode]problem 62. Unique Paths
- 最短路径问题Shortest-Paths Problem
- [LeetCode]problem 63. Unique Paths II
- CF 14 problem D - Two paths
- Dynamic Programing -- Leetcode problem 62. Unique Paths
- 算法设计Week12 LeetCode Algorithms Problem #62 Unique Paths
- Hdu 4715 Difference Between Primes (2013网络赛 warm up) & LightOJ 1259 Goldbach`s Conjecture(素数和差)
- in与exist , not in与not exist 的区别
- BANK 2.0
- SUSE linux下应用安装
- AAM算法简介
- Problem 15:Lattice paths
- Side Effect与Sequence Point
- POJ 1068 Parencodings
- linux常用命令大全
- hdu 4707 Pet(图 + 邻接表)
- linux下C编程笔记
- 端口映射和代理软件stone
- atoi函数和atof函数实现
- HDU 4714 Tree2cycle