본문 바로가기
공부/코딩테스트

백준: 24736번 Football Scoring(Python3)

by 혼밥맨 2022. 7. 31.
반응형

백준: 24736번 Football Scoring(Python3)

Football Scoring 성공다국어

 
시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB 1189 988 920 85.106%

문제

There are five ways to score points in american professional football:

  1. Touchdown - 6 points
  2. Field Goal - 3 points
  3. Safety - 2 points
  4. After touchdown
    1. 1 point (Field Goal or Safety) - Typically called the “Point after”
    2. 2 points (touchdown) - Typically called the “Two-point conversion”

(https://operations.nfl.com/the-rules/nfl-video-rulebook/scoring-plays/)

Given the box score values for two competing teams, calculate the point total for each team.

입력

There are two lines of input each containing five space-separated non-negative integers, T, F, S, P and C representing the number of Touchdowns, Field goals, Safeties, Points-after-touchdown and two-point Conversions after touchdown respectively. (0 ≤ T ≤ 10), (0 ≤ F ≤ 10), (0 ≤ S ≤ 10), (0 ≤ (P+C) ≤ T). The first line represents the box score for the visiting team, and the second line represents the box score for the home team.

각각 터치다운, 필드 골, 세이프티, 터치다운 후 포인트 및 터치다운 후 2포인트 전환 수를 나타내는 5개의 공백으로 구분된 음이 아닌 정수, T, F, S, P 및 C를 포함하는 두 줄의 입력이 있습니다. . (0 ≤ T ≤ 10), (0 ≤ F ≤ 10), (0 ≤ S ≤ 10), (0 ≤ (P+C) ≤ T). 첫 번째 줄은 방문 팀의 박스 스코어를 나타내고 두 번째 라인은 홈 팀의 박스 스코어를 나타냅니다.

출력

The single output line consists of two space-separated integers showing the visiting score and the home score respectively.

단일 출력 라인은 방문 점수와 홈 점수를 각각 표시하는 두 개의 공백으로 구분된 정수로 구성됩니다.

예제 입력 1

1 3 0 0 1
3 1 1 1 1

예제 출력 1

17 26

답안

1
2
3
for i in range(2):
    T, F, S, P, C = map(int, input().split())
    print( (T*6 + F*3 + S*2 + P*1 + C*2), end=" ")
cs

반응형

댓글