- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
[计算机软件及应用]POJ水题题目
POJ 1247 Magnificent Meatballs
Magnificent Meatballs
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5719 Accepted: 3837 Description
Sam and Ella run a catering service. They like to put on a show when serving meatballs to guests seated at round tables. They march out of the kitchen with pots of meatballs and start serving adjacent guests. Ella goes counterclockwise and Sam goes clockwise, until they both plop down their last meatball, at the same time, again at adjacent guests. This impressive routine can only be accomplished if they can divide the table into two sections, each having the same number of meatballs. You are to write a program to assist them. At these catering events, each table seats 2 = N = 30 guests. Each guest orders at least one and at most nine meatballs. Each place at the table is numbered from 1 to N, with the host at position 1 and the hosts spouse at position N. Sam always serves the host first then proceeds to serve guests in increasing order. Ella serves the spouse first, then serves guests in decreasing order. The figures illustrate the first two example input cases.
Input
Input consists of one or more test cases. Each test case contains the number of guests N followed by meatballs ordered by each guest, from guest 1 to guest N. The end of the input is a line with a single zero.
Output
For each table, output a single line with the ending positions for Sam and Ella, or the sentence indicating an equal partitioning isnt possible. Use the exact formatting shown below.
Sample Input
5 9 4 2 8 3
5 3 9 4 2 8
6 1 2 1 2 1 2
6 1 2 1 2 1 1
0
Sample Output
Sam stops at position 2 and Ella stops at position 3.
No equal partitioning.
No equal partitioning.
Sam stops at position 3 and Ella stops at position 4.
Source
Mid-Central USA 2002
POJ 1316 Self Numbers
Self Numbers
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18000 Accepted: 10125 Description
In 1949 the Indian mathematician D.R. Kaprekar discovered a class
您可能关注的文档
- [经管营销]QS9000-1998品质管理系统条文解释.ppt
- [经管营销]《企业会计准则讲解2010》主要变动汇总表03-合并财务报表.doc
- [经管营销]娄底农村信用社信贷基础知识培训讲义-2.ppt
- [经管营销]中级管理学BPR专题讲义.ppt
- [英语]时态语态练习题.ppt
- [经管营销]Planning_ Implementing.ppt
- [英语学习]四级英语核心词汇700.doc
- [英语学习]English Lexicology.ppt
- [英语考试]大学英语四级阅读理解试题40篇.doc
- [计算机软件及应用]第7章 数据库设计及应用系统开发.ppt
- [计算机硬件及网络]2010下半年网络工程师试题分析与解答.pdf
- [工程科技]Abstract Downward Nominal Wage Rigidity Evidence from the Employment Cost Index.pdf
- [行政公文]大学生入党申请书范文集锦.pdf
- [预防医学]爱医资源-流行性出血热.ppt
- [计算机软件及应用]分布式爬虫.pdf
- [高二理化生]课题3 血红蛋白的提取和分3离.ppt
- [高二语文]人物传记阅读方法.ppt
- [高二理化生]高一生物必修1第二章第三节课件-PowerPoint-Presentation.ppt
- [高等教育]2药物效应动力学.ppt
- [高等教育]第2章递归与分治策略.ppt
文档评论(0)