摘要: Emily the entrepreneur has a cool business idea: packaging and selling snowflakes. She has devised a machine that captures snowflakes as they fall, an 阅读全文
posted @ 2017-08-02 15:39 小小超plus 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把 阅读全文
posted @ 2017-08-02 11:29 小小超plus 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 #include<string.h> 4 #include<set> 5 #include<stdio.h> 6 #include<math.h> 7 #include<queue> 8 #include< 阅读全文
posted @ 2017-08-02 11:28 小小超plus 阅读(468) 评论(0) 推荐(0) 编辑
摘要: B君和G君聊天的时候想到了如下的问题。 给定自然数l和r ,选取2个整数x,y满足l <= x <= y <= r ,使得x|y最大。 其中|表示按位或,即C、 C++、 Java中的|运算。 Input包含至多10001组测试数据。 第一行有一个正整数,表示数据的组数。 接下来每一行表示一组数据, 阅读全文
posted @ 2017-08-02 11:27 小小超plus 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a 阅读全文
posted @ 2017-08-02 11:25 小小超plus 阅读(274) 评论(0) 推荐(0) 编辑
摘要: There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlo 阅读全文
posted @ 2017-08-02 11:24 小小超plus 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人,有M种宗教,每个犯人可能信仰其中一种。如果相邻房间的犯人的宗教相同,就可能发生越狱,求有多少种状态可能发生越狱 Input 输入两个整数M,N.1<=M<=10^8,1<=N<=10^12 Output 可能越狱的状态数,模100003取余 阅读全文
posted @ 2017-08-02 11:02 小小超plus 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Harry Potter and He-Who-Must-Not-Be-Named engaged in a fight to the death once again. This time they are located at opposite ends of the corridor of l 阅读全文
posted @ 2017-08-02 11:01 小小超plus 阅读(128) 评论(0) 推荐(0) 编辑
摘要: As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many or 阅读全文
posted @ 2017-08-02 11:00 小小超plus 阅读(146) 评论(0) 推荐(0) 编辑
摘要: “今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永 阅读全文
posted @ 2017-08-02 10:58 小小超plus 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数 阅读全文
posted @ 2017-08-02 10:57 小小超plus 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 简单BFS 1 #include <iostream> 2 using namespace std; 3 #include<string.h> 4 #include<set> 5 #include<stdio.h> 6 #include<math.h> 7 #include<queue> 8 #in 阅读全文
posted @ 2017-08-02 10:56 小小超plus 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and 阅读全文
posted @ 2017-08-02 10:55 小小超plus 阅读(156) 评论(0) 推荐(0) 编辑
摘要: A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacen 阅读全文
posted @ 2017-08-02 10:54 小小超plus 阅读(168) 评论(0) 推荐(0) 编辑
摘要: There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he c 阅读全文
posted @ 2017-08-02 10:53 小小超plus 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 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-08-02 10:52 小小超plus 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 #include<string.h> 4 #include<set> 5 #include<stdio.h> 6 #include<math.h> 7 #include<queue> 8 #include< 阅读全文
posted @ 2017-08-02 10:51 小小超plus 阅读(247) 评论(0) 推荐(0) 编辑
摘要: In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous regions, producing 阅读全文
posted @ 2017-08-02 10:49 小小超plus 阅读(211) 评论(0) 推荐(0) 编辑
摘要: A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. 阅读全文
posted @ 2017-08-02 10:48 小小超plus 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. 阅读全文
posted @ 2017-08-02 10:47 小小超plus 阅读(145) 评论(0) 推荐(0) 编辑