
搜索
文章平均质量分 71
墓菱
这个作者很懒,什么都没留下…
展开
-
Fire Game(FZU - 2150)
Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they start...原创 2018-05-26 13:53:01 · 285 阅读 · 0 评论 -
Ignatius and the Princess I(HDOJ-1026)
Problem Description The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166’s castle. The castle is a large labyrinth....原创 2018-05-29 10:03:28 · 230 阅读 · 0 评论 -
7-3 列出连通集(25 分)
给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。输入格式:输入第1行给出2个整数N(0<N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每行中的数字之间用1空格分隔。输出格式:按照"{ v1 v2 ... vk }"的...原创 2018-03-28 20:15:05 · 1148 阅读 · 0 评论 -
7-1 列出叶结点(25 分)
7-1 列出叶结点(25 分)对于给定的二叉树,本题要求你按从上到下、从左到右的顺序输出其所有叶节点。输入格式:首先第一行给出一个正整数 N(≤10),为树中结点总数。树中的结点从 0 到 N−1 编号。随后 N 行,每行给出一个对应结点左右孩子的编号。如果某个孩子不存在,则在对应位置给出 "-"。编号间以 1 个空格分隔。输出格式:在一行中按规定顺序输出叶节点的编号。编号间以 1 个空格分隔,行...原创 2018-03-28 20:11:03 · 9144 阅读 · 2 评论 -
Sudoku Killer(HDOJ-1426)
Problem Description自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视。 据说,在2008北京奥运会上,会将数独列为一个单独的项目进行比赛,冠军将有可能获得的一份巨大的奖品———HDU免费七日游外加lcy亲笔签名以及同hdu acm team合影留念的机会。 所以全球人民前仆后继,为了奖品日夜训练茶饭不思。当然也包括初学者li...原创 2018-07-05 18:33:19 · 267 阅读 · 0 评论 -
Fair(CodeForces - 986A)
题目:CLICK HERE题意:一共有n个城市分别生产k种商品,现在需要知道从每个城市出发至少得到s种不同的商品的最短距离。思路:第一次看还以为是最短生成树,但这样子可以求获得所有商品的最短距离而无法求得s种的。所以换一种思路,可以求第i个城市出发到第j个商品的最短距离。但这样子至少要n次搜索,n的数据最大为1e5明显会超时。 于是用一种巧妙的方法,看到种类的数目最大为100...原创 2018-07-07 16:44:27 · 283 阅读 · 0 评论 -
Stars Drawing (Hard Edition)(Codeforces-1015E2)
题目链接题意:给出一个n*m的图,四方向*的最大长度相同为一个星星,问能否找到不大于n*m颗星星,使得图中的所有*都被星星覆盖。思路:显然是一个搜索题,hard edition和easy edition的差别只有图的大小为1000*1000/300*300。 思路也很清晰,虽然题中说星星的数量不一定要最少,但由于不能大于n*m,所以干脆就求最少的星星数目,每次遇到*就搜出它四方向...原创 2018-08-01 01:15:32 · 739 阅读 · 1 评论 -
Tree(HDU - 6228)
Consider a un-rooted tree T which is not the biological significance of tree or plant, but a tree as an undirected graph in graph theory with n nodes, labelled from 1 to n. If you cannot understand th...原创 2018-08-22 22:31:28 · 242 阅读 · 0 评论 -
Halting Problem(2018 ACM/ICPC Asia Regional Qingdao Online)
In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program, whether the program will finish running (i.e., halt) or continue to run...原创 2018-09-16 17:28:30 · 311 阅读 · 0 评论