BOJ - 2851 - 슈퍼 마리오

Updated:

def solution():
    
    data = []
    for _ in range(10):
        data.append(int(input()))

    score = 0
    for i in data:
        score += i
        if score >= 100:
            if score - 100 > 100 - (score - i):
                score -= i
            break
        
    print(score)

solution()

https://www.acmicpc.net/problem/2851

Categories:

Updated:

Leave a comment