結果

問題 No.1082 XORのXOR
ユーザー tentententen
提出日時 2022-08-04 14:10:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 1,253 bytes
コンパイル時間 2,812 ms
コンパイル使用メモリ 74,192 KB
実行使用メモリ 52,116 KB
最終ジャッジ日時 2023-10-12 11:40:31
合計ジャッジ時間 6,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,164 KB
testcase_01 AC 41 ms
49,216 KB
testcase_02 AC 42 ms
49,720 KB
testcase_03 AC 77 ms
51,356 KB
testcase_04 AC 77 ms
51,752 KB
testcase_05 AC 78 ms
51,756 KB
testcase_06 AC 76 ms
49,444 KB
testcase_07 AC 78 ms
51,168 KB
testcase_08 AC 77 ms
51,588 KB
testcase_09 AC 76 ms
51,676 KB
testcase_10 AC 77 ms
51,992 KB
testcase_11 AC 77 ms
51,188 KB
testcase_12 AC 77 ms
52,008 KB
testcase_13 AC 77 ms
51,304 KB
testcase_14 AC 78 ms
51,576 KB
testcase_15 AC 76 ms
51,992 KB
testcase_16 AC 77 ms
52,116 KB
testcase_17 AC 76 ms
51,828 KB
testcase_18 AC 77 ms
51,584 KB
testcase_19 AC 77 ms
51,608 KB
testcase_20 AC 77 ms
51,544 KB
testcase_21 AC 78 ms
51,420 KB
testcase_22 AC 78 ms
51,864 KB
testcase_23 AC 78 ms
51,796 KB
testcase_24 AC 78 ms
50,144 KB
testcase_25 AC 77 ms
51,248 KB
testcase_26 AC 77 ms
51,572 KB
testcase_27 AC 76 ms
51,556 KB
testcase_28 AC 42 ms
49,728 KB
testcase_29 AC 41 ms
49,284 KB
testcase_30 AC 41 ms
49,160 KB
testcase_31 AC 42 ms
49,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int[] values = new int[n];
        long ans = 0;
        for (int i = 0; i < n; i++) {
            values[i] = sc.nextInt();
        }
        int max = 0;
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                max = Math.max(max, values[i] ^ values[j]);
            }
        }
        System.out.println(max);
    }
}

class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0