| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 600 人关注过本帖
标题:关于“赌博”的问题
只看楼主 加入收藏
袁野
Rank: 2
来 自:湖北省
等 级:论坛游民
帖 子:45
专家分:56
注 册:2010-10-13
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:8 
关于“赌博”的问题
As Manuel wants to get rich fast and without too much work, he decided to make a career in gambling. Initially, he plans to study the gains and losses of players, so that, he can identify patterns of consecutive wins and elaborate a winwin strategy. But Manuel, as smart as he thinks he is, does not know how to program computers. So he hired you to write programs that will assist him in elaborating his strategy.

Your first task is to write a program that identifies the maximum possible gain out of a sequence of bets. A bet is an amount of money and is either winning (and this is recorded as a positive value), or losing (and this is recorded as a negative value).

Input
The input set consists of a positive number N <= 10000 , that gives the length of the sequence, followed by N integers. Each bet is an integer greater than 0 and less than 1000.
The input is terminated with N = 0.

Output
For each given input set, the output will echo a line with the corresponding solution. If the sequence shows no possibility to win money, then the output is the message "Losing streak."
Sample Input
5
12 -4 -10 4 9
3
-2 -1 -2
0
Sample Output
The maximum winning streak is 13.
Losing streak.
Thanks To
Problem setter: David Dehar
搜索更多相关主题的帖子: 赌博 
2010-11-06 20:57
袁野
Rank: 2
来 自:湖北省
等 级:论坛游民
帖 子:45
专家分:56
注 册:2010-10-13
收藏
得分:0 
学校的作业看都看不懂
2010-11-06 20:58
outsider_scu
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:3
帖 子:430
专家分:1333
注 册:2010-10-21
收藏
得分:2 
ACM?
OJ?

编程的道路上何其孤独!
2010-11-06 21:49
配角
Rank: 1
来 自:浙江
等 级:新手上路
帖 子:12
专家分:6
注 册:2010-11-4
收藏
得分:2 
回复 2楼 袁野
你是哈工大的?
2010-11-06 21:57
vandychan
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
等 级:贵宾
威 望:18
帖 子:2296
专家分:6418
注 册:2010-8-20
收藏
得分:2 
哈尔滨工业大学?

到底是“出来混迟早要还”还是“杀人放火金腰带”?
2010-11-06 22:24
袁野
Rank: 2
来 自:湖北省
等 级:论坛游民
帖 子:45
专家分:56
注 册:2010-10-13
收藏
得分:0 
嗯,软件工程
2010-11-06 23:03
袁野
Rank: 2
来 自:湖北省
等 级:论坛游民
帖 子:45
专家分:56
注 册:2010-10-13
收藏
得分:0 
求代码!!!
2010-11-06 23:05
vandychan
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
等 级:贵宾
威 望:18
帖 子:2296
专家分:6418
注 册:2010-8-20
收藏
得分:0 
真的是哈尔滨工业大学?

到底是“出来混迟早要还”还是“杀人放火金腰带”?
2010-11-06 23:09
outsider_scu
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:3
帖 子:430
专家分:1333
注 册:2010-10-21
收藏
得分:0 
这。。。哈工大咋了。。

编程的道路上何其孤独!
2010-11-06 23:33
快速回复:关于“赌博”的问题
数据加载中...
 
   



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

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