https://blog.csdn.net/hnust_xiehonghao/article/details/7876075

# To Be NUMBER ONE

*10*

已采纳

Problem Description

One is an interesting integer. This is also an interesting problem. You are assigned with a simple task.

Find N (3 <= N <= 18) different positive integers Ai (1 <= i <= N), and

Any possible answer will be accepted.

Input

No input file.

Output

Your program’s output should contain 16 lines:

The first line contain 3 integers which are the answer for N = 3, separated by a single blank.

The following 15 lines are the answer for N = 4 to 18, as the same format.

The sample output is the first two lines of a possible output.

Sample Output

2 3 6

2 4 6 12

- 点赞
- 写回答
- 关注问题
- 收藏
- 复制链接分享
- 邀请回答

*1*条回答

#### 相关推荐

- 4年前回答 2 已采纳 Problem Description One is an interesting integer. This is also an interesting problem. You are assigned with a simple task. Find N (3 <= N <= 18) different positive integers Ai (1 <= i <= N), and Any possible answer will be accepted. Input No input file. Output Your program’s output should contain 16 lines: The first line contain 3 integers which are the answer for N = 3, separated by a single blank. The following 15 lines are the answer for N = 4 to 18, as the same format. The sample output is the first two lines of a possible output. Sample Output 2 3 6 2 4 6 12
- 回答 1 已采纳 Problem Description That's a question. Now Happy (Xi Yangyang) has been caught by Wolffy (Hui Tailang). As Wolffy is busy preparing the big meal, a good idea comes to Happy. He proposes a game that only Wolffy had won, he can eat Happy. Wolffy always believes he is the cleverest one, so they reach a consensus. And they both agree with Wolnie (Hong Tailang) when the referee. A theater will be beat to die by Wolnie's pan. The game is defined as follow. There are multiple test cases. In each case there are R (R < 10) rounds of the game, R is an odd number to guarantee that there must be a winner in the end. In each round: There is a pile of n (10 <= n <= 200) Special-cards and m (1 <= m <= 100) piles of Point-card on the table. The Point-card piles are ordered from 1 to m. Wolffy and Happy take turns to get one card from the top of Special-cards pile. Wolffy always takes first in the game. When all the Special-cards have been taken, the round is over and the one with more cards in the hands gains one point. If there is a tie, Wolffy gains one point.(Wolffty and Happy both have 0 point before the game). There are 5 kinds of Special-cards besides the Point-card in the game. 0) Point-card: a card with a point X (1 <= X <= 2000000). 1) Challenge-card: no matter who takes this card, they both take one card with the maximum point from their own hands. After a comparison, if Happy's card has a larger point, He takes all the Wolffy's in-hands cards, vice versa; If there is a tie no more operation. 2) Loss-card: the one who takes this card, He must throw a card with the maximum point. 3) Add-card: a card with P point, the one who gets this card will make the card with maximum point P point larger, i.e. if a Point-card with X point is the maximum, its point will change to X + P. An Add-card can only work on one Point-card. 4) Exchange-card: a card with Q point. The one who gets this card must change one maximum-point card's point to Q. 5) Take-card: a card with a integer K, indicates one can get the all the cards of Kth Point-card pile. In one round no two Take-card have the same K. You can assume that when one gets the Loss-card, Add-card, Exchange-card, He has at least one card in the hands, when one gets a Challenge-card, they both have at least one card in the hands. Input Input For each test case, the first line of input is an integer R, indicates the number of rounds: Line 2: two integers n indicates the number of Special-cards, m indicates the number of Point-card piles. Line 3: a line of m integers. The ith number Pi (1 <= Pi <= 10000)indicates the number cards of ith Point-card pile. For the next m lines, ith line contains Pi numbers indicate every Point-card's point of ith Point-card pile. The next n lines, in each line, there are five kinds of input, indicate Special-cards by the order of "from top to bottom". 1) T K: indicates one gets a Take-card, and He can get Kth Point-card pile(1 <= K <= m). 2) C: indicates one gets a Challenge card. 3) L: indicates one gets a Loss card. 4) A P: indicates one gets an Add card with P point (1 <= P <= 30). 5) E Q: indicates one gets an Exchange card with Q point (1 <= Q <= 2000000). Output For each round you should print A:B in a line. A indicate the number of left cards of Wolffy, B indicates the number of left cards of Happy. At the end of game, if Wolffy gains more points, print "Hahaha...I win!!", else print "I will be back!!". Sample Input 3 5 3 3 3 3 10 11 2 7 4 12 4 2 9 T 1 T 2 A 7 T 3 C 6 3 2 2 2 1 4 5 2 4 2 T 2 T 1 L A 2 T 3 C 5 3 2 2 2 1 3 4 2 5 2 T 2 T 1 E 3 A 1 L Sample Output 9:0 0:5 1:2 I will be back!!
- 4年前回答 1 已采纳 Problem Description The wide dissemination of calculators and computers is not without disadvantages. Teachers all over the world find out that even students in technical disciplines tend to have a surprising lack of calculating ability. Accustomed as they are to the use of calculators and computers, many of them are unable to make calculations like 7*8 mentally, or to factor 91 by heart. We all know, but who cares? Professor Bartjens cares. Professor Bartjens is a bit old-fashioned. He decided to give his students some training in calculating without electronic equipment - even without a slide rule. He invented a two-person game involving mental calculations. Professor Bartjens would write a positive number on the blackboard. During the game more positive numbers may appear on the blackboard. The two players will then make moves in turn. A player on move is obliged to make a move, unless the blackboard is empty, in which case the game is over. A move is one of the following: －－If you see the number 1 on the blackboard, you may take it. That means: you gain one point,and the number disappears from the blackboard. －－If you see a prime number p on the blackboard, you may subtract one. That is: you gain one point, and the p on the blackboard is replaced by p －1. －－If you see a composite number c on the blackboard, you may replace it by two smaller (positive) numbers, a and b, such that a * b = c. You do not gain any points. The goal is of course to obtain as many points as you can. Professor Bartjens was hoping that his students would find the game so interesting that they would spend all day playing, thereby improving their skills in calculation. Indeed his students did find the game interesting, and spent many hours, not so much playing the game as discussing optimal strategies. The students came to two conclusions. First, the sum of the two players' points after any given game are the same regardless of the actual scheme played. Thus," a player maximising his own points also minimises his opponent's! Second, it is always best to take a point when you have the chance. Thus, whenever prime numbers or ones are written on the blackboard, the player on move takes one of them. Here is your problem: given a starting number, and assuming both players play to maximise their own points, what will be the outcome? Input On the first line of the input is a single positive integer n, telling the number of test scenarios to follow. Each scenario consists of a single line containing the positive integer m<1000000, the number initially written on the blackboard. Output For each test scenario, output one line containing two numbers separated by one space character, equal to the points gained by the two players, both playing to maximise their own points. The first number is the number of points gained by the first player. Sample Input 6 1 2 3 4 5 6 Sample Output 1 0 1 1 2 1 2 2 3 2 2 3
- 回答 1 已采纳 Description In this problem, you will be given one or more integers in English. Your task is to translate these numbers into their integer representation. The numbers can range from negative 999,999,999 to positive 999,999,999. The following is an exhaustive list of English words that your program must account for: negative, zero, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million Input The input consists of several instances. Notes on input: Negative numbers will be preceded by the word negative. The word "hundred" is not used when "thousand" could be. For example, 1500 is written "one thousand five hundred", not "fifteen hundred". The input is terminated by an empty line. Output The answers are expected to be on separate lines with a newline after each. Sample Input six negative seven hundred twenty nine one million one hundred one eight hundred fourteen thousand twenty two Sample Output 6 -729 1000101 814022
- 4年前回答 2 已采纳 You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or the film of the same name by Stanley Kubrick. In it a spaceship is sent from Earth to Saturn. The crew is put into stasis for the long flight, only two men are awake, and the ship is controlled by the intelligent computer HAL. But during the flight HAL is acting more and more strangely, and even starts to kill the crew on board. We don't tell you how the story ends, in case you want to read the book for yourself :-) After the movie was released and became very popular, there was some discussion as to what the name 'HAL' actually meant. Some thought that it might be an abbreviation for 'Heuristic ALgorithm'. But the most popular explanation is the following: if you replace every letter in the word HAL by its successor in the alphabet, you get ... IBM. Perhaps there are even more acronyms related in this strange way! You are to write a program that may help to find this out. Input The input starts with the integer n on a line by itself - this is the number of strings to follow. The following n lines each contain one string of at most 50 upper-case letters. Output For each string in the input, first output the number of the string, as shown in the sample output. The print the string start is derived from the input string by replacing every time by the following letter in the alphabet, and replacing 'Z' by 'A'. Print a blank line after each test case. Sample Input 2 HAL SWERC Sample Output String #1 IBM String #2 TXFSD
- 5年前回答 1 已采纳 描述 : In the game show “The Price is Right”, a number of players (typically 4) compete to get on stage by guessing the price of an item. The winner is the person whose guess is the closest one not exceeding the actual price. Because of the popularity of the one-person game show “Who Wants to be a Millionaire”,the American Contest Management (ACM) would like to introduce a one-person version of the “The Price is Right”. In this version, each contestant is allowed G (1 <= G <= 30) guesses and L (0 <= L <= 30)lifelines. The contestant makes a number of guesses for the actual price. After each guess, the contestant is told whether it is correct, too low, or too high. If the guess is correct, the contestant wins. Otherwise,he uses up a guess. Additionally, if his guess is too high, a lifeline is also lost. The contestant loses when all his guesses are used up or if his guess is too high and he has no lifelines left. All prices are positive integers. It turns out that for a particular pair of values for G and L, it is possible to obtain a guessing strategy such that if the price is between 1 and N (inclusive) for some N, then the player can guarantee a win.The ACM does not want every contestant to win, so it must ensure that the actual price exceeds N.At the same time, it does not want the game to be too diffcult or there will not be enough winners to attract audience. Thus, it wishes to adjust the values of G and L depending on the actual price. To help them decide the correct values of G and L, the ACM has asked you to solve the following problem.Given G and L, what is the largest value of N such that there is a strategy to win as long as the price is between 1 and N (inclusive)? 输入: The input consists of a number of cases. Each case is specified by one line containing two integers G and L, separated by one space. The end of input is specified by a line in which G = L = 0. 输出: For each case, print a line of the form: Case c: N where c is the case number (starting from 1) and N is the number computed. 样例输入: 3 0 3 1 10 5 7 7 0 0 样例输出: Case 1: 3 Case 2: 6 Case 3: 847 Case 4: 127
- 回答 2 已采纳 In the game show "The Price is Right", a number of players (typically 4) compete to get on stage by guessing the price of an item. The winner is the person whose guess is the closest one not exceeding the actual price. Because of the popularity of the one-person game show "Who Wants to be a Millionaire", the American Contest Management (ACM) would like to introduce a one-person version of the "The Price is Right". In this version, each contestant is allowed G (1 <= G <= 30) guesses and L (0 <= L <= 30) lifelines. The contestant makes a number of guesses for the actual price. After each guess, the contestant is told whether it is correct, too low, or too high. If the guess is correct, the contestant wins. Otherwise, he uses up a guess. Additionally, if his guess is too high, a lifeline is also lost. The contestant loses when all his guesses are used up or if his guess is too high and he has no lifelines left. All prices are positive integers. It turns out that for a particular pair of values for G and L, it is possible to obtain a guessing strategy such that if the price is between 1 and N (inclusive) for some N, then the player can guarantee a win. The ACM does not want every contestant to win, so it must ensure that the actual price exceeds N. At the same time, it does not want the game to be too diffcult or there will not be enough winners to attract audience. Thus, it wishes to adjust the values of G and L depending on the actual price. To help them decide the correct values of G and L, the ACM has asked you to solve the following problem. Given G and L, what is the largest value of N such that there is a strategy to win as long as the price is between 1 and N (inclusive)? Input The input consists of a number of cases. Each case is specified by one line containing two integers G and L, separated by one space. The end of input is specified by a line in which G = L = 0. Output For each case, print a line of the form: Case c: N where c is the case number (starting from 1) and N is the number computed. Sample Input 3 0 3 1 10 5 7 7 0 0 Sample Output Case 1: 3 Case 2: 6 Case 3: 847 Case 4: 127
- 4年前回答 1 已采纳 Description Christine and Matt are playing an exciting game they just invented: the Number Game. The rules of this game are as follows. The players take turns choosing integers greater than 1. First, Christine chooses a number, then Matt chooses a number, then Christine again, and so on. The following rules restrict how new numbers may be chosen by the two players: A number which has already been selected by Christine or Matt, or a multiple of such a number,cannot be chosen. A sum of such multiples cannot be chosen, either. If a player cannot choose any new number according to these rules, then that player loses the game. Here is an example: Christine starts by choosing 4. This prevents Matt from choosing 4, 8, 12, etc.Let's assume that his move is 3. Now the numbers 3, 6, 9, etc. are excluded, too; furthermore, numbers like: 7 = 3+4;10 = 2*3+4;11 = 3+2*4;13 = 3*3+4;... are also not available. So, in fact, the only numbers left are 2 and 5. Christine now selects 2. Since 5=2+3 is now forbidden, she wins because there is no number left for Matt to choose. Your task is to write a program which will help play (and win!) the Number Game. Of course, there might be an infinite number of choices for a player, so it may not be easy to find the best move among these possibilities. But after playing for some time, the number of remaining choices becomes finite, and that is the point where your program can help. Given a game position (a list of numbers which are not yet forbidden), your program should output all winning moves. A winning move is a move by which the player who is about to move can force a win, no matter what the other player will do afterwards. More formally, a winning move can be defined as follows. A winning move is a move after which the game position is a losing position. A winning position is a position in which a winning move exists. A losing position is a position in which no winning move exists. In particular, the position in which all numbers are forbidden is a losing position. (This makes sense since the player who would have to move in that case loses the game.) Input The input consists of several test cases. Each test case is given by exactly one line describing one position. Each line will start with a number n (1 <= n <= 20), the number of integers which are still available. The remainder of this line contains the list of these numbers a1;...;an(2 <= ai <= 20). The positions described in this way will always be positions which can really occur in the actual Number Game. For example, if 3 is not in the list of allowed numbers, 6 is not in the list, either. At the end of the input, there will be a line containing only a zero (instead of n); this line should not be processed. Output For each test case, your program should output "Test case #m", where m is the number of the test case (starting with 1). Follow this by either "There's no winning move." if this is true for the position described in the input file, or "The winning moves are: w1 w2 ... wk" where the wi are all winning moves in this position, satisfying wi < wi+1 for 1 <= i < k. After this line, output a blank line. Sample Input 2 2 5 2 2 3 5 2 3 4 5 6 0 Sample Output Test Case #1 The winning moves are: 2 Test Case #2 There's no winning move. Test Case #3 The winning moves are: 4 5 6
- Asher117的博客 今天使用Python的sklearn模块训练模型时，报错ValueError: The number of classes has to be greater than one; got 1 class，如下： clf.fit(x,y) ->ValueError: The number of classes has to be greater than ...
- 8月前SophiaSSSSS的博客 运行sklearn.svm函数预测时，报错 ValueError: The number of classes has to be greater than one; got 1 class 找到报错原因了，因为y只有一种可能的值，1. 接下来，是要找到为什么y的赋值只有1. —— —— —— ...
- 成功解决TypeError: Encoders require their input to be uniformly strings or numbers. Got [‘float‘, ‘int‘,6月前一个处女座的程序猿的博客 成功解决TypeError: Encoders require their input to be uniformly strings or numbers. Got ['float', 'int', 'str'] 目录 解决问题 解决思路 解决方法 解决问题 raise TypeError(...
- 另一个绝影的博客 SELECT * from(SELECT * from((SELECT B.id commentid,topic_id,titile,down,topiccontent,member_ID,count,userID,name,mobile,topicdate,commentdate,commentdown,content,up,numbertable_ID from ((SELECT id,...
- 2年前huaishu的博客 Level 4 Unit 1 1/4 Listening Lesson 1 Visiting a Friend 1-2 Lesson2 Vocabulary Lesson 3 Pains and Sickness Lesson 4 Landforms Dialogue Lesson 5 Eating Out ...Lesson 1 A Trip to...
- sheldon_xuan的博客 重启备用服务器的sql server实例。问题解决。
- minitoy的博客 BINARY str is shorthand for CAST(str AS BINARY). Note that in some contexts, if you cast an indexed column to BINARY, MySQL is not
- 3年前萤火虫之暮的博客 Especially related to the current question, here's one of the possible changes to that proposal that was discussed: Only allow a starred expression as the last item in the exprlist. This would ...
- 3年前春江暮客的博客 arg – object to be written to the TurtleScreen 写到TurtleScreen的参数 move – True/False 移动 align – one of the strings “left”, “center” or right” 对齐参数3选1（left，right，center） font – a...
- gdl3463315的博客 keras.utils.to_categorical和one hot格式 keras.utils.to_categorical这个方法，源码中，它是这样写的： Converts a class vector (integers) to binary class matrix. E.g. for use with categorical_cross...
- daqiang012的博客 错误信息： Android Studio project ...mx.ferreyra.callnumber" in config.xml. Adding it to the project Plugin "call-number" already installed on android. Failed to restore plugin "m...
- Kanny广小隶的博客 当我们需要储存 R 语言的数据文件时，通常会使用 save() 函数储存为 .rda 文件的格式，然后读取时再使用 load() 函数进行...Error: bad restore file magic number (file may be corrupted) -- no data loaded In ad...