03 2015 档案

摘要:Description要求找出具有下列性质数的个数(包括输入的自然数n): 先输入一个自然数n( n #includeusing namespace std;int main(){ int n; int dp[1100]; scanf("%d",&n); dp[1] = 1;... 阅读全文
posted @ 2015-03-29 20:17 Painting、时光 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。 比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n #include#includeusing namespace s... 阅读全文
posted @ 2015-03-28 20:30 Painting、时光 阅读(194) 评论(0) 推荐(0) 编辑
摘要:Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,... 阅读全文
posted @ 2015-03-28 20:07 Painting、时光 阅读(186) 评论(0) 推荐(0) 编辑
摘要:Description大家一定看过地道战的电视吧。 话说小兵张嘎有一回也跑去支援地道战了。那是河北的一个小镇里,这个小镇比较复杂,什么样的人都有。所以张嘎不能走大街,只能在地道里走。但根据地质情况不同,所以同样长的街道,地道里要走的时间可能不一样。当然每条街道下面都有地道,而且在街道连接处地道也有连... 阅读全文
posted @ 2015-03-28 19:48 Painting、时光 阅读(425) 评论(0) 推荐(0) 编辑
摘要:Description每天,小明和他的马外出,然后他们一边跑一边玩耍。当他们结束的时候,必须带所有的马返回马棚,小明有K个马棚。他把他的马排成一排然后跟随他走向马棚。因为他们非常疲倦,小明不想让他的马做过多的移动。因此他想了一个办法:将马按照顺序放在马棚中,后面的马放的马棚的序号不会大于前面的马放... 阅读全文
posted @ 2015-03-28 18:40 Painting、时光 阅读(336) 评论(0) 推荐(0) 编辑
摘要:Description棋盘上A点有一个过河卒,需要走到目标B点。卒行走的规则:可以向下、或者向右。同时在棋盘上的任一点有一个对方的马(如C点),该马所在的点和所有跳跃一步可达的点称为对方马的控制点,如图中的C点和P1,……,P8,卒不能通过对方马的控制点。棋盘用坐标表示,A点(0,0)、B点(n, ... 阅读全文
posted @ 2015-03-28 16:47 Painting、时光 阅读(204) 评论(0) 推荐(0) 编辑
摘要:Description丁丁最近沉迷于一个数字游戏之中。这个游戏看似简单,但丁丁在研究了许多天之后却发觉原来在简单的规则下想要赢得这个游戏并不那么容易。游戏是这样的,在你面前有一圈整数(一共n个),你要按顺序将其分为m个部分,各部分内的数字相加,相加所得的m个结果对10取模后再相乘,最终得到一个数k。... 阅读全文
posted @ 2015-03-27 21:18 Painting、时光 阅读(379) 评论(0) 推荐(0) 编辑
摘要:DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he ex... 阅读全文
posted @ 2015-03-27 19:32 Painting、时光 阅读(139) 评论(0) 推荐(0) 编辑
摘要:DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given pos... 阅读全文
posted @ 2015-03-27 18:55 Painting、时光 阅读(160) 评论(0) 推荐(0) 编辑
摘要:Description《Shui Hu Zhuan》,also 《Water Margin》was written by Shi Nai'an -- an writer of Yuan and Ming dynasty. 《Shui Hu Zhuan》is one of the Four Great... 阅读全文
posted @ 2015-03-27 17:27 Painting、时光 阅读(154) 评论(0) 推荐(0) 编辑
摘要:You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or... 阅读全文
posted @ 2015-03-26 20:18 Painting、时光 阅读(137) 评论(0) 推荐(0) 编辑
摘要:DescriptionIn this problem your goal is to sort an array consisting ofnintegers in at mostnswaps. For the given array find the sequence of swaps that ... 阅读全文
posted @ 2015-03-26 20:11 Painting、时光 阅读(171) 评论(0) 推荐(0) 编辑
摘要:DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping ... 阅读全文
posted @ 2015-03-26 18:15 Painting、时光 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Description给你n个整数,请按从大到小的顺序输出其中前m大的数。Input每组测试数据有两行,第一行有两个数n,m(0#includeusing namespace std;const int MAX = 1000015;const int N = 510000;int w[MAX],a[... 阅读全文
posted @ 2015-03-26 18:02 Painting、时光 阅读(189) 评论(0) 推荐(0) 编辑
摘要:DescriptionAmr loves Geometry. One day he came up with a very interesting problem.Amr has a circle of radiusrand center in point(x, y). He wants the c... 阅读全文
posted @ 2015-03-26 17:33 Painting、时光 阅读(126) 评论(0) 推荐(0) 编辑
摘要:DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write... 阅读全文
posted @ 2015-03-26 14:50 Painting、时光 阅读(165) 评论(0) 推荐(0) 编辑
摘要:DescriptionIt is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letter... 阅读全文
posted @ 2015-03-26 13:55 Painting、时光 阅读(142) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standa... 阅读全文
posted @ 2015-03-25 17:14 Painting、时光 阅读(112) 评论(0) 推荐(0) 编辑
摘要:DescriptionA numeric sequence ofaiis ordered ifa1#include#includeusing namespace std;const int MAX = 11000;int a[MAX],b[MAX];int main(){ int n; ... 阅读全文
posted @ 2015-03-25 16:32 Painting、时光 阅读(136) 评论(0) 推荐(0) 编辑
摘要:DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pearl... 阅读全文
posted @ 2015-03-25 16:10 Painting、时光 阅读(113) 评论(0) 推荐(0) 编辑
摘要:DescriptionIn the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of th... 阅读全文
posted @ 2015-03-25 15:25 Painting、时光 阅读(116) 评论(0) 推荐(0) 编辑
摘要:DescriptionFew know that the cows have their own dictionary withW(1 ≤W≤ 600) words, each containing no more 25 of the characters 'a'..'z'. Their cowmu... 阅读全文
posted @ 2015-03-24 20:27 Painting、时光 阅读(104) 评论(0) 推荐(0) 编辑
摘要:Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空... 阅读全文
posted @ 2015-03-24 18:58 Painting、时光 阅读(181) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionAfter enjoying the movie,LeLe went home alone. LeLe decided to build blocks. LeLe has already builtnpiles. He wants to move some bl... 阅读全文
posted @ 2015-03-24 18:24 Painting、时光 阅读(176) 评论(0) 推荐(0) 编辑
摘要:Problem Description现在有一些被简单压缩的字符串,例如:a[120]代表120个a。对于字符串acb[3]d[5]e相对于acbbbddddde现在给你两个字符串cString, nString.一个是被压缩过的字符串,另一个没有被压缩。求nString是否为cString的子串,... 阅读全文
posted @ 2015-03-24 16:18 Painting、时光 阅读(155) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to... 阅读全文
posted @ 2015-03-24 14:37 Painting、时光 阅读(121) 评论(0) 推荐(0) 编辑
摘要:DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks... 阅读全文
posted @ 2015-03-23 10:33 Painting、时光 阅读(164) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=3126大意:从一个素数到另一个素数,每次只能改变一个数,要求每次改变后的数都是素数,要求算出转换的最小次数,简单BFS,不过注意d要还原/************************************************* Auth... 阅读全文
posted @ 2015-03-22 16:06 Painting、时光 阅读(153) 评论(0) 推荐(0) 编辑
摘要:DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 a... 阅读全文
posted @ 2015-03-21 20:01 Painting、时光 阅读(103) 评论(0) 推荐(0) 编辑
摘要:Prim:复杂度:O(n^2)用途:最小生成树算法,求一点到所有的位置之和的最小值,不是形成环,是把所有顶点连在一起的最短路适用条件:步骤:跟Dijkstra出奇的相似,只是prim把d和p都变成一个k数组(- -其实一样好吗)而且Dijkstra是第一个for为了记录下标,而prim是为了记录下标... 阅读全文
posted @ 2015-03-20 20:31 Painting、时光 阅读(174) 评论(0) 推荐(0) 编辑
摘要:Dijkstra:复杂度:O(n^2)用途:求起点到终点的最短路径,不需要吧每个点走到适用条件:原理:利用邻接矩阵,用d数组记录最小值,用p标记是否用过这组数据。步骤:一大for,两小for,第一个小for用来的出当前的d中的最小值,为了得到下标,第二个小for用来更新map最小值,得出结果,循环整... 阅读全文
posted @ 2015-03-20 20:07 Painting、时光 阅读(183) 评论(0) 推荐(0) 编辑
摘要:Floyed:复杂度:O(n^3)用途:求一条路走完所有的地方的的最小值,很简单,就三个for,一般写floyed不谢bellman_ford~~~适用条件:遍历所有的点,适合于稠密图,floyed与bellman_ford算法之间的区别就是floyed计算了从每一点开始的值,最后只要选取就行,方便... 阅读全文
posted @ 2015-03-20 19:49 Painting、时光 阅读(222) 评论(0) 推荐(0) 编辑
摘要:bin神----->传送门<-------unsigned int 0~4294967295 int 2147483648~2147483647 ——10^9unsigned long 0~4294967295long 2147483648~2147483647long long的最大值:92... 阅读全文
posted @ 2015-03-20 19:18 Painting、时光 阅读(162) 评论(0) 推荐(0) 编辑
摘要:快排:适用条件:方便...只要数字不是很多复杂度:O(nlogn) 每一层n复杂度,共logn层原理:利用一个随机数与最后面一个数交换,那么这个随机数就到了最后一位,然后循环,如果前面的数大于最后一个数,那么把这个数放到前面去,经过一次排序之后,前面的数都是大于最后一个的,然后对1到k和k+1到n进... 阅读全文
posted @ 2015-03-20 19:11 Painting、时光 阅读(384) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionNowadays we use content of PM2.5 to discribe the quality of air. The lower content of PM2.5 one city have, the better quality of ai... 阅读全文
posted @ 2015-03-19 13:13 Painting、时光 阅读(135) 评论(0) 推荐(0) 编辑
摘要:There arenImperial stormtroopers on the field. The battle field is a plane with Cartesian coordinate system. Each stormtrooper is associated with his ... 阅读全文
posted @ 2015-03-19 13:01 Painting、时光 阅读(119) 评论(0) 推荐(0) 编辑
摘要:Drazil has many friends. Some of them are happy and some of them are unhappy. Drazil wants to make all his friends become happy. So he invented the fo... 阅读全文
posted @ 2015-03-19 13:00 Painting、时光 阅读(147) 评论(0) 推荐(0) 编辑
摘要:Drazil is playing a math game with Varda.Let's definefor positive integerxas a product of factorials of its digits. For example,.First, they choose a ... 阅读全文
posted @ 2015-03-19 13:00 Painting、时光 阅读(172) 评论(0) 推荐(0) 编辑
摘要:Someday, Drazil wanted to go on date with Varda. Drazil and Varda live on Cartesian plane. Drazil's home is located in point(0, 0)and Varda's home is ... 阅读全文
posted @ 2015-03-19 12:59 Painting、时光 阅读(220) 评论(0) 推荐(0) 编辑
摘要:Anya has bought a new smartphone that usesBerdroidoperating system. The smartphone menu has exactlynapplications, each application has its own icon. T... 阅读全文
posted @ 2015-03-19 12:56 Painting、时光 阅读(162) 评论(0) 推荐(0) 编辑
摘要:Little Tanya decided to present her dad a postcard on his Birthday. She has already created a message — stringsof lengthn, consisting of uppercase and... 阅读全文
posted @ 2015-03-19 12:54 Painting、时光 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his homework on time and passes... 阅读全文
posted @ 2015-03-19 12:51 Painting、时光 阅读(167) 评论(0) 推荐(0) 编辑
摘要:A and B are preparing themselves for programming contests.An important part of preparing for a competition is sharing programming knowledge from the e... 阅读全文
posted @ 2015-03-19 12:48 Painting、时光 阅读(113) 评论(0) 推荐(0) 编辑
摘要:A and B are preparing themselves for programming contests.B loves to debug his code. But before he runs the solution and starts debugging, he has to f... 阅读全文
posted @ 2015-03-19 12:27 Painting、时光 阅读(110) 评论(0) 推荐(0) 编辑
摘要:A and B are preparing themselves for programming contests.To train their logical thinking and solve problems better, A and B decided to play chess. Du... 阅读全文
posted @ 2015-03-19 12:25 Painting、时光 阅读(112) 评论(0) 推荐(0) 编辑
摘要:Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. A... 阅读全文
posted @ 2015-03-19 12:23 Painting、时光 阅读(89) 评论(0) 推荐(0) 编辑
摘要:A word or a sentence in some language is called apangramif all the characters of the alphabet of this language appear in itat least once. Pangrams are... 阅读全文
posted @ 2015-03-19 12:19 Painting、时光 阅读(259) 评论(0) 推荐(0) 编辑
摘要:#include#includeusing namespace std;int main(){ long long begin,end,mid,k; long long n,m; begin = 1;end = 100000000; scanf("%d%d",&n,&m)... 阅读全文
posted @ 2015-03-19 12:07 Painting、时光 阅读(140) 评论(0) 推荐(0) 编辑
摘要:Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of... 阅读全文
posted @ 2015-03-19 11:02 Painting、时光 阅读(330) 评论(0) 推荐(0) 编辑
摘要:One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangularamm × bmm sheet of paper (a > b). Usually the f... 阅读全文
posted @ 2015-03-18 13:24 Painting、时光 阅读(221) 评论(0) 推荐(0) 编辑
摘要:Description众所周知,我是好人!所以不会出太难的题,题意很简单 给你两个数n和m,问你有多少对正整数对最大公约数是n,最小公倍数是m最后友情提供解题代码(我真是太好人了)void solve(){ long long n, m; scanf("%lld%lld", &n, &m); int... 阅读全文
posted @ 2015-03-18 10:41 Painting、时光 阅读(192) 评论(0) 推荐(0) 编辑
摘要:Description有一天Stubird买了一台变形金刚,店员说,这台变形金刚和其他那种骗小孩子的不一样 他真的能变形。 这台变形金刚有n个部件,他们能互相连接,组成机器人,当然,也可以变形。 但是有一天,The tesseract 的能量突然消失了,部件散落一地,当然有些部件还连接着。 现在你只... 阅读全文
posted @ 2015-03-17 20:25 Painting、时光 阅读(159) 评论(0) 推荐(0) 编辑
摘要:Description一个游戏,在屏幕上有5个格子形成一行,每一秒都会有一个格子闪烁,格子闪烁时你需要保证至少有一只手指在格子上面, 现在我们已经知道第i秒时,第xi个格子会闪烁,我们假设手指的移动不花费时间,你现在用两根手指玩这个游戏, 设初始两根手指都在0处位置,算出n秒过后手指需要移动的最小距... 阅读全文
posted @ 2015-03-17 19:46 Painting、时光 阅读(181) 评论(0) 推荐(0) 编辑
摘要:Description广工的slamdunk可谓是人生赢家,据传说他现在即将拥有一个girlfriend,并且在感情的驱使下他甚至开始学起了做菜! 现在他想为girlfriend做N道菜,每道菜做出来需要Ai分钟,slamdunk一分钟最多能煮M道菜,请问他做完这N道菜所需的最短时间 是多少?(如果... 阅读全文
posted @ 2015-03-17 19:37 Painting、时光 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Description爱美之心人皆有之,GG也不例外。所以GG他对于完美串有一种热衷的爱。在GG眼中完美串是一个具有无比魅力的01子串。这个子串有之其魅力之处,对它取反后水平翻转,它又和它原来的一模一样。这就是GG热爱它的原因。但是世上并不是所有的01串都是完美串,所以GG下定决心想改造01串,使所... 阅读全文
posted @ 2015-03-17 19:04 Painting、时光 阅读(262) 评论(0) 推荐(0) 编辑
摘要:述有N堆石子排成一排,每堆石子有一定的数量。现要将N堆石子并成为一堆。合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费的代价为这两堆石子的和,经过N-1次合并后成为一堆。求出总的代价最小值。输入有多组测试数据,输入到文件结束。每组测试数据第一行有一个整数n,表示有n堆石子。接下来的一行有n(... 阅读全文
posted @ 2015-03-17 18:28 Painting、时光 阅读(300) 评论(0) 推荐(0) 编辑
摘要:Description小学的时候,Stubird非常喜欢玩游戏王,有一天,他发现了一个绝佳的连锁组合,这个连锁组合需要6张卡, 可是他一张都没有,但是他的那些朋友们有,不过当然,他们不会白给,不过也不排除有人和他交情好,送给他了。 不过他们有成全别人的美德,当他们看到Stubird已经有某些他们喜欢... 阅读全文
posted @ 2015-03-17 15:58 Painting、时光 阅读(197) 评论(0) 推荐(0) 编辑
摘要:DescriptionBMan和hyx住在一个神奇的国度,这个国度有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来。 现在BMan在第S号城市,他经常想起那个一起AC过的队友hyx,记忆它总是慢慢的累积,在他心中无法抹去,可是他并不知道hyx 在哪个城市,所以他决定用尽半年的积蓄漂洋过海... 阅读全文
posted @ 2015-03-17 15:56 Painting、时光 阅读(220) 评论(0) 推荐(0) 编辑
摘要:Description2015年广东工业大学ACM校赛要来~\(≧▽≦)/~辣辣辣,作为校赛的出题人之一,GG想出了一道水题来考考大家。相信小伙伴们都学过字符串匹配,于是字符串匹配的水题就诞生辣!GG给出了一段长度为N的大写字母序列,现在他要你修改这一段字母序列,使得这段字母序列上最前面的K个字母组... 阅读全文
posted @ 2015-03-17 15:30 Painting、时光 阅读(227) 评论(0) 推荐(0) 编辑
摘要:Description假如没有阿拉伯数字,我们要怎么表示数字呢小明想了一个方法如下:1 -> A2 -> B3 -> C....25 -> Y26 -> Z27 -> AA28 -> AB....现在请你写一个程序完成这个转换Input输入的第一个数为一个正整数T,表明接下来有T组数据。每组数据为一... 阅读全文
posted @ 2015-03-17 14:43 Painting、时光 阅读(150) 评论(0) 推荐(0) 编辑
摘要:DescriptionValera loves his garden, wherenfruit trees grow.This year he will enjoy a great harvest! On thei-th treebifruit grow, they will ripen on a ... 阅读全文
posted @ 2015-03-17 13:25 Painting、时光 阅读(173) 评论(0) 推荐(0) 编辑
摘要:DescriptionYou've got arraya[1], a[2], ..., a[n], consisting ofnintegers. Count the number of ways to split all the elements of the array into three c... 阅读全文
posted @ 2015-03-17 13:23 Painting、时光 阅读(335) 评论(0) 推荐(0) 编辑
摘要:问题描述作为史上最强的刷子之一,zhx的老师让他给学弟(mei)们出n道题。zhx认为第i道题的难度就是i。他想要让这些题目排列起来很漂亮。zhx认为一个漂亮的序列{ai}下列两个条件均需满足。1:a1..ai是单调递减或者单调递增的。2:ai..an是单调递减或者单调递增的。他想你告诉他有多少种排... 阅读全文
posted @ 2015-03-15 19:13 Painting、时光 阅读(195) 评论(0) 推荐(0) 编辑
摘要:DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a pointN(0 ≤N≤ 100,000) on... 阅读全文
posted @ 2015-03-15 17:42 Painting、时光 阅读(161) 评论(0) 推荐(0) 编辑
摘要:问题描述作为史上最强的刷子之一,zhx在各大oj上交了很多份代码,而且多数都AC了。有一天,zhx想数一数他在n个oj上一共交了多少份代码。他现在已经统计出在第i个oj上,他交了ai份代码。而把它们加起来就是你的工作了。当然zhx是一个不走寻常路的人,所以他的数字都是用B进制表示的。而他也要求你告诉... 阅读全文
posted @ 2015-03-15 12:55 Painting、时光 阅读(168) 评论(0) 推荐(0) 编辑
摘要:#include#include#includeusing namespace std;struct edge{ int d; int num;}a[3500];bool cmp(edge i,edge j){ return i.d =0 && i - a[j].d <= 1){ ... 阅读全文
posted @ 2015-03-14 21:22 Painting、时光 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Description小明的工作是负责记录饭堂中正在排队的人的信息在他的工作中会有三种可能的事件发生: 1.编号为id的学生加入到队伍的最后面 2.排在最前面的学生打完饭离开了队伍 3.老板过来询问当前排在队伍前方第k个的学生的编号由于每天的工作量太大(每天最多有100000个以上事件发生),小明苦... 阅读全文
posted @ 2015-03-14 20:38 Painting、时光 阅读(154) 评论(0) 推荐(0) 编辑
摘要:Description话说春节那天,小明和晓明在实验室刷题。刷着刷着小明觉得累了,就邀请晓明一起看春晚。晓明觉得小明很无聊,不想理小明,但是小明很会磨嘴皮子,晓明耐不住小明的胡嘴蛮缠,于是和小明一起看起春晚来。小明顿时觉得倍儿爽啊! 可是一看,“wocao”,“最炫小苹果”,小明顿时觉得很伤心。 “... 阅读全文
posted @ 2015-03-14 20:29 Painting、时光 阅读(192) 评论(0) 推荐(0) 编辑
摘要:DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround th... 阅读全文
posted @ 2015-03-13 21:13 Painting、时光 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Descriptionjosephus问题其实就是一个游戏,一群小孩围成一个圈,设置一个数,这个数是个小于小孩总数大于0的一个整数,从第一个小孩开始报数,当其中一个小孩报到你设置的那个数的时候离开那个圈,这样一来反复报下去,直到只剩下最后一个小孩的时候那个小孩就是胜利者。现在的问题是设n个人围坐在一... 阅读全文
posted @ 2015-03-12 14:00 Painting、时光 阅读(461) 评论(0) 推荐(0) 编辑
摘要:#include#include#includeusing namespace std;typedef struct link{ int num; struct link *next;}IA;IA *Create();IA *Insert (IA *head, IA *p);void P... 阅读全文
posted @ 2015-03-11 20:07 Painting、时光 阅读(139) 评论(0) 推荐(0) 编辑
摘要:DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year ... 阅读全文
posted @ 2015-03-10 20:18 Painting、时光 阅读(150) 评论(0) 推荐(0) 编辑
摘要:DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵... 阅读全文
posted @ 2015-03-10 19:58 Painting、时光 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A... 阅读全文
posted @ 2015-03-08 20:08 Painting、时光 阅读(229) 评论(0) 推荐(0) 编辑
摘要:Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包... 阅读全文
posted @ 2015-03-08 19:22 Painting、时光 阅读(148) 评论(0) 推荐(0) 编辑
摘要:相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,... 阅读全文
posted @ 2015-03-08 19:11 Painting、时光 阅读(240) 评论(0) 推荐(0) 编辑
摘要:Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若干测试用例。每个测... 阅读全文
posted @ 2015-03-08 19:01 Painting、时光 阅读(273) 评论(0) 推荐(0) 编辑
摘要:Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个... 阅读全文
posted @ 2015-03-08 18:52 Painting、时光 阅读(185) 评论(0) 推荐(0) 编辑
摘要:Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的... 阅读全文
posted @ 2015-03-08 18:09 Painting、时光 阅读(193) 评论(0) 推荐(0) 编辑
摘要:DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 ... 阅读全文
posted @ 2015-03-08 16:11 Painting、时光 阅读(178) 评论(0) 推荐(0) 编辑
摘要:A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a ... 阅读全文
posted @ 2015-03-08 16:10 Painting、时光 阅读(172) 评论(0) 推荐(0) 编辑
摘要:DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. H... 阅读全文
posted @ 2015-03-08 15:28 Painting、时光 阅读(139) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. T... 阅读全文
posted @ 2015-03-08 15:11 Painting、时光 阅读(147) 评论(0) 推荐(0) 编辑
摘要:DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bric... 阅读全文
posted @ 2015-03-08 14:31 Painting、时光 阅读(150) 评论(0) 推荐(0) 编辑
摘要:DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockb... 阅读全文
posted @ 2015-03-08 10:47 Painting、时光 阅读(465) 评论(0) 推荐(0) 编辑
摘要:DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visi... 阅读全文
posted @ 2015-03-07 14:17 Painting、时光 阅读(239) 评论(0) 推荐(0) 编辑
摘要:Description2008年将到,王飞同学化了九牛二虎之力搞到了2张2008年奥运会足球赛决赛的门票。真是开心啊!他爸爸准备开车跟他一起去北京看球赛。不过门票费好贵啊,所以他爸爸说了,这个钱要在下学期的生活费里扣(好抠门),不过如果他能让从杭州去北京的油费最省(油价最近涨的好厉害啊),那么就不扣... 阅读全文
posted @ 2015-03-07 13:06 Painting、时光 阅读(332) 评论(0) 推荐(0) 编辑
摘要:Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,... 阅读全文
posted @ 2015-03-06 20:44 Painting、时光 阅读(157) 评论(0) 推荐(0) 编辑
摘要:DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same cu... 阅读全文
posted @ 2015-03-06 15:29 Painting、时光 阅读(145) 评论(0) 推荐(0) 编辑
摘要:DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...S... 阅读全文
posted @ 2015-03-06 10:53 Painting、时光 阅读(179) 评论(0) 推荐(0) 编辑
摘要:DescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-w... 阅读全文
posted @ 2015-03-05 20:38 Painting、时光 阅读(214) 评论(0) 推荐(0) 编辑
摘要:DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and perfo... 阅读全文
posted @ 2015-03-05 19:44 Painting、时光 阅读(125) 评论(0) 推荐(0) 编辑
摘要:DescriptionIn a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destination... 阅读全文
posted @ 2015-03-04 21:27 Painting、时光 阅读(180) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . ... 阅读全文
posted @ 2015-03-04 19:49 Painting、时光 阅读(165) 评论(0) 推荐(0) 编辑
摘要:DescriptionLet S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an integer sequence P = p1 p2...pn ... 阅读全文
posted @ 2015-03-04 16:21 Painting、时光 阅读(113) 评论(0) 推荐(0) 编辑
摘要:跟小偷那道差不多,水~~~DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干... 阅读全文
posted @ 2015-03-04 15:40 Painting、时光 阅读(173) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very... 阅读全文
posted @ 2015-03-04 15:36 Painting、时光 阅读(303) 评论(0) 推荐(0) 编辑
摘要:DescriptionLike everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangular shapes are out of favor; new geometr... 阅读全文
posted @ 2015-03-04 15:01 Painting、时光 阅读(140) 评论(0) 推荐(0) 编辑
摘要:DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.It orders two arm... 阅读全文
posted @ 2015-03-04 14:54 Painting、时光 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Farmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space ... 阅读全文
posted @ 2015-03-04 14:10 Painting、时光 阅读(216) 评论(0) 推荐(0) 编辑
摘要:DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.All... 阅读全文
posted @ 2015-03-04 13:59 Painting、时光 阅读(182) 评论(0) 推荐(0) 编辑
摘要:DescriptionCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in ... 阅读全文
posted @ 2015-03-04 13:51 Painting、时光 阅读(157) 评论(0) 推荐(0) 编辑
摘要:DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating ... 阅读全文
posted @ 2015-03-04 13:49 Painting、时光 阅读(221) 评论(0) 推荐(0) 编辑
摘要:借用朋友的代码,感觉很正规,链接http://home.cnblogs.com/u/get-an-AC-everyday/DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest wher... 阅读全文
posted @ 2015-03-04 13:44 Painting、时光 阅读(121) 评论(0) 推荐(0) 编辑
摘要:DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and ... 阅读全文
posted @ 2015-03-04 13:36 Painting、时光 阅读(143) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示