题目链接 http://vjudge.net/contest/137242#problem/D Description You're addicted to a little game called `remember the melody': you hear some notes, and then you repeat it. In most cases, the longer the melody, the harder to repeat, but it isn't always tr
Java字符串排列算法 题目:现有ABCDE 5个球 构成的排列组合 可重复抽取 最多取到16个 共有多少种组合方式? 比如:取1个球可以构成的组合有 A B C D E 共5种,取2个球可以构成的组合有 5+4+3+2+1=15种 (BA 和 AB 这种重复的排列 算成一种) AA AB AC AD AE BB BC BD BE CC CD CE DD DE EE 取 3 个球可以构成的组合是 (5+4+3+2+1)+(4+3+2+1)+(3+2+1)+(2+1)+1= 35种 AAA AA
Borg Maze DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Each Borg individual is linked
那天的题挺简单的 下面来看下 No1 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. //project euler num1 #include <stdio.h> #inc
think in python think in python -9 案例分析:文字游戏 从文本文件中读取文字 作者提供了一个文本文件words.txt 地址 本章后面案例也会用带该文件中的词组 fin = open("words.txt") for line in fin: word = line.strip() print word 练习 编写一个程序,读入words.txt并且打印出长度超过20个字符的单词 fin = open("words.txt") fo
http://acm.hdu.edu.cn/showproblem.php?pid=1242 问题:牢房里有墙(#),警卫(x)和道路( . ),天使被关在牢房里位置为a,你的位置在r处,杀死一个警卫要一秒钟,每走一步要一秒钟,求最短时间救出天使,不能救出则输出:Poor ANGEL has to stay in the prison all his life. 求最短路径,果断广搜BFS 限制及剪枝: 1.墙不能走,不能离开牢房范围 2.杀死一个警卫要多花一秒钟 3.当前步骤大于等于最短时间