- 1、本文档共13页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2015杭电内部比赛题
1001 HearthstoneProblem Description??Cdfpysw loves playing a card game called Hearthstone.??Now he has N cards, he wants to split these cards into 4 piles. Lets assume the number of cards in each pile is a1, a2, a3, a4.??It must be satisfied that:????a1 * k1 = a2 + a3 + a4????a2 * k2 = a1 + a3 + a4????a3 * k3 = a1 + a2 + a4????a1, a2, a3, a4 must be positive??Because Cdfpysw is clever, there must be a way to split there card. Can you tell Cdfpysw what is the way??Input??The first line is an integer T, means the number of cases.??Then T lines, each line contains 4 integers, N, k1, k2, k3, meaning of these have been shown in the description.??T = 100??1 = N = 109??1 = k1, k2, k3 = 200?Output??For each case, you should output Case #i: first, i is the case number.??Then output 4 integers a1, a2, a3, a4, represent the number of cards in each pile.?Sample Input1120 2 3 4?Sample OutputCase #1: 40 30 24 261002 Dual horsetailProblem Description??Nanayas favorite Dual horsetail robot has run out of power!??As a best friend of Nanaya, Cdfpysw decide to do something for him.??Cdfpysw, the king of alpaca, has some very powerful energy balls numbered by 1,2,3……n. He let Nanaya divide them into some sets to save the robot.??However, if there are three balls whose numbers are labeled X,Y and XY in the same set, they will explode! Nanaya must divide these balls into some sets and avoid explosion.??Nanaya is a shy man, he dont want to divide these balls into too many sets. Please tell him the minimum number of sets.?Input??The first line contains an integer T, indicating the number of cases.??The next T line, each line contains an integer n indicating the number of balls. (1 = n = 109)?Output??For each test case in the input, print one line: Case #X: Y, where X is the test case number (starting with 1) and Y represents the minimum number of sets.?Sample Input223?Sample OutputCase #1: 1Case #2: 21003 TriangleProblem DescriptionThis is a simple question, give you a triangle, please di
文档评论(0)