From 5387f87ee8556822d58cfc1fdcf65546fe89d2c3 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Sun, 19 Oct 2025 16:49:04 +0900 Subject: [PATCH] =?UTF-8?q?[20251019]=20PGM=20/=20Lv2=20/=20=EC=98=88?= =?UTF-8?q?=EC=83=81=20=EB=8C=80=EC=A7=84=ED=91=9C=20/=20=EC=9D=B4?= =?UTF-8?q?=EA=B0=95=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement solution for predicting matchups in a tournament. --- ...3\201 \353\214\200\354\247\204\355\221\234.md" | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 "lkhyun/202510/19 PGM Lv2 \354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.md" diff --git "a/lkhyun/202510/19 PGM Lv2 \354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.md" "b/lkhyun/202510/19 PGM Lv2 \354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.md" new file mode 100644 index 00000000..d1fb6b09 --- /dev/null +++ "b/lkhyun/202510/19 PGM Lv2 \354\230\210\354\203\201 \353\214\200\354\247\204\355\221\234.md" @@ -0,0 +1,15 @@ +```java +class Solution +{ + public int solution(int n, int a, int b) + { + int answer = 1; + while((a/2 == b/2) || Math.abs(a-b) != 1){ + a = a/2 + a%2; + b = b/2 + b%2; + answer++; + } + return answer; + } +} +```