We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 894616c commit ea64318Copy full SHA for ea64318
프로그래머스/2/12985. 예상 대진표/README.md
@@ -4,7 +4,7 @@
4
5
### 성능 요약
6
7
-메모리: 91.3 MB, 시간: 0.03 ms
+메모리: 87 MB, 시간: 0.03 ms
8
9
### 구분
10
@@ -16,7 +16,7 @@
16
17
### 제출 일자
18
19
-2025년 07월 01일 17:16:00
+2025년 07월 01일 17:37:02
20
21
### 문제 설명
22
프로그래머스/2/12985. 예상 대진표/예상 대진표.java
@@ -2,10 +2,10 @@ class Solution
2
{
3
public int solution(int n, int a, int b)
- int round = 0;
- while (a != b) {
- a = (a + 1) / 2; // 다음 라운드 번호
- b = (b + 1) / 2;
+ int round = 1;
+ while((a+1)/2 != (b+1)/2){
+ a = (a/2 + a%2);
+ b = (b/2 + b%2);
round++;
}
11
0 commit comments