結果

問題 No.1082 XORのXOR
ユーザー ks2mks2m
提出日時 2020-06-19 21:29:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 231 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 3,406 ms
コンパイル使用メモリ 71,900 KB
実行使用メモリ 60,800 KB
最終ジャッジ日時 2023-09-16 13:25:22
合計ジャッジ時間 10,879 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,800 KB
testcase_01 AC 122 ms
55,800 KB
testcase_02 AC 122 ms
56,340 KB
testcase_03 AC 230 ms
58,564 KB
testcase_04 AC 231 ms
58,964 KB
testcase_05 AC 227 ms
58,432 KB
testcase_06 AC 229 ms
58,388 KB
testcase_07 AC 224 ms
58,744 KB
testcase_08 AC 230 ms
59,212 KB
testcase_09 AC 229 ms
58,684 KB
testcase_10 AC 231 ms
58,924 KB
testcase_11 AC 226 ms
58,460 KB
testcase_12 AC 231 ms
59,164 KB
testcase_13 AC 230 ms
58,964 KB
testcase_14 AC 230 ms
58,588 KB
testcase_15 AC 229 ms
58,812 KB
testcase_16 AC 226 ms
58,184 KB
testcase_17 AC 229 ms
58,616 KB
testcase_18 AC 230 ms
58,724 KB
testcase_19 AC 229 ms
58,960 KB
testcase_20 AC 231 ms
58,652 KB
testcase_21 AC 231 ms
58,604 KB
testcase_22 AC 230 ms
58,860 KB
testcase_23 AC 229 ms
58,172 KB
testcase_24 AC 229 ms
60,800 KB
testcase_25 AC 226 ms
58,664 KB
testcase_26 AC 228 ms
58,916 KB
testcase_27 AC 226 ms
58,684 KB
testcase_28 AC 119 ms
53,992 KB
testcase_29 AC 120 ms
55,780 KB
testcase_30 AC 120 ms
55,344 KB
testcase_31 AC 121 ms
55,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		sc.close();

		int ans = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				ans = Math.max(ans, a[i] ^ a[j]);
			}
		}
		System.out.println(ans);
	}
}
0