관리 메뉴

솜씨좋은장씨

[BaekJoon] 24736번 : Football Scoring (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 24736번 : Football Scoring (Python)

솜씨좋은장씨 2022. 5. 25. 04:12
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Football Scoring 입니다.

 

24736번: Football Scoring

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

www.acmicpc.net

👨🏻‍💻 코드 ( Solution )

def calculate_score(team_score, score_map):
    return sum([(team * score) for team, score in zip(team_score, score_map)])

def football_scoring(team1, team2):
    score_map = [6, 3, 2, 1, 2]
    
    team_1_score = calculate_score(team1, score_map)
    team_2_score = calculate_score(team2, score_map)
    
    return f"{team_1_score} {team_2_score}"


if __name__ == "__main__":
    team1 = list(map(int, input().split()))
    team2 = list(map(int, input().split()))
    
    print(football_scoring(team1, team2))

 

 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

728x90
반응형
0 Comments
댓글쓰기 폼