CCC '07 J3 - Deal or No Deal Calculator

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 256M

Problem type
Canadian Computing Competition: 2007 Stage 1, Junior #3

Deal or No Deal™ is a game show on NBC. You can click here to play it (requires Flash).

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 \to $100, 2 \to $500, 3 \to $1\,000, ..., 10 \to $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".

Input Specification

The user must input a number n (1 \le n < 10) which indicates how many cases have been opened so far, followed by a list of 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.

Output Specification

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

Sample Input 1

2
3
8
198000

Sample Output 1

no deal

Sample Input 2

8
10
9
8
7
6
5
4
3
400

Sample Output 2

deal

Comments


  • 10
    leoliu93233  commented on Jan. 1, 2024, 3:37 a.m.

    RIP flash


  • -34
    chessdongdong  commented on Jan. 8, 2020, 9:46 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 7
    rexguan1  commented on March 3, 2018, 2:07 a.m.

    the game doesn't work even if you activate adobe flash


    • 30
      EugeneChen  commented on June 22, 2020, 8:44 p.m.

      The point of this is to make your own code not playing the game


  • 22
    moladan123  commented on Dec. 4, 2014, 2:55 p.m.

    The question says you can click here to play it, but there is no link!!! We are outraged!!! Mass hysteria!!!


    • 4
      Kultor7774  commented on Feb. 18, 2019, 11:16 p.m.

      It's because the link is outdated. Do any of you know that this is from 10+ years ago?


    • -26
      FatalEagle  commented on Dec. 4, 2014, 8:46 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -11
        Dordor1218  commented on Feb. 3, 2018, 12:34 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


        • 14
          Xyene  commented on Feb. 3, 2018, 12:39 a.m.

          The game requires Flash to run, and as such may not be playable in all browsers (notably Firefox).


          • 11
            jfu0952  commented on Aug. 8, 2018, 1:16 p.m.

            Worked for me (Chrome)


      • -14
        Yuting9  commented on Dec. 4, 2014, 10:12 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


        • 10
          RussianSpy  commented on Jan. 11, 2020, 1:41 a.m.

          refrensh your page


        • -12
          FatalEagle  commented on Dec. 4, 2014, 11:30 p.m.

          This comment is hidden due to too much negative feedback. Show it anyway.