5번
Python에서 입출력 속도가 input()보다 stdin.readline()이 더 빠르다.
import sys
num = int(sys.stdin.readline())
H, M = list(map(int, stdin.readline().split()))
# 1. 1330번 두 수 비교하기
a, b = input().split()
a = int(a)
b = int(b)
if a>b:
print('>')
elif a<b:
print('<')
else:
print('==')
#10 2
#>
# 2. 9498번 시험 성적
score = int(input())
if(score>=90):
print('A')
elif(score>=80):
print('B')
elif(score>=70):
print('C')
elif(score>=60):
print('D')
else:
print('F')
#97
#A
# 3. 2753번 윤년
year = int(input())
if((year%4==0)& ((year%100!=0)|(year%400==0))):
print(1)
else:
print(0)
# 2020
# 1
# 4. 14681번 사분면 고르기
x = int(input())
y = int(input())
if((x>0) & (y>0)):
print(1)
elif((x<0) & (y>0)):
print(2)
elif((x<0) & (y<0)):
print(3)
else:
print(4)
#10
#-3
#4
# 5. 2884번 알람 시계
from sys import stdin
H, M = input().split()
H = int(H)
M = int(M)
#H, M = list(map(int, stdin.readline().split()))
M = M-45
if M<0:
H = H-1
M = M+60
if H<0:
H = 23
print(H, M)
#10 20
#9 35
'코딩 연습 > Python' 카테고리의 다른 글
그리디 알고리즘 13305번 (0) | 2021.02.05 |
---|---|
그리디 알고리즘 11047번 (0) | 2021.02.05 |
4단계 for문 (0) | 2021.02.05 |
3단계 for문 (0) | 2021.02.05 |
1단계 입출력과 사칙연산 (0) | 2021.01.31 |