BOJ/백준-15969-python

cosmos·2022년 3월 23일
0
post-thumbnail

문제

풀이

  • python의 내장함수인 maxmin을 활용해 점수의 차이를 구하면 된다.

코드

# https://www.acmicpc.net/problem/15969
# boj, 15969: 행복, python3
import sys

input = sys.stdin.readline

def solve(scores: list) -> int:
    return max(scores) - min(scores)

if __name__ == '__main__':
    n = int(input())
    scores = list(map(int, input().split()))

    print(solve(scores))

결과

출처 & 깃허브

BOJ 15969
GITHUB

0개의 댓글