其中,将洞穴连起来的算法要好好体会。学习构建临时变量列表,确认循环用FOR,非确定循环用 WHILE,并定好退出条件。from random import choicecave_numbers = range(0,20)caves = []for i in cave_numbers: cave...
分类:
其他好文 时间:
2014-09-21 00:04:59
阅读次数:
431
有空就要慢慢练起~~~~脑袋动起来是很快乐的事儿。。。。:)《易学PYTHON》演练一遍。from random import choicecave_numbers = range(1,21)wumpus_location = choice(cave_numbers)player_location ...
分类:
其他好文 时间:
2014-09-20 15:15:27
阅读次数:
182
https://oj.leetcode.com/problems/combinations/Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If ...
分类:
编程语言 时间:
2014-09-20 09:58:07
阅读次数:
204
原题地址:https://oj.leetcode.com/problems/next-permutation/题意:Implement next permutation, which rearranges numbers into the lexicographically next greater...
分类:
编程语言 时间:
2014-09-20 07:44:56
阅读次数:
241
数据库(database):存放数据的仓库.存放的是一张一张的表,特别像:Excel,Numbers都以表格形式存放数据.可以创建多张表,常见的数据库:sqlite,MySQL,SQLServer,Oracle,access为什么要用到数据库.1.文件读写,归档读取数据时需要一次把数据全部读出来.占内存,2.数据库效率很高.体现在..
分类:
数据库 时间:
2014-09-20 02:23:16
阅读次数:
235
题意:给定x、y,为[x,y]之间有多少个数的偶数位和减去奇数位和等于一。
个位是第一位。
例子: 10=1-0=1 所以10是这样的数
思路:数位dp[i][sum][ok] i位和为sum 是否含有前导0.
然后就是因为有负数 所以根据范围把0设置为100 然后最后和等于101则为所求的数。
代码:
#include"cstdlib"
#include"cstdio"
#inclu...
分类:
其他好文 时间:
2014-09-19 17:43:29
阅读次数:
186
1.Implement a functionthat prints the numbers from 1 to 100.But for multiples of three(3) print “Zif”insteadof the number and for the multiples of five(5) print “Nab”. For numbers whichare multiples...
分类:
编程语言 时间:
2014-09-19 12:06:25
阅读次数:
198
[leetcode]Sum Root to Leaf Numbers...
分类:
其他好文 时间:
2014-09-19 12:05:04
阅读次数:
145
[leetcode]Given two integers n and k, return all possible combinations of k numbers out of 1 ... n....
分类:
其他好文 时间:
2014-09-19 10:07:55
阅读次数:
209
POJ2739_Sum of Consecutive Prime Numbers【筛法求素数】【枚举】...
分类:
其他好文 时间:
2014-09-18 23:51:14
阅读次数:
237