From e4be29334cc2f93a0bfcc9d5cf8157de252d883d Mon Sep 17 00:00:00 2001 From: oncsr Date: Mon, 16 Jun 2025 18:44:05 +0900 Subject: [PATCH] =?UTF-8?q?[20250616]=20BOJ=20/=20P3=20/=20Xor=20Maximizat?= =?UTF-8?q?ion=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/202506/16 BOJ P3 Xor Maximization.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 khj20006/202506/16 BOJ P3 Xor Maximization.md diff --git a/khj20006/202506/16 BOJ P3 Xor Maximization.md b/khj20006/202506/16 BOJ P3 Xor Maximization.md new file mode 100644 index 00000000..9c5d4069 --- /dev/null +++ b/khj20006/202506/16 BOJ P3 Xor Maximization.md @@ -0,0 +1,99 @@ +```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 long[] A; + + public static void main(String[] args) throws Exception { + + io = new IOController(); + + init(); + solve(); + + io.close(); + + } + + public static void init() throws Exception { + + N = io.nextInt(); + A = new long[N]; + for(int i=0;i=0;k--) if((A[i] & (1L<=0;k--) ans = Math.max(ans, ans ^ basis[k]); + io.write(ans + "\n"); + + } + +} +```