답안 #161850

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
161850 2019-11-04T18:21:09 Z boolodifjenula Tuna (COCI17_tuna) Python 3
50 / 50
29 ms 3428 KB
from math import *
N=int(input())
x=int(input())
z=0
for i in range(N):
    p1,p2=map(int,input().split())
    if abs(p1-p2)<=x:
        z+=max(p1,p2)
    else:
        z+=int(input())
print(z)
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 3300 KB Output is correct
2 Correct 29 ms 3428 KB Output is correct
3 Correct 26 ms 3272 KB Output is correct
4 Correct 25 ms 3300 KB Output is correct
5 Correct 25 ms 3300 KB Output is correct
6 Correct 26 ms 3300 KB Output is correct
7 Correct 25 ms 3272 KB Output is correct
8 Correct 25 ms 3300 KB Output is correct
9 Correct 26 ms 3372 KB Output is correct
10 Correct 26 ms 3300 KB Output is correct