07 2013 档案

摘要:唉,可爱的小朋友Time Limit: 10000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 819Accepted Submission(s): 220Problem Description唉,小朋友是比较麻烦的。在一个幼儿园里,老师要上一节游戏课,有N个小朋友要玩游戏,做游戏时要用小皮球,但是幼儿园里只有M个小皮球,而且有些小朋友不喜欢和一些小朋友在一起玩,而只喜欢和另一些小朋友一起玩,比如傻妞只喜欢和傻瓜,傻根,傻蛋们一起玩,傻根又不喜欢和傻蛋一起玩,傻蛋喜欢和傻子 阅读全文
posted @ 2013-07-31 19:28 Jack Ge 阅读(784) 评论(0) 推荐(0) 编辑
摘要:Palindrome Sub-ArrayTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 751Accepted Submission(s): 366Problem Description A palindrome sequence is a sequence which is as same as its reversed order. For example, 1 2 3 2 1 is a palindrome sequence, but . 阅读全文
posted @ 2013-07-30 10:41 Jack Ge 阅读(315) 评论(0) 推荐(0) 编辑
摘要:Triangle LOVETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1707Accepted Submission(s): 729Problem DescriptionRecently, scientists find that there is love between any of two people. For example, between A and B, if A don’t love B, then B must love 阅读全文
posted @ 2013-07-30 09:18 Jack Ge 阅读(500) 评论(0) 推荐(0) 编辑
摘要:SequenceTime Limit:6000MSMemory Limit:65536KTotal Submissions:6120Accepted:1897DescriptionGiven m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear that we may get n ^ m this kind of sequences. Then we 阅读全文
posted @ 2013-07-29 16:38 Jack Ge 阅读(410) 评论(0) 推荐(0) 编辑
摘要:Fence RepairTime Limit:2000MSMemory Limit:65536KTotal Submissions:19660Accepted:6236DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer lengthLi(1 ≤Li≤ 50,000) uni 阅读全文
posted @ 2013-07-29 16:00 Jack Ge 阅读(332) 评论(0) 推荐(0) 编辑
摘要:StripiesTime Limit:1000MSMemory Limit:30000KTotal Submissions:10263Accepted:4971DescriptionOur chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English name to apply for an i 阅读全文
posted @ 2013-07-29 15:45 Jack Ge 阅读(1037) 评论(0) 推荐(0) 编辑
摘要:StonesTime Limit: 5000/3000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 662Accepted Submission(s): 391Problem DescriptionBecause of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a littl 阅读全文
posted @ 2013-07-29 15:30 Jack Ge 阅读(425) 评论(0) 推荐(0) 编辑
摘要:The order of a TreeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 835Accepted Submission(s): 453Problem DescriptionAs we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely:1.insert a key k to 阅读全文
posted @ 2013-07-29 14:40 Jack Ge 阅读(1202) 评论(0) 推荐(0) 编辑
摘要:Binary Tree TraversalsTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2442Accepted Submission(s): 1063Problem DescriptionA binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the 阅读全文
posted @ 2013-07-29 14:05 Jack Ge 阅读(3325) 评论(0) 推荐(0) 编辑
摘要:The kth great numberTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 5049Accepted Submission(s): 2069Problem DescriptionXiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao 阅读全文
posted @ 2013-07-28 17:02 Jack Ge 阅读(363) 评论(0) 推荐(0) 编辑
摘要:B. Eight Point Setshttp://codeforces.com/contest/334/problem/Btime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of th 阅读全文
posted @ 2013-07-28 11:34 Jack Ge 阅读(636) 评论(0) 推荐(0) 编辑
摘要:A. Candy Bagshttp://codeforces.com/problemset/problem/334/Atime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald hasnyounger brothers and their number happens to be even. One day he boughtn2candy bags. One bag has one candy, one bag has two candi 阅读全文
posted @ 2013-07-28 11:04 Jack Ge 阅读(436) 评论(0) 推荐(0) 编辑
摘要:汉诺塔IVTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2735Accepted Submission(s): 2085Problem Description还记得汉诺塔III吗?他的规则是这样的:不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到小盘的上面。xhd在想如果我们允许最大的盘子放到最上面会怎么样呢?(只允许最大的放在最上面)当然最后需要的结果是盘子从小到大排在最右边。Input输入 阅读全文
posted @ 2013-07-26 22:35 Jack Ge 阅读(1411) 评论(0) 推荐(0) 编辑
摘要:汉诺塔VITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1097Accepted Submission(s): 775Problem Descriptionn个盘子的汉诺塔问题的最少移动次数是2^n-1,即在移动过程中会产生2^n个系列。由于发生错移产生的系列就增加了,这种错误是放错了柱子,并不会把大盘放到小盘上,即各柱子从下往上的大小仍保持如下关系 :n=m+p+qa1>a2>...>amb1>b2>...&g 阅读全文
posted @ 2013-07-26 21:59 Jack Ge 阅读(1379) 评论(0) 推荐(0) 编辑
摘要:汉诺塔VTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1832Accepted Submission(s): 1095Problem Description用1,2,...,n表示n个盘子,称为1号盘,2号盘,...。号数大盘子就大。经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门 阅读全文
posted @ 2013-07-26 21:43 Jack Ge 阅读(1371) 评论(0) 推荐(0) 编辑
摘要:汉诺塔IIITime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7113Accepted Submission(s): 3120Problem Description约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动一个盘,且不允许大盘放在小盘的上面。现在我们改变游戏的玩法,不允许直接从最左(右)边移到最右(左) 阅读全文
posted @ 2013-07-26 21:31 Jack Ge 阅读(1685) 评论(0) 推荐(0) 编辑
摘要:汉诺塔IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3747Accepted Submission(s): 1862Problem Description经典的汉诺塔问题经常作为一个递归的经典例题存在。可能有人并不知道汉诺塔问题的典故。汉诺塔来源于印度传说的一个故事,上帝创造世界时作了三根金刚石柱子,在一根柱子上从下往上按大小顺序摞着64片黄金圆盘。上帝命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放 阅读全文
posted @ 2013-07-26 21:16 Jack Ge 阅读(4528) 评论(0) 推荐(1) 编辑
摘要:Sum It UpTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2982Accepted Submission(s): 1493Problem DescriptionGiven 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 阅读全文
posted @ 2013-07-25 11:22 Jack Ge 阅读(630) 评论(0) 推荐(0) 编辑
摘要:[1475] Bachelor http://acm.nbut.cn:8081/Problem/view.xhtml?id=1475时间限制: 1000 ms 内存限制: 65535 K问题描述炎热的暑期集训就要结束了,在这短短的20天,大家都很努力,因为很多都是光棍嘛。balabala所以 Marknoon 先森一直耿耿于怀,毕竟他也是单身嘛。有一天,Marknoon 先森看着一串数字,发现了那个跟他同命相连的数字1,所以他就开始无聊起来,想知道从数字1到数字N,一共出现了几个1。例如N=12,则1的个数为5,出现1的数字分别为1,10,11,12。输入输入一个数N(1... 阅读全文
posted @ 2013-07-25 07:31 Jack Ge 阅读(320) 评论(0) 推荐(0) 编辑
摘要:PartitionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 797Accepted Submission(s): 322Problem DescriptionDefine f(n) as the number of ways to perform n in format of the sum of some positive integers. For instance, when n=4, we have4=1+1+1+14=1+1+2 阅读全文
posted @ 2013-07-24 15:54 Jack Ge 阅读(789) 评论(0) 推荐(0) 编辑
摘要:Park VisitTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 523Accepted Submission(s): 236Problem DescriptionClaire and her little friend, ykwd, are travelling in Shevchenko's Park! The park is beautiful - but large, indeed. N feature spots in th 阅读全文
posted @ 2013-07-24 12:25 Jack Ge 阅读(1842) 评论(2) 推荐(0) 编辑
摘要:Borg MazeTime Limit:1000MSMemory Limit:65536KTotal Submissions:6804Accepted:2293DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Each Borg 阅读全文
posted @ 2013-07-17 23:07 Jack Ge 阅读(539) 评论(0) 推荐(0) 编辑
摘要:湫秋系列故事——安排座位Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 454Accepted Submission(s): 137Problem Description 为了给腾讯公司找到更多优秀的人才,HR湫秋最近去某高校组织了一次针对该校所有系的聚会,邀请了每个系的一些优秀学生来参加。 作为组织者,湫秋要安排他们的座位。这并不是一件很简单的事情,因为只有一排位置,并且位置总数恰好等于参加聚会的人数。为了促进交流,两个来自相同系的同.. 阅读全文
posted @ 2013-07-13 23:00 Jack Ge 阅读(1177) 评论(1) 推荐(0) 编辑
摘要:威威猫系列故事——打地鼠Time Limit: 300/100 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 755Accepted Submission(s): 416Problem Description 威威猫最近不务正业,每天沉迷于游戏“打地鼠”。 每当朋友们劝他别太着迷游戏,应该好好工作的时候,他总是说,我是威威猫,猫打老鼠就是我的工作! 无话可说... 我们知道,打地鼠是一款经典小游戏,规则很简单:每隔一个时间段就会从地下冒出一只或多只地鼠,玩游戏的人要做的就是... 阅读全文
posted @ 2013-07-13 22:04 Jack Ge 阅读(825) 评论(0) 推荐(0) 编辑
摘要:SudokuTime Limit:2000MSMemory Limit:65536KTotal Submissions:11694Accepted:5812Special JudgeDescriptionSudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The ot 阅读全文
posted @ 2013-07-13 00:29 Jack Ge 阅读(364) 评论(0) 推荐(0) 编辑
摘要:Sorting SlidesTime Limit:1000MSMemory Limit:10000KTotal Submissions:2831Accepted:1076DescriptionProfessor Clumsey is going to give an important talk this afternoon. Unfortunately, he is not a very tidy person and has put all his transparencies on one big heap. Before giving the talk, he has to sort 阅读全文
posted @ 2013-07-10 15:19 Jack Ge 阅读(390) 评论(0) 推荐(0) 编辑
摘要:Ombrophobic BovinesTime Limit:1000MSMemory Limit:65536KTotal Submissions:11651Accepted:2586DescriptionFJ's cows really hate getting wet so much that the mere thought of getting caught in the rain makes them shake in their hooves. They have decided to put a rain siren on the farm to let them know 阅读全文
posted @ 2013-07-10 14:07 Jack Ge 阅读(434) 评论(0) 推荐(0) 编辑
摘要:FriendshipTime Limit:2000MSMemory Limit:20000KTotal Submissions:8025Accepted:2224DescriptionIn modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. You can assume that people A can keep in touch with people B, only if1. 阅读全文
posted @ 2013-07-09 22:33 Jack Ge 阅读(1040) 评论(1) 推荐(0) 编辑
摘要:Sightseeing tourTime Limit:1000MSMemory Limit:10000KTotal Submissions:6448Accepted:2654DescriptionThe city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautiful city. They want to construct the tour so that every street i 阅读全文
posted @ 2013-07-09 21:34 Jack Ge 阅读(346) 评论(0) 推荐(0) 编辑
摘要:Perfect ElectionTime Limit:5000MSMemory Limit:65536KTotal Submissions:438Accepted:223DescriptionIn a country (my memory fails to say which), the candidates {1, 2 ..., N} are running in the parliamentary election. An opinion poll asks the question "For any two candidates of your own choice, whic 阅读全文
posted @ 2013-07-09 20:45 Jack Ge 阅读(383) 评论(0) 推荐(0) 编辑
摘要:Map LabelerTime Limit:1000MSMemory Limit:65536KTotal Submissions:1267Accepted:409DescriptionMap generation is a difficult task in cartography. A vital part of such task is automatic labeling of the cities in a map; where for each city there is text label to be attached to its location, so that no tw 阅读全文
posted @ 2013-07-09 19:31 Jack Ge 阅读(288) 评论(0) 推荐(0) 编辑
摘要:Bomb GameTime Limit: 10000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2754Accepted Submission(s): 918Problem DescriptionRobbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each 阅读全文
posted @ 2013-07-09 19:07 Jack Ge 阅读(179) 评论(0) 推荐(0) 编辑
摘要:Priest John's Busiest DayTime Limit:2000MSMemory Limit:65536KTotal Submissions:6900Accepted:2363Special JudgeDescriptionJohn is the only priest in his town. September 1st is the John's busiest day in a year because there is an old legend in the town that the couple who get married on that da 阅读全文
posted @ 2013-07-09 18:11 Jack Ge 阅读(429) 评论(0) 推荐(0) 编辑
摘要:Katu PuzzleTime Limit:1000MSMemory Limit:65536KTotal Submissions:6553Accepted:2401DescriptionKatu Puzzle is presented as a directed graphG(V,E) with each edgee(a,b) labeled by a boolean operatorop(one of AND, OR, XOR) and an integerc(0 ≤c≤ 1). One Katu is solvable if one can find each vertexVia valu 阅读全文
posted @ 2013-07-09 16:29 Jack Ge 阅读(448) 评论(0) 推荐(0) 编辑
摘要:WeddingTime Limit:1000MSMemory Limit:65536KTotal Submissions:6673Accepted:2033Special JudgeDescriptionUp to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom sit at one end, opposite each other, and the bride wears an elabora 阅读全文
posted @ 2013-07-09 15:52 Jack Ge 阅读(324) 评论(0) 推荐(0) 编辑
摘要:Ikki's Story IV - Panda's TrickTime Limit:1000MSMemory Limit:131072KTotal Submissions:6691Accepted:2496Descriptionliympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tired of such easy games and wants to play ano 阅读全文
posted @ 2013-07-09 15:09 Jack Ge 阅读(339) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2013-07-09 14:42 Jack Ge 阅读(0) 评论(0) 推荐(0) 编辑
摘要:PartyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3120Accepted Submission(s): 974Problem Description有n对夫妻被邀请参加一个聚会,因为场地的问题,每对夫妻中只有1人可以列席。在2n 个人中,某些人之间有着很大的矛盾(当然夫妻之间是没有矛盾的),有矛盾的2个人是不会同时出现在聚会上的。有没有可能会有n 个人同时列席?Inputn: 表示有n对夫妻被邀请 (n#include#include 阅读全文
posted @ 2013-07-09 11:49 Jack Ge 阅读(251) 评论(0) 推荐(0) 编辑
摘要:Dropping testsTime Limit:1000MSMemory Limit:65536KTotal Submissions:4654Accepted:1587DescriptionIn a certain course, you takentests. If you getaiout ofbiquestions correct on testi, your cumulative average is defined to be.Given your test scores and a positive integerk, determine how high you can mak 阅读全文
posted @ 2013-07-08 10:12 Jack Ge 阅读(866) 评论(0) 推荐(0) 编辑
摘要:WatchcowTime Limit:3000MSMemory Limit:65536KTotal Submissions:5258Accepted:2206Special JudgeDescriptionBessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure that no evildoers are doing any evil. She begins at the barn, makes h 阅读全文
posted @ 2013-07-04 09:42 Jack Ge 阅读(308) 评论(0) 推荐(0) 编辑
摘要:CatenymsTime Limit:1000MSMemory Limit:65536KTotal Submissions:8173Accepted:2149DescriptionA catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second. For example, the following are catenyms:dog.gophergopher.ratrat.tiger 阅读全文
posted @ 2013-07-04 09:19 Jack Ge 阅读(289) 评论(0) 推荐(0) 编辑
摘要:Colored SticksTime Limit:5000MSMemory Limit:128000KTotal Submissions:27097Accepted:7175DescriptionYou 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 阅读全文
posted @ 2013-07-03 23:51 Jack Ge 阅读(461) 评论(0) 推荐(0) 编辑
摘要:Ant TripTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 904Accepted Submission(s): 338Problem DescriptionAnt Country consist of N towns.There are M roads connecting the towns.Ant Tony,together with his friends,wants to go through every part of the 阅读全文
posted @ 2013-07-03 23:10 Jack Ge 阅读(655) 评论(0) 推荐(0) 编辑
摘要:Train Problem IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4358Accepted Submission(s): 2391Problem 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 o 阅读全文
posted @ 2013-07-03 22:44 Jack Ge 阅读(868) 评论(0) 推荐(0) 编辑
摘要:小兔的棋盘Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4665Accepted Submission(s): 2586Problem Description小兔的叔叔从外面旅游回来给她带来了一个礼物,小兔高兴地跑回自己的房间,拆开一看是一个棋盘,小兔有所失望。不过没过几天发现了棋盘的好玩之处。从起点(0,0)走到终点(n,n)的最短路径数是C(2n,n),现在小兔又想如果不穿越对角线(但可接触对角线上的格点),这样的路径数有多少?小兔想了很 阅读全文
posted @ 2013-07-03 22:28 Jack Ge 阅读(591) 评论(0) 推荐(0) 编辑
摘要:CubeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1166Accepted Submission(s): 580Problem DescriptionGiven an N*N*N cube A, whose elements are either 0 or 1. A[i, j, k] means the number in the i-th row , j-th column and k-th layer. Initially we h 阅读全文
posted @ 2013-07-03 19:31 Jack Ge 阅读(385) 评论(0) 推荐(0) 编辑
摘要:Ping pongTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2611Accepted Submission(s): 973Problem DescriptionN(3#include#includeusing namespace std;const int N=100010;int n,arr[N+10],a[N+10];int lmin[N+10],lmax[N+10],rmin[N+10],rmax[N+10];int lowbit( 阅读全文
posted @ 2013-07-03 18:55 Jack Ge 阅读(489) 评论(0) 推荐(0) 编辑
摘要:Color the ballTime Limit: 9000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5397Accepted Submission(s): 2882Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a #include#includeusing namespace std;const int N=100010;int n,arr[N],level[N];int lowbit(int 阅读全文
posted @ 2013-07-03 17:02 Jack Ge 阅读(328) 评论(0) 推荐(0) 编辑
摘要:Find the nondecreasing subsequencesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1072Accepted Submission(s): 370Problem DescriptionHow many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, ...., sn} ? For example, we assu 阅读全文
posted @ 2013-07-03 12:08 Jack Ge 阅读(268) 评论(0) 推荐(0) 编辑
摘要:Light BulbTime Limit:1 Second Memory Limit:32768 KBCompared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodious house, thinking of how to earn more money. One day, 阅读全文
posted @ 2013-07-03 11:51 Jack Ge 阅读(663) 评论(0) 推荐(0) 编辑
摘要:1, HDU 1548A strange lift :http://acm.hdu.edu.cn/showproblem.php?pid=1548这道题可以灰常巧妙的转换为一道最短路题目,对第i层,按钮数字为button[i],则如果满足相加=1,则把i到i-button[i]的路径长度设为1.则最后输出终点的最短路的长度即可#include#include#include#includeusing namespace std;const int INF=0x3f3f3f3f;int n,a,b;int map[210][210],vis[210],dis[210];int SPFA(){ . 阅读全文
posted @ 2013-07-01 09:05 Jack Ge 阅读(274) 评论(0) 推荐(0) 编辑

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