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" 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<