摘要:DescriptionDoctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number when the su...
阅读全文
摘要:DescriptionGiven an integer N, your task is to judge whether there exist N points in the plane such that satisfy the following conditions:1. The dista...
阅读全文
摘要:DescriptionThere are N points in total. Every point moves in certain direction and certain speed. We want to know at what time that the largest distan...
阅读全文
摘要:DescriptionThis is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algori...
阅读全文
摘要:Problem Description百小度最近在逛博客,然后发现了一个有趣的问题。如下图所示,是一个12位数014326951987, 它的数字先逐渐变大, 然后变小,再变大,接着变小,又变大,最后变小。我们就称,其共包含6个单调区间。现在问题来了:一个n位数平均包含多少个单调区间?单调区间的平均...
阅读全文
摘要:Problem Description小度熊喜欢恶作剧。今天他向来访者们提出一个恶俗的游戏。他和来访者们轮流往一个正多边形内放盘子。最后放盘子的是获胜者,会赢得失败者的一个吻。玩了两次以后,小度熊发现来访者们都知道游戏的必胜策略。现在小度熊永远是先手,他想知道他是否能获胜。注意盘子不能相交也不能和多...
阅读全文
摘要:Description Three wizards are doing a experiment. To avoid from bothering, a special magic is set around them. The magic forms a circle, which covers ...
阅读全文
摘要:Description Friend number are defined recursively as follows. (1) numbers 1 and 2 are friend number; (2) if a and b are friend numbers, so is ab...
阅读全文
摘要:Description Ray 在数学课上听老师说,任何小数都能表示成分数的形式,他开始了化了起来,很快他就完成了,但他又想到一个问题,如何把一个循环小数化成分数呢? 请你写一个程序不但可以将普通小数化成最简分数,也可以把循环小数化成最简分数。 Input ...
阅读全文
摘要:Description Ray又对数字的列产生了兴趣: 现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。 Input 每组数据占一行,代表四张卡片上的数字(0#include #include #include...
阅读全文
摘要:Problem Description近期B厂组织了一次大搬家,所有人都要按照指示换到指定的座位上。指示的内容是坐在位置i上的人要搬到位置j上。现在B厂有N个人,一对一到N个位置上。搬家之后也是一一对应的,改变的只有位次。在第一次搬家后,度度熊由于疏忽,又要求大家按照原指示进行了一次搬家。于是,机智...
阅读全文
摘要:Problem Description列变位法是古典密码算法中变位加密的一种方法,具体过程如下 将明文字符分割成个数固定的分组(如5个一组,5即为密钥),按一组一行的次序整齐排列,最后不足一组不放置任何字符,完成后按列读取即成密文。比如:原文:123456789密钥:4变换后的矩阵:12345678...
阅读全文
摘要:Problem Description当今世界,网络已经无处不在了,小度熊由于犯了错误,当上了度度公司的网络管理员,他手上有大量的 IP列表,小度熊想知道在某个固定的子网掩码下,有多少个网络地址。网络地址等于子网掩码与 IP 地址按位进行与运算后的结果,例如:子网掩码:A.B.C.DIP 地址:a....
阅读全文
摘要:DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the ...
阅读全文
摘要:DescriptionLet's consider one interesting word game. In this game you should transform one word into another through special operations.Let's say we h...
阅读全文
摘要:Description开学了,ACM队的边老板想在学校中请一些妹子一起做一项问卷调查,调查妹子们对ACM的了解情况,为了实验的客观性,他先用计算机生成了N个1到1000之间的随机整数(N≤100),对于其中重复的数字,只保留一个,把其余相同的数去掉,不同的数对应着不同的妹子的编号。然后再把这些数从小...
阅读全文
摘要:时间限制:2000ms单点时限:1000ms内存限制:256MB描述给你一个m x n (1 #include #include #include #include #include #include #include #include #include #include #define inf 0...
阅读全文
摘要:时间限制:5000ms单点时限:1000ms内存限制:256MB描述大家对斐波那契数列想必都很熟悉:a0 = 1, a1 = 1, ai = ai-1 + ai-2,(i > 1)。现在考虑如下生成的斐波那契数列:a0 = 1, ai = aj + ak, i > 0, j, k从[0, i-1]的...
阅读全文
摘要:DescriptionIn graph theory, a matching or independent edge set in a graph G = (V , E) is a set of edges ME such that no two edges in the matching M sh...
阅读全文
摘要:DescriptionPattern lock security is generally used in Android handsets instead of a password. The pattern lock can be set by joining points on a 3 × 3...
阅读全文
摘要:Description今天西工大举办了一场比赛总共有m+n人,但是有m人比较懒没带电脑,另外的n个人带了电脑。不幸的是,今天机房的电脑全坏了只能用带的电脑,一台电脑最多两人公用,确保n>=m。但是大家来的时间不同,随机次序来机房,带电脑的人直接准备比赛而没带电脑的人需要向带电脑并还没和别人公用的人求...
阅读全文
摘要:Description定义F(n,k) = 1^k +2^k +3^k …… +n^k。(1#include #include #include #include #include #include #include #include #include #define N 10007#define ...
阅读全文
摘要:Description这一天,小女警花花,泡泡和毛毛来到终极Boss"Him"所在的异世界并准备与其决一死战,却被困在了他的城堡里。她们发现异世界是一个巨大的城堡。城堡由一个个大小不同的房间组成,房间有着以下的规则:每个房间有且仅有一扇黄门,此外至多有一扇红门和一扇绿门:黄色代表通向更大的房间,绿色...
阅读全文
摘要:DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the ma...
阅读全文
摘要:DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 ...
阅读全文
摘要:DescriptionRecently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of th...
阅读全文
摘要:DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of par...
阅读全文
摘要:DescriptionEdward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a broken Caps Lock key, so Edward n...
阅读全文
摘要:DescriptionEdward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward...
阅读全文
摘要:DescriptionFor an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his universi...
阅读全文
摘要:Problem DescriptionAfter inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have ...
阅读全文
摘要:DescriptionHow many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, ...., sn} ? For example, we assume that S = {1, 2, 3}, an...
阅读全文