2017年7月18日

摘要: As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Correct 阅读全文
posted @ 2017-07-18 16:23 Annetree 阅读(181) 评论(0) 推荐(0) 编辑
 
摘要: 1.BFS是用来搜索最短径路的解是比较合适的,比如求最少步数的解,最少交换次数的解,因为BFS搜索过程中遇到的解一定是离根最近的,所以遇到一个解,一定就是最优解,此时搜索算法可以终止。这个时候不适宜使用DFS,因为DFS搜索到的解不一定是离根最近的,只有全局搜索完毕,才能从所有解中找出离根的最近的解 阅读全文
posted @ 2017-07-18 11:03 Annetree 阅读(2257) 评论(0) 推荐(1) 编辑
 
摘要: Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a numb 阅读全文
posted @ 2017-07-18 10:56 Annetree 阅读(143) 评论(0) 推荐(0) 编辑
 
摘要: 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将 阅读全文
posted @ 2017-07-18 10:20 Annetree 阅读(165) 评论(0) 推荐(0) 编辑
 
摘要: Problem Description In China, foreign brand commodities are often much more expensive than abroad. The main reason is that we Chinese people tend to t 阅读全文
posted @ 2017-07-18 09:46 Annetree 阅读(363) 评论(0) 推荐(0) 编辑