cards=list(range(1,21))
for i in range(10):
try:
a,b=map(int,input().split())
target_part=cards[a-1:b] # 바꿀 부분 새로 리스트로 만들어두기
cards[a-1:b]=target_part[::-1]
except:
break
print(*cards)
import math
import sys
input=sys.stdin.readline
n,k=map(int,input().split())
b=[0]*7 # 0을 넣은 리스트 만들기
g=[0]*7
for i in range(n):
s,y=map(int,input().split())
if s==0:
g[y]+=1
else:
b[y]+=1
total_rooms=0
for i in range(1,7):
total_rooms+=math.ceil(g[i]/k) # math.ceil 사용
total_rooms+=math.ceil(b[i]/k)
print(total_rooms)
s=input()
k=input()
new_s='' # 문자열 만들기
for i in s:
if not i.isdigit(): # 숫자가 아니라면
new_s+=i
if k in new_s:
print(1)
else:
print(0)
No comments yet. Be the first to write!