From f724a64b3677fc49a10107c3d1ebf5ad359528be Mon Sep 17 00:00:00 2001 From: oncsr Date: Tue, 15 Jul 2025 22:38:40 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[20250715]=20BOJ=20/=20P3=20/=20=EC=9E=90?= =?UTF-8?q?=EB=A6=AC=20=EB=B0=94=EA=BE=B8=EA=B8=B0=20/=20=EA=B6=8C?= =?UTF-8?q?=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 \353\260\224\352\276\270\352\270\260.md" | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 "khj20006/202507/15 BOJ P3 \354\236\220\353\246\254 \353\260\224\352\276\270\352\270\260.md" diff --git "a/khj20006/202507/15 BOJ P3 \354\236\220\353\246\254 \353\260\224\352\276\270\352\270\260.md" "b/khj20006/202507/15 BOJ P3 \354\236\220\353\246\254 \353\260\224\352\276\270\352\270\260.md" new file mode 100644 index 00000000..1e4c6703 --- /dev/null +++ "b/khj20006/202507/15 BOJ P3 \354\236\220\353\246\254 \353\260\224\352\276\270\352\270\260.md" @@ -0,0 +1,136 @@ +```java +import java.util.*; +import java.io.*; + +class IOController { + BufferedReader br; + BufferedWriter bw; + StringTokenizer st; + + public IOController() { + br = new BufferedReader(new InputStreamReader(System.in)); + bw = new BufferedWriter(new OutputStreamWriter(System.out)); + st = new StringTokenizer(""); + } + + String nextLine() throws Exception { + String line = br.readLine(); + st = new StringTokenizer(line); + return line; + } + + String nextToken() throws Exception { + while (!st.hasMoreTokens()) nextLine(); + return st.nextToken(); + } + + int nextInt() throws Exception { + return Integer.parseInt(nextToken()); + } + + long nextLong() throws Exception { + return Long.parseLong(nextToken()); + } + + double nextDouble() throws Exception { + return Double.parseDouble(nextToken()); + } + + void close() throws Exception { + bw.flush(); + bw.close(); + } + + void write(String content) throws Exception { + bw.write(content); + } + +} + +class Node { + int x, y, z; + Node(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + +} + +public class Main { + + static IOController io; + + // + + static int N, K; + static int[] a; + static int[] cnt; + static int[][] dist; + + static long ans = 0; + + public static void main(String[] args) throws Exception { + + io = new IOController(); + + init(); + solve(); + + io.close(); + + } + + public static void init() throws Exception { + + N = io.nextInt(); + K = io.nextInt(); + a = new int[N]; + cnt = new int[K+1]; + dist = new int[K+1][N]; + for(int i=0;i()); + io.write(ans + "\n"); + + } + + static void perm(int count, int state, List list) { + if(count == K) { + int idx = 0; + long res = 0; + for(int i:list) { + res += dist[i][idx]; + idx += cnt[i]; + } + ans = Math.min(ans, res); + return; + } + for(int i=1;i<=K;i++) if((state & (1< Date: Tue, 15 Jul 2025 22:39:21 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[20250714]=20BOJ=20/=20P3=20/=20=EB=A1=9C?= =?UTF-8?q?=EB=B2=84=ED=8A=B8=20=ED=9B=84=EB=93=9C=20/=20=EA=B6=8C?= =?UTF-8?q?=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "khj20006/202507/[BOJ-9240] \353\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md" => "khj20006/202507/14 BOJ P3 \353\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md" (100%) diff --git "a/khj20006/202507/[BOJ-9240] \353\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md" "b/khj20006/202507/14 BOJ P3 \353\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md" similarity index 100% rename from "khj20006/202507/[BOJ-9240] \353\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md" rename to "khj20006/202507/14 BOJ P3 \353\241\234\353\262\204\355\212\270 \355\233\204\353\223\234.md"