Skip to content

Baekjoon 2851

1. Problem

문제 확인하기

2. Solution(Python, memory: 31256KB, time: 40ms)

import sys
input = sys.stdin.readline

scores = 0
for _ in range(10):
    score = int(input())
    prev_scores = scores
    scores += score
    if scores >= 100:
        if abs(100 - scores) > abs(100 - prev_scores):
            scores = prev_scores
        break
print(scores)