답안 #1103700

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1103700 2024-10-21T14:40:45 Z zephyrion Tuna (COCI17_tuna) Python 3
50 / 50
14 ms 2896 KB
n = int(input())
x = int(input())
ans = 0
for i in range(n):
    p1, p2 = map(int, input().split())
    if abs(p1 - p2) <= x:
        ans += max(p1, p2)
    else:
        ans += int(input())
print(ans)
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 2896 KB Output is correct
2 Correct 13 ms 2888 KB Output is correct
3 Correct 12 ms 2896 KB Output is correct
4 Correct 13 ms 2704 KB Output is correct
5 Correct 14 ms 2896 KB Output is correct
6 Correct 13 ms 2896 KB Output is correct
7 Correct 13 ms 2896 KB Output is correct
8 Correct 12 ms 2896 KB Output is correct
9 Correct 12 ms 2744 KB Output is correct
10 Correct 13 ms 2896 KB Output is correct