[python] 백준 15552번 오답노트

김보현·2024년 5월 31일
0

PS

목록 보기
11/62

문제의 시간 제한이 1초이다.

t = int(input())
for i in range(t):
    a,b = map(int, input().split())
    print(a+b)

따라서 이렇게 a,b = map(int, input().split())으로 적으면 틀리게 된다.

sys.stdin.readline(): stdin은 standard input의 약자이다. input()에 비해 빠르다.

정답

import sys

t = int(input())
for i in range(t):
    a,b = map(int, sys.stdin.readline().split())
    print(a+b)

profile
Fall in love with Computer Vision

0개의 댓글

관련 채용 정보