## CCC '19 J1 - Winning Score

View as PDF

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

Problem types
##### Canadian Computing Competition: 2019 Stage 1, Junior #1

You record all of the scoring activity at a basketball game. Points are scored by a -point shot, a -point field goal, or a -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 -point shots, the second line contains the number of successful -point field goals, and the third line contains the number of successful -point free throws. Each number will be an integer between and , 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

#### Sample Output 1

B

#### Explanation for Sample Output 1

The Apples scored points and the Bananas scored points, and thus the Bananas won.

#### Sample Input 2

7
3
0
6
4
1

#### Sample Output 2

T

#### Explanation for Sample Output 2

The Apples scored points and the Bananas scored points, and thus it was a tie game.

• commented on May 18, 2024, 6:49 p.m.
LA= int(input())
MA = int(input())
SA = int(input())
LB = int(input())
MB = int(input())
SB = int(input())
DA = SA*1 + MA*2 + LA*3
DB = SB*1 + MB*2 + LB*3
if(DA>DB):
print("A")
elif(DA<DB):
print("B")
else:
print("T")

• commented on March 6, 2024, 2:31 p.m.

everyone trying to give advice for this when i just got some one to help me (a teacher) :)

• commented on June 17, 2022, 1:13 a.m.

pay attention to that math. I accidentally kept multiplying everything by '3'. First input worked, second didn't. d'oh. ⇢😅

• commented on Feb. 16, 2021, 10:28 p.m.

Just a hint for those who come across this comment:

• Look closely at what it says about the first 3 lines and 3 last lines
• 2nd, use math sense and see if you can figure it out yourselves what's going on
• 3rd, use your math sense, and use what you know in your coding sense, and figure it out!

That's all I can say! Good-luck!

• commented on Feb. 25, 2021, 10:01 p.m.

Thank you!

• commented on Aug. 12, 2020, 9:30 p.m. edit 2

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 an 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 meant 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^)/

• commented on Aug. 12, 2020, 11:10 p.m.

fax bro

• commented on Aug. 4, 2019, 12:15 a.m.

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

• commented on June 17, 2022, 1:14 a.m.

anything is possible in a word problem.

• commented on Sept. 22, 2022, 1:05 a.m.

bob has 45 tomatoes