From 15d40fcce4f4d7d19915a57bbd50e1b69493e225 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Wed, 12 Feb 2025 23:56:13 +0900 Subject: [PATCH] =?UTF-8?q?[20250212]=20BOJ=20/=20=EA=B3=A8=EB=93=9C3=20/?= =?UTF-8?q?=20K=EC=A7=84=20=ED=8A=B8=EB=A6=AC=20/=20=EC=9D=B4=EA=B0=95?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...K\354\247\204 \355\212\270\353\246\254.md" | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 "lkhyun/202502/12 BOJ \352\263\250\353\223\2343 K\354\247\204 \355\212\270\353\246\254.md" diff --git "a/lkhyun/202502/12 BOJ \352\263\250\353\223\2343 K\354\247\204 \355\212\270\353\246\254.md" "b/lkhyun/202502/12 BOJ \352\263\250\353\223\2343 K\354\247\204 \355\212\270\353\246\254.md" new file mode 100644 index 00000000..3cbcd6b7 --- /dev/null +++ "b/lkhyun/202502/12 BOJ \352\263\250\353\223\2343 K\354\247\204 \355\212\270\353\246\254.md" @@ -0,0 +1,58 @@ +```java +import java.util.*; +import java.io.*; +public class Main{ + public static void main(String[] args) throws Exception{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + StringTokenizer st = new StringTokenizer(br.readLine()); + long N = Long.parseLong(st.nextToken()); + long K = Integer.parseInt(st.nextToken()); + long Q = Integer.parseInt(st.nextToken()); + + for(int i=0;i finder){ + finder *= K; + finder += 1; + depth++; + } + return depth; + } + public static long findParent(long x,long K){ + if(x%K==0 || x%K==1){ + return x/K; + }else{ + return x/K + 1; + } + } +} +```