上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 23 下一页
摘要: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1498题意的意思是给你n个房间,每个房间有一个价值,每个房间可以通向一些其他的房间,然后每个房间可以访问多... 阅读全文
posted @ 2015-09-08 17:12 __NaCl 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Slash MazeBy filling a rectangle with slashes (/) and backslashes ( ), you can generate nice little mazes. Here is an example:As you can see, paths ... 阅读全文
posted @ 2015-09-06 22:09 __NaCl 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=473= =这题就是就是给你一个三维的图,然后给你一个起点,一个终点,中间有障碍= =问你是否能够从... 阅读全文
posted @ 2015-09-06 21:55 __NaCl 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 原题链接https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=598这题就是在一堆*里找X,相邻的X算一个,所以我们可以两次dfs搜索,dfs2搜*有多少堆,df... 阅读全文
posted @ 2015-09-04 22:44 __NaCl 阅读(175) 评论(0) 推荐(0) 编辑
摘要: B. Bear and Three Musketeerstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDo you know a story ... 阅读全文
posted @ 2015-09-01 22:16 __NaCl 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1092这题其实可以把字符串str反转一下然后再求两个字符串的最长公共子序列的长度,然后len(str)-那个长度就是答案了= =#include#include#i... 阅读全文
posted @ 2015-09-01 22:07 __NaCl 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1050如果没有循环的条件,那么我们可以用常规的方法算出最大的字段和max1然后加上循环这个条件,我们可以先求出整个数组的和,然后在求出数组最小子段和,然后然后相减得... 阅读全文
posted @ 2015-08-26 19:21 __NaCl 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 有一堆石子共有N个。A B两个人轮流拿,A先拿。每次最少拿1颗,最多拿K颗,拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N和K,问最后谁能赢得比赛。例如N = 3,K = 2。无论A如何拿,B都可以拿到最后1颗石子。Input第1行:一个数T,表示后面用作输入测试... 阅读全文
posted @ 2015-08-26 19:13 __NaCl 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 原题链接:http://www.51nod.com/onlineJudge/questionCode.html#problemId=1095&noticeId=20791老实说这题,我是很不想用字典树,因为不熟~~~但后来没搞出来,就用了字典树。。。。。。。。。。当然得参考一下大神的代码。解法:用m... 阅读全文
posted @ 2015-08-25 18:09 __NaCl 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 就是一个国际象棋的棋盘,可以八个方向走,问从起点到终点的最少步数是多少,还给出一个一个点是不可走的,简单的bfs#include#include#include#include#include#include using namespace std;int vis[10][10];int dis[8... 阅读全文
posted @ 2015-08-23 16:58 __NaCl 阅读(220) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 23 下一页