Skip to content

Commit 0013544

Browse files
yongjun-0903unknown
andauthored
[오늘의 알고리즘] 예상 대진표 (#71)
Co-authored-by: unknown <Administrator@SKCC20N00129.SKCC.NET>
1 parent 5ebe3ac commit 0013544

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

yongjun-0903/예상 대진표.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def solution(n, a, b):
2+
if (a + 1) // 2 == (b + 1) // 2:
3+
return 1
4+
5+
next_a = (a + 1) // 2
6+
next_b = (b + 1) // 2
7+
8+
return 1 + solution(n // 2, next_a, next_b)

0 commit comments

Comments
 (0)