From ac95a535725802ee08be799e125f7b24d469f8d4 Mon Sep 17 00:00:00 2001 From: Jinyeong Seol Date: Mon, 3 Feb 2025 14:10:52 +0900 Subject: [PATCH] =?UTF-8?q?[20250203]=20BOJ=20/=20=EA=B3=A8=EB=93=9C4=20/?= =?UTF-8?q?=20=EB=A1=9C=EB=98=90=20/=20=EC=84=A4=EC=A7=84=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../03 BOJ G4 \353\241\234\353\230\220.md" | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 "Seol-JY/202502/03 BOJ G4 \353\241\234\353\230\220.md" diff --git "a/Seol-JY/202502/03 BOJ G4 \353\241\234\353\230\220.md" "b/Seol-JY/202502/03 BOJ G4 \353\241\234\353\230\220.md" new file mode 100644 index 00000000..d1be20c1 --- /dev/null +++ "b/Seol-JY/202502/03 BOJ G4 \353\241\234\353\230\220.md" @@ -0,0 +1,31 @@ +```java +import java.io.*; +import java.util.*; + +public class Main { + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + long[][] arr = new long[101][2_001]; + + for (long i = 1; i < 2_001; i++) { + arr[1][(int)i] = i; + } + + for (long i = 2; i < 101; i++) { + for (long j = 1; j < 2_001; j++) { + arr[(int)i][(int)j] = arr[(int)i][(int)(j-1)] + arr[(int)(i-1)][(int)(j/2)]; + } + } + + long T = Long.parseLong(br.readLine()); + + for (long i = 0; i < T; i++) { + StringTokenizer st = new StringTokenizer(br.readLine()); + long n = Long.parseLong(st.nextToken()); + long m = Long.parseLong(st.nextToken()); + System.out.println(arr[(int)n][(int)m]); + } + } +} +```