結果
問題 | No.130 XOR Minimax |
ユーザー |
![]() |
提出日時 | 2015-01-17 00:17:05 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,319 bytes |
コンパイル時間 | 2,164 ms |
コンパイル使用メモリ | 78,364 KB |
実行使用メモリ | 67,536 KB |
最終ジャッジ日時 | 2024-06-22 13:15:31 |
合計ジャッジ時間 | 23,648 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 16 |
ソースコード
import java.io.BufferedInputStream; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; import java.util.Map.Entry; public class Main { public static final int C = 1000000007; static final int CY = 1000000000; //static boolean MAP[][]; static int N; static long M; static int MAX = -1; //static int tic[][]; static int A[]; //static int max; static int DP[][][]; static int ST[][]; //static int p[]; //static ArrayList<HashSet<Integer>> al; static TreeMap<Integer, ArrayList<Integer>> hm; //static ArrayList<Integer> al; //static int a[][]; //static char[][] ch; //static ArrayList<HashMap<Long, Long>> al; //static String a[]; //static String str; public static void main(String[] args) { //StringBuilder sb = new StringBuilder(); BufferedInputStream bs = new BufferedInputStream(System.in); Scanner sc = new Scanner(bs); N = sc.nextInt(); A= new int[N]; for (int i=0; i < N; i++) { A[i] = Integer.parseInt(sc.next()); } //BigInteger bi = new BigInteger("0"); long ans = Integer.MAX_VALUE; for (int i=0; i < N; i++){ int max = 0; for (int t=0; t < N; t++) { max = Math.max(max, A[i] ^ A[t]); } ans = Math.min(ans, max); } System.out.println(ans); } }