Skip to content

Commit ea64318

Browse files
committed
[level 2] Title: 예상 대진표, Time: 0.03 ms, Memory: 87 MB -BaekjoonHub
1 parent 894616c commit ea64318

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

프로그래머스/2/12985. 예상 대진표/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### 성능 요약
66

7-
메모리: 91.3 MB, 시간: 0.03 ms
7+
메모리: 87 MB, 시간: 0.03 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2025년 07월 01일 17:16:00
19+
2025년 07월 01일 17:37:02
2020

2121
### 문제 설명
2222

프로그래머스/2/12985. 예상 대진표/예상 대진표.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ class Solution
22
{
33
public int solution(int n, int a, int b)
44
{
5-
int round = 0;
6-
while (a != b) {
7-
a = (a + 1) / 2; // 다음 라운드 번호
8-
b = (b + 1) / 2;
5+
int round = 1;
6+
while((a+1)/2 != (b+1)/2){
7+
a = (a/2 + a%2);
8+
b = (b/2 + b%2);
99
round++;
1010
}
1111

0 commit comments

Comments
 (0)