From d02503f6de31844fab67027a7c3dd3fb7dcf9b5c Mon Sep 17 00:00:00 2001 From: oncsr Date: Mon, 3 Feb 2025 16:08:20 +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=EA=B6=8C=ED=98=81=EC=A4=80?= 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" | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 "khj20006/202502/03 BOJ G4 \353\241\234\353\230\220.md" diff --git "a/khj20006/202502/03 BOJ G4 \353\241\234\353\230\220.md" "b/khj20006/202502/03 BOJ G4 \353\241\234\353\230\220.md" new file mode 100644 index 00000000..21288614 --- /dev/null +++ "b/khj20006/202502/03 BOJ G4 \353\241\234\353\230\220.md" @@ -0,0 +1,43 @@ +```java + +import java.util.*; +import java.io.*; + +class Main { + + // IO field + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringTokenizer st; + + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + static long nextLong() {return Long.parseLong(st.nextToken());} + static void bwEnd() throws Exception {bw.flush();bw.close();} + + // Additional field + + + public static void main(String[] args) throws Exception { + + long[][] dp = new long[11][2001]; + for(int i=1;i<=2000;i++) dp[1][i] = i; + for(int i=2;i<=10;i++) { + for(int j=1;j<=2000;j++) dp[i][j] = dp[i][j-1] + dp[i-1][j/2]; + } + + nextLine(); + int T = nextInt(); + + while(T-- > 0) { + nextLine(); + int n = nextInt(), m = nextInt(); + bw.write(dp[n][m]+"\n"); + } + + bwEnd(); + } + +} + +```