上一页 1 2 3 4 5 6 7 8 9 10 ··· 22 下一页
摘要: 旅游路线travel.pas/c/cpp 话说LCINF信息组来到烟台参加夏令营。一天,大家提议出去游玩,来到了烟台最繁华的地方。由于他们对烟台不了解,怕迷了路,所以,他们正焦急的想办法。这时,天上突然现身一个老人(这是 所以,他们正焦急的想办法。这时,天上突然现身一个老人(这是真亊……),对我们说:“这片街道呈网状,其中东西向的街道是旅游街,南北向的街道是绿化道。由于游客众多,旅游街被规定为单行道,只能由西向东走,而绿化道是双向通道,两个方向都能通过,我在所有旅游街相邻两个路口之间打上了分值(-10000到10000之间),而在绿化道均没有打分。你们可以从任何一个位置开始游览,从任何一个位. 阅读全文
posted @ 2012-10-19 14:55 jiangzh 阅读(518) 评论(0) 推荐(0)
摘要: Number TrianglesConsider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right. 7 ... 阅读全文
posted @ 2012-10-18 19:49 jiangzh 阅读(553) 评论(0) 推荐(0)
摘要: The ClocksIOI'94 - Day 2 Consider nine clocks arranged in a 3x3 array thusly:|-------| |-------| |-------| | | | | | | | |---O | |---O | | O | | | | | | | |-------| |-------| |-------| A ... 阅读全文
posted @ 2012-10-18 17:22 jiangzh 阅读(413) 评论(0) 推荐(0)
摘要: Arithmetic ProgressionsAn arithmetic progression is a sequence of the form a, a+b, a+2b, ..., a+nb where n=0,1,2,3,... . For this problem, a is a non-negative integer and b is a positive integer.Write a program that finds all arithmetic progressions of length n in the set S of bisquares. The set of 阅读全文
posted @ 2012-10-18 15:46 jiangzh 阅读(305) 评论(0) 推荐(0)
摘要: Mother's MilkFarmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second 阅读全文
posted @ 2012-10-18 09:46 jiangzh 阅读(595) 评论(0) 推荐(0)
摘要: 聪明伶俐的香穗子 香穗子遇到难题了. 题目是这样的,一个序列上有n个整数,现在你要取m个,且这m个数的任意两个不能相隔的太近,否则这样会太丑,现在问你最大能得到多大的和输入: 第一行三个数n,m,k,分别表示n个数,取m个,且m个中的任意两个位置差要大于等于K 接下来一行,有n个整数,表示序列上的每个数输出: 最大和Sample Input 4 2 2 3 4 -5 1Sample Output 5数据范围: n<=10000,m<=100,m<=n 答案保正小于 Maxlongint这一题用f[i][j]表示前 i 个数中取 j 个数所能得到的最大值那么就可以得到递归方程f 阅读全文
posted @ 2012-10-14 21:16 jiangzh 阅读(634) 评论(0) 推荐(0)
摘要: Problem 3 Cyh和香穗子 话说,Cyh和香穗子是好朋友,一天他们在fzsz迷路了….Cyh在地点1,香穗子在地点n.由于Cyh是土生土长的fzsz人,所以Cyh准备去n地给香穗子带路.fzsz是个奇怪的地方,它由n地点组成,并且任意两个地点A,B满足要么A能到B,要么B能到A,要么都不能互相到达,一定不存在A和B都能互相到达. 现在Cyh希望快点到达n地输入: 第一行两个数n,m 接下来m行,每行两个数a,b,表示地点a能达到地点b输出: Cyh最少经过的地点数Sample Input 4 5 1 2 2 3 2 4 1 3 3 4Sample Output 3数据范围: n< 阅读全文
posted @ 2012-10-14 20:49 jiangzh 阅读(243) 评论(0) 推荐(0)
摘要: 可爱迷人的香穗子 香穗子正准备参加一个晚会!现在她准备好好打扮一下,她准备戴上耳环,手镯,项链..等等一些装饰品,这里要说明的是,香穗子不是花瓶…. 香穗子最多能承受W的重量,每个装饰品也有各自的重量和美观值 现在香穗子要怎么打扮,美观值的和最大输入: 第一行两个数,w,n 接下来n行,每行两个数,表示物品的信息,第一个数是物品的重量,第二个数是物品的美观值输出: 表示香穗子最多能得到的最大美观值和Sample Input 10 2 7 8 8 7Sample Output 8数据范围: n<=100,w<=10000 答案保正小于Maxlongint很裸的一个01背包问题,直接上 阅读全文
posted @ 2012-10-14 20:47 jiangzh 阅读(288) 评论(0) 推荐(0)
摘要: 活蹦乱跳的香穗子香穗子在田野上调蘑菇!她跳啊跳,发现自己很无聊,于是她想了一个有趣的事情,每个格子最多只能经过1次,且每个格子都有其价值跳的规则是这样的,香穗子可以向上下左右四个方向跳到相邻的格子,并且她只能往价值更高(这里是严格的大于)的格子跳.香穗子可以从任意的格子出发,在任意的格子结束,那么她最多能跳几次?输入: 第一行n,m,表示田野的长和宽接下来n行,每行m个数,表示该格的价值输出:一个数,表示最多跳得格数Sample Input2 22 5-1 3Sample Output 3数据范围: n,m<=100 答案保正小于Maxlongint类似滑雪,一个记忆化搜索即可C++ C 阅读全文
posted @ 2012-10-14 20:46 jiangzh 阅读(204) 评论(0) 推荐(0)
摘要: Calf FlacIt is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes. Your job will be to detect these bovine beauties.Ignore punctuation, whitespace, numbers, and case 阅读全文
posted @ 2012-10-13 21:59 jiangzh 阅读(606) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 22 下一页