From 8fe5e52ccbebc0af4bb25592b1e9893c1544ec08 Mon Sep 17 00:00:00 2001 From: oncsr Date: Thu, 31 Jul 2025 12:55:11 +0900 Subject: [PATCH] =?UTF-8?q?[20250731]=20BOJ=20/=20G1=20/=20Team=20Selectio?= =?UTF-8?q?n=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 --- khj20006/202507/31 BOJ G1 Team Selection.md | 94 +++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 khj20006/202507/31 BOJ G1 Team Selection.md diff --git a/khj20006/202507/31 BOJ G1 Team Selection.md b/khj20006/202507/31 BOJ G1 Team Selection.md new file mode 100644 index 00000000..dd70d55b --- /dev/null +++ b/khj20006/202507/31 BOJ G1 Team Selection.md @@ -0,0 +1,94 @@ +```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); + } + +} + +public class Main { + + static IOController io; + + // + + static int N; + static int[][] arr; + + public static void main(String[] args) throws Exception { + + io = new IOController(); + + init(); + solve(); + + io.close(); + + } + + static void init() throws Exception { + + N = io.nextInt(); + arr = new int[N+1][]; + for(int i=1;i<=N;i++) arr[i] = new int[]{io.nextInt(),io.nextInt(),io.nextInt(),io.nextInt(),io.nextInt()}; + + } + + static void solve() throws Exception { + + int[] dp = new int[32]; + for(int i=1;i<=N;i++) { + int[] ndp = new int[32]; + for(int j=0;j<32;j++) ndp[j] = dp[j]; + for(int j=0;j<5;j++) for(int k=0;k<32;k++) if((k & (1<