摘要: DescriptionIt is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human genes and determining their functions, because these can be used to diagnose h 阅读全文
posted @ 2012-03-16 21:02 'wind 阅读(302) 评论(0) 推荐(0)
摘要: Problem Description有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b。若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c。Input第一行输入一个n,表示有n组测试数据,接下来的n行,每行输入两个正整数a,b。Output输出对应的c,每组测试数据占一行。Sample Input26 212 4Sample Output4code:View Code #include<stdio.h> int gcd( int x ,int y) { if(y==0) return x; retu... 阅读全文
posted @ 2012-03-16 17:18 'wind 阅读(154) 评论(0) 推荐(0)
摘要: Problem DescriptionEddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如果他有2N张牌,编号为1,2,3..n,n+1,..2n。这也是最初的牌的顺序。通过一次洗牌可以把牌的序列变为n+1,1,n+2,2,n+3,3,n+4,4..2n,n。那么可以证明,对于任意自然数N,都可以在经过M次洗牌后第一次重新得到初始的顺序。编程对于小于100000的自然数N,求出M的值。Input每行一个整数NOutput输出与之对应的MSample Input201Sample Output202洗牌问题:定理1:当第一张牌(牌1)回到初始位置时,所 阅读全文
posted @ 2012-03-16 17:16 'wind 阅读(554) 评论(0) 推荐(0)
摘要: DescriptionPythagorean Theorem is "humanity's greatest scientific discoveries of the ten" is a basic elementary geometry theorems."This theorem has a very long history, almost all ancient civilizations (Greece, China, Egypt, Babylon, India, etc.) have studied this theorem. Pythago 阅读全文
posted @ 2012-03-16 17:13 'wind 阅读(449) 评论(0) 推荐(0)
摘要: Problem Description反素数就是满足对于任意i(0<i<x),都有g(i)<g(x),(g(x)是x的因子个数),则x为一个反素数。现在给你一个整数区间[a,b],请你求出该区间的x使g(x)最大。Input第一行输入n,接下来n行测试数据输入包括a,b, 1<=a<=b<=5000,表示闭区间[a,b].Output输出为一个整数,为该区间因子最多的数.如果满足条件有多个,则输出其中最小的数.Sample Input32 31 1047 359Sample Output26240分析:打表。code:View Code #include&l 阅读全文
posted @ 2012-03-16 17:12 'wind 阅读(484) 评论(0) 推荐(0)
摘要: Problem Description一日,话说0068与***泛舟湖上。忽见岸边出现他的一大敌人elnil。0068当然不想落入elnil的魔爪,于是他就得想办法逃脱。这个湖是一个很规则的圆形,半径为R。此时0068正好在圆心位置。小船在湖中的速度为 V1,0068和elnil在岸上的速度都为V2。也就是说,如果0068在刚上岸的时候没被抓到,则他可逃脱。在任意时刻,0068和elnil都可以朝任何方向移动,但是0068不能一直呆上船上(会饿死的),elnil不能下水(他不会游泳)。假设0068和elnil都非常聪明,总能做对自己最有利的事情,而且两个人的体力都是无限的。请问,0068最终能 阅读全文
posted @ 2012-03-16 17:11 'wind 阅读(157) 评论(0) 推荐(0)
摘要: Description给出N个数(保证N为偶数),其中有且只有两个不同的数字出现了奇数次。请你找出他们来。Input对于每组测试数据:第一行,给出数字N,表示下一行输入N个数字,其中N为偶数(2<=N<=100000)第二行,有N个数字(每个数字保证可以使用INT表示)处理到文件结束Output对于每组测试数据:第一行,输出找到的两个数字,由小到大。Sample Input41 2 3 3Sample Output1 2分析: 第一次读入得到a^b; 第二次读入时根据a^b为1的位来把数据分为该位为1和0的两组,然后再分别异或得到a,b;code:View Code #includ 阅读全文
posted @ 2012-03-16 17:10 'wind 阅读(159) 评论(0) 推荐(0)
摘要: Problem DescriptionDilworth is the world’s most prominent collector of Russian nested dolls: he literally has thousands of them! You know, the wooden hollow dolls of different sizes of which the smallest doll is contained in the second smallest, and this doll is in turn contained in the next one and 阅读全文
posted @ 2012-03-16 17:08 'wind 阅读(201) 评论(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 in the sea side. And any radar installation, locating on the coasting, can only cover d distance, so an island in the sea can be covered by a radius i 阅读全文
posted @ 2012-03-16 17:07 'wind 阅读(157) 评论(0) 推荐(0)
摘要: Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%...”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,以及王小丫的《开心辞典》等等,假设你已经知道了所有你喜欢看的电视节目的转播时间表,你会合理安排吗?(目标是能看尽量多的完整节目)Input输入数据包含多个测试实例,每个测试实例的第一行只有一个整数n(n<=100 阅读全文
posted @ 2012-03-16 17:06 'wind 阅读(425) 评论(0) 推荐(0)
摘要: Problem DescriptionHere is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.""Both of Tian and the king have three horses in different classes, namely, regula 阅读全文
posted @ 2012-03-16 17:05 'wind 阅读(247) 评论(0) 推荐(0)
摘要: Description前段时间,某省发生干旱,B山区的居民缺乏生活用水,现在需要从A城市修一条通往B山区的路。假设有A城市通往B山区的路由m条连续的路段组成,现在将这m条路段承包给n个工程队(n≤m≤ 300)。为了修路的便利,每个工程队只能分配到连续的若干条路段(当然也可能只分配到一条路段或未分配到路段)。假设每个工程队修路的效率一样,即每修长度为1的路段所需的时间为1。现在给出路段的数量m,工程队的数量n,以及m条路段的长度(这m条路段的长度是按照从A城市往B山区的方向依次给出,每条路段的长度均小于1000),需要你计算出修完整条路所需的最短的时间(即耗时最长的工程队所用的时间)。Inpu 阅读全文
posted @ 2012-03-16 17:04 'wind 阅读(214) 评论(0) 推荐(0)
摘要: Description现在有x个同样的球,和y个同样的杯子,现在要把这x个球全部放到y个杯子里,请问有多少种不同放法?杯子顺序没有区分,所以1,1,2和2,1,1算作一种放法Input每组输入两个整数x,y(0 <x,y< 20)处理到文件结束Output每组测试数据用一行输出所有的种类数Sample Input7 3Sample Output8code:View Code #include<stdio.h>int d(int m,int n){ if(m==0||n==1) return 1; if(m<n) return d(m,m); else return 阅读全文
posted @ 2012-03-16 17:03 'wind 阅读(183) 评论(0) 推荐(0)
摘要: Problem DescriptionEddy是个ACMer,他不仅喜欢做ACM题,而且对于Ranklist中每个人的ac数量也有一定的研究,他在无聊时经常在纸上把Ranklist上每个人的ac题目的数量摘录下来,然后从中选择一部分人(或者全部)按照ac的数量分成两组进行比较,他想使第一组中的最小ac数大于第二组中的最大ac数,但是这样的情况会有很多,聪明的你知道这样的情况有多少种吗?特别说明:为了问题的简化,我们这里假设摘录下的人数为n人,而且每个人ac的数量不会相等,最后结果在64位整数范围内.Input输入包含多组数据,每组包含一个整数n,表示从Ranklist上摘录的总人数。Outpu 阅读全文
posted @ 2012-03-16 17:02 'wind 阅读(370) 评论(0) 推荐(0)
摘要: Problem DescriptionAunt Lizzie takes half a pill of a certain medicine every day. She starts with a bottle that contains N pills.On the first day, she removes a random pill, breaks it in two halves, takes one half and puts the other half back into the bottle.On subsequent days, she removes a random 阅读全文
posted @ 2012-03-16 17:02 'wind 阅读(292) 评论(0) 推荐(0)
摘要: Problem Description大家都知道,pfz是“成电杰出学生”,在成电杰出学生的颁奖典礼上,lxh和pfz都没有听台上在说什么,而是在下面讨论当晚的美式足球比赛,lxh预测说纽约巨人队今晚将会得到11分,pfz马上说不可能。因为通常来说美式足球比赛的得分只有3分和7分两种形式,无论怎么得分都不可能得到11分。想了一会以后,lxh发现其实11分以上的分数都是可以得到,于是11就是最大的不可以得到的分数。现在问题来了,如果比赛的得分只有x分和y分两种形式,那么最大的不可以得到的分数是多少呢?Input本题包括多组输入每组输入2个整数x, y(2<=x, y<=10^8),x 阅读全文
posted @ 2012-03-16 17:01 'wind 阅读(229) 评论(0) 推荐(0)
摘要: Problem Description在一无限大的二维平面中,我们做如下假设:1、每次只能移动一格;2、不能向后走(假设你的目的地是“向上”,那么你可以向左走,可以向右走,也可以向上走,但是不可以向下走);3、走过的格子立即塌陷无法再走第二次;求走n步不同的方案数(2种走法只要有一步不一样,即被认为是不同的方案)。Input首先给出一个正整数C,表示有C组测试数据接下来的C行,每行包含一个整数n (n<=20),表示要走n步。Output请编程输出走n步的不同方案总数;每组的输出占一行。Sample Input212Sample Output37分析: 递推式:a[i]=2*a[i-1] 阅读全文
posted @ 2012-03-16 17:00 'wind 阅读(187) 评论(0) 推荐(0)
摘要: Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;......可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我们的野骆驼想都知道她们,可现在有N多人,他要猜的次数可就多了,为了不为难野骆驼,女生们只要求他答对一半或以上就算过关,请问有多少组答案能使他顺利过关。Input输入的数据里有多个case,每个 阅读全文
posted @ 2012-03-16 16:59 'wind 阅读(228) 评论(0) 推荐(0)
摘要: Problem Description小兔的叔叔从外面旅游回来给她带来了一个礼物,小兔高兴地跑回自己的房间,拆开一看是一个棋盘,小兔有所失望。不过没过几天发现了棋盘的好玩之处。从起点(0,0)走到终点(n,n)的最短路径数是C(2n,n),现在小兔又想如果不穿越对角线(但可接触对角线上的格点),这样的路径数有多少?小兔想了很长时间都没想出来,现在想请你帮助小兔解决这个问题,对于你来说应该不难吧!Input每次输入一个数n(1<=n<=35),当n等于-1时结束输入。Output对于每个输入数据输出路径数,具体格式看Sample。Sample Input1312-1Sample Ou 阅读全文
posted @ 2012-03-16 16:59 'wind 阅读(177) 评论(0) 推荐(0)
摘要: Problem Description由于长期缺乏运动,小黑发现自己的身材臃肿了许多,于是他想健身,更准确地说是减肥。小黑买来一块圆形的毯子,把它们分成三等分,分别标上A,B,C,称之为“跳舞毯”,他的运动方式是每次都从A开始跳,每次都可以任意跳到其他块,但最后必须跳回A,且不能原地跳.为达到减肥效果,小黑每天都会坚持跳n次,有天他突然想知道当他跳n次时共几种跳法,结果想了好几天没想出来-_-现在就请你帮帮他,算出总共有多少跳法。Input测试输入包含若干测试用例。每个测试用例占一行,表示n的值(1<=n<=1000)。当n为0时输入结束。Output每个测试用例的输出占一行,由于 阅读全文
posted @ 2012-03-16 16:58 'wind 阅读(766) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-03-16 16:50 'wind 阅读(7) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-03-16 16:08 'wind 阅读(9) 评论(0) 推荐(0)
摘要: 要求: 桌上有一叠牌,从上到下一次编号1~n当至少剩两张牌时进行以下操作: 扔掉第一张牌,把新的第一张放到最后,输出扔掉的牌编号和剩下的牌编号sample input:7sample output:1 3 5 7 4 2 6code:View Code #include<stdio.h> const int maxn=100; int queue[maxn]; int main() { int front,rear,i,n; while(scanf("%d",&n)!=EOF) ... 阅读全文
posted @ 2012-03-16 12:51 'wind 阅读(235) 评论(0) 推荐(0)
摘要: 要求: 输入输的深度和小球数,输出最后一个小球所在的叶子编号。code:View Code #include<stdio.h> #include<string.h> int s[1<<20]; int main() { int k,d,n,i,I; while(scanf("%d%d",&d,&I)!=EOF) { memset(s,0,sizeof(s)); n=(1<<d)-1; ... 阅读全文
posted @ 2012-03-16 12:50 'wind 阅读(227) 评论(0) 推荐(0)
摘要: DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.This is an example of one of her creations:D/ \/ \B E/ \ \/ \ \A C G//FTo record her trees for future gene... 阅读全文
posted @ 2012-03-16 12:49 'wind 阅读(183) 评论(0) 推荐(0)
摘要: DescriptionThere is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possible to establish only a surface track. Moreover, it turned out that the station could be only a d 阅读全文
posted @ 2012-03-16 12:48 'wind 阅读(222) 评论(0) 推荐(0)
摘要: Description用计算机随机生成了N个0到1000000000(包含0和1000000000)之间的随机整数(N≤5000000),对于其中重复的数字,只保留一个,把其余相同的数去掉。然后再把这些数从小到大排序。请你完成“去重”与“排序”的工作Input输入有2行,第1行为1个正整数,表示所生成的随机数的个数:N第2行有N个用空格隔开的正整数,为所产生的随机数。Output输出也是2行,第1行为1个正整数M,表示不相同的随机数的个数。第2行为M个用空格隔开的正整数,为从小到大排好序的不相同的随机数。Sample Input1020 40 32 67 40 20 89 300 400 15 阅读全文
posted @ 2012-03-16 12:47 'wind 阅读(395) 评论(0) 推荐(0)
摘要: DescriptionThere are six kinds of brackets: ‘(‘, ‘)’, ‘[‘, ‘]’, ‘{’, ‘}’. dccmx’s girl friend is now learning java programminglanguage, and got mad with brackets! Now give you a string of brackets. Is it valid? For example: “(([{}]))” is valid, but“([)]” is not.InputFirst line contains an integer T 阅读全文
posted @ 2012-03-16 12:45 'wind 阅读(217) 评论(0) 推荐(0)
摘要: DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer length Li (1 ≤ Li ≤ 50,000) units. He then purchases a single long board just long enough to saw into the N 阅读全文
posted @ 2012-03-16 12:40 'wind 阅读(174) 评论(0) 推荐(0)
摘要: Description In information theory, a low-density parity-check (LDPC) code is a linear error correcting code, a method of transmitting a message over a noisy transmission channel, and is constructed using a sparse bipartite graph. LDPC codes are capacity-approaching codes, which means that practical 阅读全文
posted @ 2012-03-16 12:39 'wind 阅读(316) 评论(0) 推荐(0)
摘要: Problem DescriptionIn this problem, we assume the positive integer with the following properties are called ‘the special number’:1) The special number is a non-negative integer without any leading zero.2) The numbers in every digit of the special number is unique ,in decimal system.Of course,it is e 阅读全文
posted @ 2012-03-16 12:36 'wind 阅读(569) 评论(0) 推荐(0)
摘要: DescriptionThe game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerator door. Every handle can be in one of two states: open or closed. The refrigerator is open only when all handles are open. The handl 阅读全文
posted @ 2012-03-16 12:35 'wind 阅读(179) 评论(0) 推荐(0)
摘要: Description"47 is the quintessential random number," states the 47 society. And there might be a grain of truth in that.For example, the first ten digits of the Euler's constant are:2 7 1 8 2 8 1 8 2 8And what's their sum? Of course, it is 47.You are given a sequence S of integers 阅读全文
posted @ 2012-03-16 12:32 'wind 阅读(551) 评论(0) 推荐(0)
摘要: DescriptionJiaoZhu likes going on adventure! One day, he walks into a big castle, and there is an unique stairway. JiaoZhu finds a board ,it says “The one who want to go upstairs only can go three steps the most once, meaning that you can go 1 or 2 or 3 steps once!”. Now, we have a problem, can you 阅读全文
posted @ 2012-03-16 07:38 'wind 阅读(214) 评论(0) 推荐(0)
摘要: Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。Output输出为N行,每行为对应的f(Pi)。Sample Input512345Sample Output11235分析:大数加法模拟。code:View Code #include<stdio.h>#include<string.h>int i;int b[1002][255];void ji 阅读全文
posted @ 2012-03-16 07:32 'wind 阅读(171) 评论(0) 推荐(0)
摘要: Problem DescriptionAs 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 orders that all the trains can get out of the railway.InputThe input contains several test cases. Each test cases consists of a numbe 阅读全文
posted @ 2012-03-16 07:28 'wind 阅读(164) 评论(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 explored taking various sums of those numbers.``This supercomputer is great,'' remarked Chip. ``I only wish Timothy were here to see these r 阅读全文
posted @ 2012-03-16 07:26 'wind 阅读(175) 评论(0) 推荐(0)
摘要: Description 《Neon Genesis Evangelion》(中文译名:新世纪福音战士,简称EVA)。《EVA》是表面上是一部机器人动画,但是在剧情的展开手法,内容的深度上,使得一经播出就在日本引发“社会现象”程度的回应。其中涉及大量宗家和哲学的内容,复杂的人物精神分析。让《EVA》超出简单动画作品的高度。成为日本动画史上无法超越的动画之一。 “MAGI System”出自《EVA》,是作品中Nerv组织所使用的大型中央电脑系统。MAGI一词源于圣经,似乎意为东方三贤人,由东方而来朝拜耶稣的三人。该系统由三台分别以东方三贤人命名的独立电脑MELCHIOR 1、BALTHASAR 阅读全文
posted @ 2012-03-16 07:25 'wind 阅读(346) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<string.h> const int maxn = 3000; int f[maxn]; int main() { int i,j,n; scanf("%d",&n); memset(f,0,sizeof(f)); f[0]=1; for(i=2;i<=n;i++) { //乘以i intc=0; for(j=0;j<m... 阅读全文
posted @ 2012-03-16 07:24 'wind 阅读(187) 评论(0) 推荐(0)
摘要: Problem Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。Input第一行是2个整数N和M(N <= 100, M <= 1000),代表景区的个数和道路的条数。接下来的M行里,每行包括3个整数a,b,c.代表a和b之间有一条通路,并且需要花费c元(c <= 100)。Outp 阅读全文
posted @ 2012-03-16 00:40 'wind 阅读(273) 评论(0) 推荐(0)
摘要: Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的放个假,可是也不能荒废了训练啊,所以草儿决定在要在最短的时间去一个自己想去的地方!因为草儿的家在一个小镇上,没有火车经过,所以她只能去邻近的城市坐火车(好可怜啊~)。I 阅读全文
posted @ 2012-03-16 00:39 'wind 阅读(156) 评论(0) 推荐(0)
摘要: Problem Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干场撕杀之后,确定是否已经实际上产生了冠军。Input输入含有一些选手群,每群选手都以一个整数n(n<1000)开头,后跟n对选手的比赛结果,比赛结果以一对选手名字(中间隔一空格)表示,前者战胜后者。如果n为0,则表 阅读全文
posted @ 2012-03-16 00:38 'wind 阅读(213) 评论(0) 推荐(0)
摘要: DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch are of the same color?InputInput is a sequence of lines, each line contains two words, sep 阅读全文
posted @ 2012-03-16 00:37 'wind 阅读(215) 评论(0) 推荐(0)
摘要: Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.Harry已经将他所会的所有咒语都列成了一个表,他想让你帮忙计算一下他是否能完成老师的作业,将一个B(ball)变成一个M(Mouse),你知道,如果他自己不能完成的话,他就只好向Hermione请教,并且被迫听一大堆好好学习的道理.Input测试数据有多组。每组有多行,每行一个单词,仅包括小写字母,是Harry所 阅读全文
posted @ 2012-03-16 00:36 'wind 阅读(144) 评论(0) 推荐(0)
摘要: Problem Description欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 < N < 1000 )和边数M;随后的M行对应M条边,每行给出一对正整数,分别是该条边直接连通的两个节点的编号(节点从1到N编号)。当N为0时输入结束。Output每个测试用例的输出占一行,若欧拉回路存在则输出1,否则输出0。Sample Input3 31 21 32 33 21 22 30Sample Output10总结:如果图是联 阅读全文
posted @ 2012-03-16 00:34 'wind 阅读(245) 评论(0) 推荐(0)
摘要: Problem DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very important for us.There is a large number of magnetic plates on every door. Every plat 阅读全文
posted @ 2012-03-16 00:34 'wind 阅读(300) 评论(0) 推荐(0)
摘要: Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛场所在地,M则表示在成都有几条路。N=M=0表示输入结束。接下来M行,每行包括3个整数A,B,C(1<=A,B<=N,1<=C<=1000),表示在 阅读全文
posted @ 2012-03-16 00:33 'wind 阅读(185) 评论(0) 推荐(0)
摘要: DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each type of a truck. The code is simply a string of exactly seven lowercase letters (each letter on each 阅读全文
posted @ 2012-03-16 00:31 'wind 阅读(159) 评论(0) 推荐(0)
摘要: Description东北的冬季,尤其是过年的时候,小陈老师喜欢去堆雪人。每个雪人主要由三个雪球构成:大雪球、中雪球、小雪球。他已经准备好了N个雪球,半径分别等于r1, r2, ..., rn。如果要堆一个雪人,就需要三个半径互不相等的雪球。例如:三个雪球的半径为1、2、3,能够用来堆一个雪人。但是半径为2、2、3或者2、2、2的三个雪球就不可以。快帮帮小陈老师,算算他最多能用这些雪球堆多少个雪人。Input对于每组测试数据:第1行,包含一个整数n(1≤n≤100000) — 雪球的数量。第2行,包含n个整数 — 雪球的半径r1, r2, ..., rn (1≤ri≤1000000000)。处 阅读全文
posted @ 2012-03-16 00:29 'wind 阅读(280) 评论(0) 推荐(0)