Post

[BOJ] 10250. ACM ํ˜ธํ…”(python)

๐Ÿ“Œ๋ฌธ์ œ

Alt text Alt text

๐Ÿ’ช์•„์ด๋””์–ด

  1. ์ธต/ํ˜ธ ์ •ํ•˜๊ธฐ
    • n % h == 0? ํŒ๋‹จ
ย n%h== 0> 0
ย ย h์ธตn % h์ธต
ย ย n//hํ˜ธn//h+1ํ˜ธ
  1. ํ˜ธ์ˆ˜ 2์ž๋ฆฌ ์ถœ๋ ฅ
    format(val,โ€™02โ€™)

    ๐Ÿฅ‚์ฝ”๋“œ

1
2
3
4
5
6
7
8
9
10
T = int(input())
for _ in range(T):
    h,w,n = map(int,input().split())
    if n%h:
        room = n//h + 1
        floor = n%h
    else:
        room = n//h
        floor = h
    print(str(floor)+format(room,'02'))
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.