[지코바] solved.ac CLASS 2 Part 6
2869) 달팽이는 올라가고 싶다
a, b, v = list(map(int, input().split()))
day = (v-b) // (a-b)
margin = (v-b) % (a-b)
if margin > 0:
print(day+1)
else:
print(day)
4153) 직각삼각형
def isRight(compare: bool):
return 'right' if compare else 'wrong'
while True:
a, b, c = list(map(int, input().split()))
if a == 0 and b == 0 and c == 0:
break
result = isRight((a*a + b*b == c*c) or (a*a + c*c == b*b) or (b*b + c*c == a*a))
print(result)
4949) 균형잡힌 세상
def isYes(compare: bool):
return 'yes' if compare else 'no'
while True:
sentence = input()
stack = []
openParenthesis = True
if sentence == '.':
break
for character in list(sentence):
if character == '(' or character == '[':
stack.append(character)
elif character == ')':
if len(stack) > 0 and stack[len(stack)-1] == '(':
stack.pop()
else:
openParenthesis = False
break
elif character == ']':
if len(stack) > 0 and stack[len(stack)-1] == '[':
stack.pop()
else:
openParenthesis = False
break
print(isYes(len(stack) == 0 and openParenthesis))
7568) 덩치
n = int(input())
people = []
rank = []
for index in range(0, n):
x, y = list(map(int, input().split()))
people.append([x, y])
rank.append(1)
for index in range(0, n):
for subIndex in range(0, n):
if index == subIndex:
continue
if people[index][0] < people[subIndex][0] and people[index][1] < people[subIndex][1]:
rank[index] = rank[index] + 1
print(' '.join(str(element) for element in rank))
9012) 괄호
def isYes(compare: bool):
return 'YES' if compare else 'NO'
t = int(input())
for index in range (0, t):
parenthesisString = input()
isValidParenthesisString = True
stack = []
for parenthesis in list(parenthesisString):
if parenthesis == '(' :
stack.append(parenthesis)
elif parenthesis == ')':
if len(stack) > 0 and stack[len(stack)-1] == '(':
stack.pop()
else:
isValidParenthesisString = False
break
if len(stack) > 0:
isValidParenthesisString = False
print(isYes(isValidParenthesisString))
10250) ACM 호텔
t = int(input())
while t > 0:
t = t - 1
h, w, n = list(map(int, input().split()))
floor = 1
room = 1
if h > 1 and w > 1:
floor = (n-1) % h + 1
room = (n-1) // h + 1
elif h == 1:
room = n
elif w == 1:
floor = n
result = floor*100 + room
print(result)
Author And Source
이 문제에 관하여([지코바] solved.ac CLASS 2 Part 6), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@onehunnitconst/지코바-solved.ac-CLASS-2-Part-6저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)