CCC '19 J1 - Winning Score

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw.

You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a tie.

Input Specification

The first three lines of input describe the scoring of the Apples, and the next three lines of input describe the scoring of the Bananas. For each team, the first line contains the number of successful 3-point shots, the second line contains the number of successful 2-point field goals, and the third line contains the number of successful 1-point free throws. Each number will be an integer between 0 and 100, inclusive.

Output Specification

The output will be a single character. If the Apples scored more points than the Bananas, output A. If the Bananas scored more points than the Apples, output B. Otherwise, output T, to indicate a tie.

Sample Input 1

10
3
7
8
9
6

Output for Sample Input 1

B

Explanation of Output for Sample Input 1

The Apples scored 10 \cdot 3 + 3 \cdot 2 + 7 \cdot 1 = 43 points and the Bananas scored 8 \cdot 3 + 9 \cdot 2 + 6 \cdot 1 = 48 points, and thus the Bananas won.

Input for Sample Input 2

7
3
0
6
4
1

Output for Sample Input 2

T

Explanation of Output for Sample Input 2

The Apples scored 7 \cdot 3 + 3 \cdot 2 + 0 \cdot 1 = 27 points and the Bananas scored 6 \cdot 3 + 4 \cdot 2 + 1 \cdot 1 = 27 points, and thus it was a tie game.


Comments


  • -5
    MarkR  commented on Aug. 17, 2020, 6:39 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • 11
    QiQi  commented on Aug. 12, 2020, 5:30 p.m.

    wait it says:::::::::You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw.

    You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a tie.::::::::::::::::::::::::::::::::::::::::::::::::::::; should'nt it be:::::::::::::::::::::::::::You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw.

    You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a overtime.:::::::::::::::::::::::::::: crashroyaleoo said that (Thank You crashroyaleoo)(s)he said:::::::::::"basketball games can't end in a tie. the just go to overtime(OT)"::::::::::::::::::::::which ment to be "basketball games can't end in a tie. the GAME WILL just go to overtime(OT)"(Thank You crashroyaleoo again)please press the /\ logo near crashroyaleoo logo to thank me................,......... peace out (^o^)/


  • -4
    QiQi  commented on Aug. 12, 2020, 5:15 p.m.

    if you do not understand read this the 1st line = the 3 point shoots of apples, the 2nd line = the 2 point shoots of apples, the 3rd line = the 1 point shoots of apples, the 4th line = the 3 point shoots of bananas ,the 5th line = the 2 point shoots of banana ,the 6th line = the 1 point shoots of banana so you need a code like: a1 = int(input()) a2 = int(input()) a3 = int(input()) b1 = int(input()) b2 = int(input()) b3 = int(input()) to add them up you need to see the score for types of shoots 1 3 points shoots = 3 ,1 2 points shoots = 2, 1 1 points shoots = 1 so you should do this:ats = a1 x 3 + a2 x 2 + a3,,bts = b1 x 3 + b2 x 2 + b3 to compare you need something like: if ats > bts: print ("a") elif bts > ats: print ("b") else: print ("t") but this is too long and i do not know how to shorten it


  • -8
    GabePD  commented on March 6, 2020, 10:03 a.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


    • 1
      SagarSaha  commented on July 9, 2020, 11:09 p.m.

      you don't only need a if statement... you also need a else statement


    • 3
      Henry_Z  commented on July 9, 2020, 7:18 p.m.

      Yes, yes you do.


  • -3
    vincentlin2047  commented on Feb. 9, 2020, 3:13 p.m.

    wassups


  • -6
    RussianSpy  commented on Dec. 31, 2019, 1:33 p.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • -5
    sku81da  commented on Oct. 6, 2019, 4:51 a.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • 33
    clashroyaleoo  commented on Aug. 3, 2019, 8:15 p.m.

    basketball games can't end in a tie. the just go to overtime(OT)