BOJ/백준-24736-python

cosmos·2022년 5월 27일
0
post-thumbnail
post-custom-banner

문제

풀이

  • zip 내장함수로 football points와 input data를 1대1 매칭으로 합산해 점수를 구하였다

코드

# https://www.acmicpc.net/problem/24736
# boj, 24736: football scoring, python3
import sys

input = sys.stdin.readline

def solve(scores1: list, scores2: list):
    football_points = [6, 3, 2, 1, 2]
    score1_result = sum([x*y for x, y in zip(football_points, scores1)])
    score2_result = sum([x*y for x, y in zip(football_points, scores2)])
    
    return score1_result, score2_result

if __name__ == '__main__':
    scores1 = list(map(int, input().split()))
    scores2 = list(map(int, input().split()))

    print(*solve(scores1, scores2))

결과

출처 & 깃허브

boj 24736

post-custom-banner

0개의 댓글