Logo
(追記) (追記ここまで)

6842번 - Deal or No Deal Calculator 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB67575384.127%

문제

“Deal or No Deal” (TM) is a game show on NBC. (You can play it at http://www.nbc.com/Deal_or_No_Deal/game/flash.shtml)

In the CCC version of the game, there are 10 possible dollar amounts: 100,ドル 500,ドル 1ドル 000, 5ドル 000, 10ドル 000, 25ドル 000, 50ドル 000, 100ドル 000, 500ドル 000, 1ドル 000 000 sealed in imaginary briefcases. These dollar amounts are numbered 1 – 10 (i.e. 1 ! 100,ドル 2 ! 500,ドル 3 ! 1ドル 000, ..., 10 ! 1ドル 000 000). Before the game starts the contestant will have chosen one of the briefcases as his/hers to possibly keep. During the game, some of the ten possible dollar amounts have been eliminated from the game because the contestant has selected some of the other briefcases and revealed the amounts inside.

At some point, the contestant will stop opening briefcases, and a “Banker” will offer the contestant cash in exchange for what might be contained in his/her chosen briefcase. Then the contestant is asked: “Deal or No Deal?”.

Write a program that helps a player decide if he/she should choose “deal” or “no deal”, by calculating the average of the remaining amounts (i.e., all unopened briefcases, including his/her “own” briefcase), and comparing that value to the “Banker’s” offer. If the offer is higher than the average, then the player should ”deal” otherwise, the player should say “no deal”.

입력

The user must input a number n (1  n < 10) which indicates how many cases have been opened so far, followed by a list of n integers between 1 and 10 representing the values in the game that have been eliminated, followed by the “Banker’s” offer. For example: 3 2 5 10 300 indicates that briefcases containing \500,ドル \10ドル 000, and \1ドル 000 000 have been eliminated and the Banker’s offer is \300ドル. You may assume that no duplicate case numbers are entered for the eliminated values, and you may assume that the “Banker’s” offer is an integer greater than 10.

출력

The program will print out one of two statements: “deal” or “no deal”.

제한

예제 입력 1

2
3
8
198000

예제 출력 1

no deal

예제 입력 2

8
10
9
8
7
6
5
4
3
400

예제 출력 2

deal

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2007 > CCC 2007 Junior Division 3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /