上一页 1 ··· 11 12 13 14 15
摘要: #coding=utf-8# 递归# 深度优先遍历,找全路径 20190306 找工作期间class Solution1(object): def uniquePaths(self, m, n): """ :type m: int :type n: int :rtype: int """ if m 阅读全文
posted @ 2019-03-17 12:29 AceKo 阅读(166) 评论(0) 推荐(0)
摘要: 01 背包问题 阅读全文
posted @ 2019-03-17 12:11 AceKo 阅读(226) 评论(0) 推荐(0)
摘要: 问题描述: 所谓“马踏棋盘”问题,就是指在中国象棋的棋盘上,用马的走法走遍整个棋盘,在8*8的方格中,每个格都要遍历,且只能遍历一次。 我们把棋盘抽象成一个二维数据,输入起始位置的坐标(x,y),根据马的“日”字走法,将马走的步数写入二维数组,然后输出。下面是一种走法: 解决方法: 我们从图中可以看 阅读全文
posted @ 2016-03-01 14:48 AceKo 阅读(674) 评论(0) 推荐(0)
摘要: 方法一:(穷举法与剪支) void main() { int a[9]; int i,t=1; for(a[1]=1;a[1]<9;a[1]++) for(a[2]=1;a[2]<9;a[2]++) { if(!Check(a,2)) continue; for(a[3]=1;a[3]<9;a[3] 阅读全文
posted @ 2016-03-01 14:39 AceKo 阅读(147) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15