摘要: 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 阅读(222) 评论(0) 推荐(0)
摘要: 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把 阅读全文
posted @ 2017-08-02 11:29 小小超plus 阅读(185) 评论(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 阅读(474) 评论(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 阅读(214) 评论(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 阅读(309) 评论(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 阅读(184) 评论(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 阅读(175) 评论(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 阅读(142) 评论(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 阅读(154) 评论(0) 推荐(0)
摘要: “今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永 阅读全文
posted @ 2017-08-02 10:58 小小超plus 阅读(176) 评论(0) 推荐(0)
摘要: 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数 阅读全文
posted @ 2017-08-02 10:57 小小超plus 阅读(148) 评论(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 阅读(145) 评论(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 阅读(169) 评论(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 阅读(176) 评论(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 阅读(128) 评论(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 阅读(185) 评论(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 阅读(256) 评论(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 阅读(234) 评论(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 阅读(174) 评论(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 阅读(164) 评论(0) 推荐(0)
摘要: Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a 阅读全文
posted @ 2017-08-02 10:45 小小超plus 阅读(167) 评论(0) 推荐(0)
摘要: 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。 你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 Input输入包含多组测试 阅读全文
posted @ 2017-08-02 10:44 小小超plus 阅读(175) 评论(0) 推荐(0)
摘要: You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. 阅读全文
posted @ 2017-08-02 10:42 小小超plus 阅读(185) 评论(0) 推荐(0)
摘要: A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the ne 阅读全文
posted @ 2017-08-02 10:42 小小超plus 阅读(157) 评论(0) 推荐(0)
摘要: I’m out of stories. For years I’ve been writing stories, some rather silly, just to make simple problems look difficult and complex problems look easy 阅读全文
posted @ 2017-08-02 10:40 小小超plus 阅读(163) 评论(0) 推荐(0)
摘要: Holedox is a small animal which can be considered as one point. It lives in a straight pipe whose length is L. Holedox can only move along the pipe. C 阅读全文
posted @ 2017-08-02 10:38 小小超plus 阅读(143) 评论(0) 推荐(0)
摘要: lice and Bob love playing one-dimensional battle ships. They play on the field in the form of a line consisting of n square cells (that is, on a 1 × n 阅读全文
posted @ 2017-08-02 10:37 小小超plus 阅读(196) 评论(0) 推荐(0)
摘要: 汝佳的做法 1 #include <iostream> 2 using namespace std; 3 #include<string.h> 4 #include<string> 5 #include<set> 6 #include<sstream> 7 #include<stdio.h> 8 # 阅读全文
posted @ 2017-08-02 10:35 小小超plus 阅读(122) 评论(0) 推荐(0)
摘要: Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in one 阅读全文
posted @ 2017-08-02 10:34 小小超plus 阅读(137) 评论(0) 推荐(0)
摘要: Our chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the 阅读全文
posted @ 2017-08-02 10:33 小小超plus 阅读(186) 评论(0) 推荐(0)
摘要: Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which shows how much it's owner reached 阅读全文
posted @ 2017-08-02 10:32 小小超plus 阅读(220) 评论(0) 推荐(0)
摘要: Valery is a PE teacher at a school in Berland. Soon the students are going to take a test in long jumps, and Valery has lost his favorite ruler! Howev 阅读全文
posted @ 2017-08-02 10:31 小小超plus 阅读(147) 评论(0) 推荐(0)
摘要: Ray又对数字的列产生了兴趣: 现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。 Input每组数据占一行,代表四张卡片上的数字(0<=数字<=9),如果四张卡片都是0,则输入结束。 Output对每组卡片按从小到大的顺序输出所有能由这四张卡片组成的4位数,千 阅读全文
posted @ 2017-08-02 10:29 小小超plus 阅读(314) 评论(0) 推荐(0)
摘要: Now our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty Princess. But now the BEelzebu 阅读全文
posted @ 2017-08-02 10:28 小小超plus 阅读(185) 评论(0) 推荐(0)
摘要: 2 3 5 循环 第一份代码: 1 #include<stdio.h> 2 int main() 3 { 4 printf("The 1500'th ugly number is 859963392.\n"); 5 return 0; 6 } 第二份 1 #include <iostream> 2 阅读全文
posted @ 2017-08-02 10:27 小小超plus 阅读(134) 评论(0) 推荐(0)
摘要: 小刚在玩JSOI提供的一个称之为“建筑抢修”的电脑游戏:经过了一场激烈的战斗,T部落消灭了所有z部落的入侵者。但是T部落的基地里已经有N个建筑设施受到了严重的损伤,如果不尽快修复的话,这些建筑设施将会完全毁坏。现在的情况是:T部落基地里只有一个修理工人,虽然他能瞬间到达任何一个建筑,但是修复每个建筑 阅读全文
posted @ 2017-08-02 10:25 小小超plus 阅读(181) 评论(0) 推荐(0)
摘要: 某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人 阅读全文
posted @ 2017-08-02 10:21 小小超plus 阅读(426) 评论(0) 推荐(0)
摘要: 两个队列 一个队列放优先级,一个队列放优先级里的数,顺便用的了map 确定数在哪个优先级里 1 #include <iostream> 2 using namespace std; 3 #include<string.h> 4 #include<stdio.h> 5 #include<queue> 阅读全文
posted @ 2017-08-02 10:20 小小超plus 阅读(186) 评论(0) 推荐(0)
摘要: 栈的基本题型 前括号1进栈,后括号1出栈,有后括号那么他的前面必然是前括号。 1 #include <iostream> 2 3 using namespace std; 4 #include<stack> 5 #include<stdio.h> 6 #include<math.h> 7 #incl 阅读全文
posted @ 2017-08-02 10:11 小小超plus 阅读(237) 评论(0) 推荐(0)
摘要: This is a small but ancient game. You are supposed to write down the numbers 1, 2, 3, ... , 2n - 1, 2n consecutively in clockwise order on the ground 阅读全文
posted @ 2017-08-02 10:06 小小超plus 阅读(224) 评论(0) 推荐(0)