⌨️ Algorithms/백준
[Python] 백준 15552번_빠른 A+B
monzheld
2022. 6. 29. 11:50
https://www.acmicpc.net/problem/15552
15552번: 빠른 A+B
첫 줄에 테스트케이스의 개수 T가 주어진다. T는 최대 1,000,000이다. 다음 T줄에는 각각 두 정수 A와 B가 주어진다. A와 B는 1 이상, 1,000 이하이다.
www.acmicpc.net
import sys
T = int(input())
for i in range(T):
A,B = map(int, sys.stdin.readline().split())
print(A+B)
반복문으로 여러 줄을 입력받을 때 input()을 사용하면 시간 초과
-> input 대신 sys.stdin.readline() 사용