摘要: Problem Description “连连看”相信很多人都玩过。没玩过也没关系,下面我给大家介绍一下游戏规则:在一个棋盘中,放了很多的棋子。如果某两个相同的棋子,可以通过一条线连起来(这条线不能经过其它棋子),而且线的转折次数不超过两次,那么这两个棋子就可以在棋盘上消去。不好意思,由于我以前没有 阅读全文
posted @ 2019-03-09 14:33 鹤花之歌 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1.fill() 中 ,它的原理是把那一块单元赋成指定的值,也就是说任何值都可以 2.memset() 1 2019.07.22修订:val 传递的是ascii码,所以如果是初始化int类型的数组,只能赋值0 或 -1.如果是初始化char类型数组,那么可以写memset(x,'+',sizeof( 阅读全文
posted @ 2019-03-09 13:45 鹤花之歌 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1. 输入两个整数a和b,及另一正整数c,计算a/b,结果精确到小数点后c位 输入输入包含多组数据,每组数据包含三个正整数a,b,c,其中a,b≤106,c≤5,中间用空格隔开。结束标记为a=b=c=0。 输出对于每组输入,对应于一行输出,首先输出“Case N: ”,表示第N组输出(从1开始,不用 阅读全文
posted @ 2019-03-08 19:17 鹤花之歌 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Problem Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个 阅读全文
posted @ 2019-03-05 19:44 鹤花之歌 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe Sky is Sprite.The Birds is Fly in the Sky.The Wind is Wonderful.Blew Throw the TreesTrees are Shaking, Leaves are Falling.Lover 阅读全文
posted @ 2019-03-05 19:32 鹤花之歌 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1.字符统计:一串字符统计其字符数量,不含空格换行。注意EOF的使用(怕不是因为OJ,我现在可能都不知道EOF是什么鬼),以及getchar()的特性。 #include <stdio.h> int main() { int num; char c; while (1) { c = getchar( 阅读全文
posted @ 2019-03-05 19:04 鹤花之歌 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionFarmer 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 ≤ 阅读全文
posted @ 2019-02-22 20:16 鹤花之歌 阅读(150) 评论(0) 推荐(0) 编辑
摘要: cf/gym-101755H Safe Path 【BFS】 http://codeforces.com/gym/101755/problem/H HDU-1045 Fire Net https://vjudge.net/contest/283487#problem/F 阅读全文
posted @ 2019-02-22 19:58 鹤花之歌 阅读(186) 评论(0) 推荐(0) 编辑
摘要: DescriptionMahmoud and Ehab are on the third stage of their adventures now. As you know, Dr. Evil likes sets. This time he won’t show them any set fro 阅读全文
posted @ 2019-02-22 19:52 鹤花之歌 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Description 在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试实例的个数, 阅读全文
posted @ 2019-02-22 19:15 鹤花之歌 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些 阅读全文
posted @ 2019-02-22 19:01 鹤花之歌 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Vanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corr 阅读全文
posted @ 2019-02-22 18:45 鹤花之歌 阅读(403) 评论(0) 推荐(0) 编辑
摘要: Description In 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture: Ev 阅读全文
posted @ 2019-02-22 18:34 鹤花之歌 阅读(236) 评论(0) 推荐(0) 编辑
摘要: You are given a string ss, consisting of nn lowercase Latin letters. A substring of string ss is a continuous segment of letters from ss. For example, 阅读全文
posted @ 2019-02-22 17:08 鹤花之歌 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题意:和韩信点兵差不多,不过这个要求更高一些。 阅读全文
posted @ 2019-02-22 17:03 鹤花之歌 阅读(126) 评论(0) 推荐(0) 编辑