본문 바로가기
짜잘IT

22.09.10 백준풀이

by 정람지 2022. 9. 10.

<백준 1869번 달팽이는 올라가고 싶다>

from sys import stdin
A, B, V = map(int, stdin.readline().split())
if (V-B)%(A-B) == 0:
     print(int((V-B)/(A-B)))
else:
    print((V-B)//(A-B) + 1)

달팽달팽 성공!


<백준 10250번 ACM 호텔>

from sys import stdin
n = int(stdin.readline())
for _ in range(n):
    H, W, N = map(int, stdin.readline().split())
    A = N % H
    if A == 0:
        A = H
    B = N // H +1
    
    if B // 10 == 0:
        print("{}0{}".format(A,B))
    else:
        print("{}{}".format(A,B))

틀렸습니다..

게시판에다 질문해야지

from sys import stdin
n = int(stdin.readline())
for _ in range(n):
    H, W, N = map(int, stdin.readline().split())
    A = N % H
    B = N // H +1
    if A == 0:
        A = H
        B = N // H
    
    if B // 10 == 0:
        print("{}0{}".format(A,B))
    else:
        print("{}{}".format(A,B))

성공했습니다!!

 

문제는 내가 손님번호가 층 수로 정확히 나누어떨어질 때 층수만 다른 케이스와 차이가 난다고 생각했기 때문이다.

방 번호에도 차이가 난다..

꼼꼼함을 키워야 함

 

 

'짜잘IT' 카테고리의 다른 글

화남하루혼공(//-^ㅏ)  (0) 2023.01.07
❄️대외활동 탐색❄️  (0) 2022.12.02
22.09.08 - C언어  (0) 2022.09.08
22.09.08 백준풀이  (0) 2022.09.08
22.09.06 백준풀이  (0) 2022.09.06