| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1458 人关注过本帖
标题:[练习题]给教室里的朋友们练练手的
只看楼主 加入收藏
ElfDN
Rank: 4
等 级:贵宾
威 望:11
帖 子:291
专家分:0
注 册:2005-11-13
收藏
 问题点数:0 回复次数:15 
[练习题]给教室里的朋友们练练手的

我在这里做下说明:
1、首先,我不帮你们翻译英语,我的英语也不好,请英语不好的硬着头皮看题目,看得懂的
2、1000MS是指1000毫秒也就是1秒,大家注意一下数据量
3、是中级题,不是初级题,有卡人的地方,需要良好的算法

有兴趣的来做,过几天我公布代码,写好的代码跟帖

Jumping Cows
Time Limit:1000MS Memory Limit:65536K

Description

Farmer John's cows would like to jump over the moon, just like the cows in their favorite nursery rhyme. Unfortunately, cows can not jump.

The local witch doctor has mixed up P (1 <= P <= 150,000) potions to aid the cows in their quest to jump. These potions must be administered exactly in the order they were created, though some may be skipped.

Each potion has a 'strength' (1 <= strength <= 500) that enhances the cows' jumping ability. Taking a potion during an odd time step increases the cows' jump; taking a potion during an even time step decreases the jump. Before taking any potions the cows' jumping ability is, of course, 0.

No potion can be taken twice, and once the cow has begun taking potions, one potion must be taken during each time step, starting at time 1. One or more potions may be skipped in each turn.

Determine which potions to take to get the highest jump.

Input

* Line 1: A single integer, P

* Lines 2..P+1: Each line contains a single integer that is the strength of a potion. Line 2 gives the strength of the first potion; line 3 gives the strength of the second potion; and so on.

Output

* Line 1: A single integer that is the maximum possible jump.

Sample Input

8
7
2
1
8
4
3
5
6

Sample Output

17


[此贴子已经被作者于2006-3-15 22:39:18编辑过]

搜索更多相关主题的帖子: 练习题 英语 教室 Limit 
2006-03-14 20:59
linlin
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2006-3-14
收藏
得分:0 
英语没学好

woyaochengshuyidianle 我真的什么也不会
2006-03-14 21:32
woodhead
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:1124
专家分:0
注 册:2005-7-18
收藏
得分:0 

One or more potions may be skipped in each turn.

这句没理解,在段中的意思?


2006-03-15 09:34
high20033763
Rank: 1
等 级:新手上路
帖 子:85
专家分:0
注 册:2006-2-13
收藏
得分:0 
ACM???
2006-03-15 10:16
ElfDN
Rank: 4
等 级:贵宾
威 望:11
帖 子:291
专家分:0
注 册:2005-11-13
收藏
得分:0 
可以被跳过的。。。。
中级难度

2006-03-15 12:12
ElfDN
Rank: 4
等 级:贵宾
威 望:11
帖 子:291
专家分:0
注 册:2005-11-13
收藏
得分:0 
woodhead
加油,再试试

2006-03-15 22:40
woodhead
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:1124
专家分:0
注 册:2005-7-18
收藏
得分:0 

2006-03-16 12:51
kai
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:52
帖 子:3450
专家分:59
注 册:2004-4-25
收藏
得分:0 
这种题目其实一点都不难,只不过看到这种题目就心情不好,那种出题的人大多变态,简单的问题给他描述的很复杂,所以就没兴趣做了。

如果我站在那个出题者面前,我要问问他,你脑子有没有问题,说话不能简单些吗?
google 的Topcoder比赛 出的就是这种题, 不是做不出, 而是看题看老半天, 到最后心情就很差了. google 搞这种比赛就能选出精英? 做梦去吧...

自由,民主,平等,博爱,进步.
中华民国,我的祖国,中华民国万岁!中华民国加油!
本人自愿加入中国国民党,为人的自由性,独立性和平等性而奋斗!
2006-03-16 15:16
jianwufeng
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2006-3-4
收藏
得分:0 
打击我~~的英语水平~

我该为自己负责了
2006-03-16 21:38
Tawtg
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-16
收藏
得分:0 
实在是看不懂,但想看看到底说什么,这个世界,英语统治了我们的语言,哎~~

若不同心 岂能同行 不相信我 就别靠近我 !
2006-03-16 21:59
快速回复:[练习题]给教室里的朋友们练练手的
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015983 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved