1. Problem
2. My Solution
year = int(input())
if year % 4 == 0 and year % 100 != 0:
print(1)
elif year % 400 == 0:
print(1)
else:
print(0)
3. Others' Solutions
y = int(input())
print((y%400<1,y%4<1)[y%100>0]) # 튜플()[인덱스]
4. Learned
1. Problem
2. My Solution
H,M = map(int,input().split())
if M >= 45:
print(f"{H} {M-45}")
elif H == 0:
print(f"23 {M+60-45}")
else:
print(f"{H-1} {M+60-45}")
3. Others' Solutions
h,m=map(int,input().split())
m-=45
print((h-(m<0))%24,m%60)
4. Learned
1. Problem
2. My Solution
count = int(input())
for i in range(0,count):
a,b = map(int,input().split())
print(a+b)
3. Others' Solutions
import sys
count = int(sys.stdin.readline().strip())
for i in range(0,count):
a,b = map(int,sys.stdin.readline().strip().split())
print(a+b)
4. Learned
1. Problem
2. My Solution
import sys
n = int(sys.stdin.readline().strip())
for i in range(1,n+1):
print(" " * (n-i), "*" *i,sep='')
3. Others' Solutions
i=int(input())
j=1
exec('print(" "*(i-j)+"*"*j);j+=1;'*i)
4. Learned
1. Problem
2. My Solution
import sys
while(True):
a,b = map(int,sys.stdin.readline().strip().split())
print(a+b)
3. Others' Solutions
import sys
while(True):
try:
a,b = map(int,sys.stdin.readline().strip().split())
print(a+b)
except:
break
4. Learned
1. Problem
2. My Solution
import sys
preNum = n = int(sys.stdin.readline().strip())
cycle = 0
while(True):
addNum = (preNum // 10) + (preNum % 10) # 각 자리의 수를 더함
newNum = str((preNum % 10)) + str((addNum % 10)) # 원래 수 오른쪽 값과 새로 생긴 수 오른쪽 값을 더함
preNum = newNum = int(newNum)
cycle += 1
if newNum == n :
break
print(cycle)
3. Others' Solutions
import sys
preNum = n = int(sys.stdin.readline().strip())
cycle = 0
while(True):
addNum = (preNum // 10) + (preNum % 10) # 각 자리의 수를 더함
newNum = ((preNum % 10)*10) + (addNum % 10) # 원래 수 오른쪽 값과 새로 생긴 수 오른쪽 값을 더함
cycle += 1
if newNum == n :
break
preNum = newNum
print(cycle)
4. Learned