結果

問題 No.1674 Introduction to XOR
ユーザー AsahiAsahi
提出日時 2023-02-06 13:50:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 1,000 ms
コード長 825 bytes
コンパイル時間 1,998 ms
コンパイル使用メモリ 71,708 KB
実行使用メモリ 55,900 KB
最終ジャッジ日時 2023-09-18 01:26:44
合計ジャッジ時間 6,588 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,768 KB
testcase_01 AC 129 ms
55,760 KB
testcase_02 AC 128 ms
55,656 KB
testcase_03 AC 127 ms
55,784 KB
testcase_04 AC 124 ms
55,704 KB
testcase_05 AC 125 ms
55,824 KB
testcase_06 AC 126 ms
55,720 KB
testcase_07 AC 127 ms
55,392 KB
testcase_08 AC 126 ms
55,316 KB
testcase_09 AC 127 ms
55,680 KB
testcase_10 AC 126 ms
55,564 KB
testcase_11 AC 124 ms
55,520 KB
testcase_12 AC 125 ms
55,460 KB
testcase_13 AC 122 ms
55,676 KB
testcase_14 AC 131 ms
55,652 KB
testcase_15 AC 133 ms
53,848 KB
testcase_16 AC 130 ms
55,416 KB
testcase_17 AC 138 ms
55,500 KB
testcase_18 AC 130 ms
55,856 KB
testcase_19 AC 130 ms
54,040 KB
testcase_20 AC 132 ms
55,496 KB
testcase_21 AC 128 ms
55,628 KB
testcase_22 AC 134 ms
55,900 KB
testcase_23 AC 133 ms
55,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;
// import java.util.stream.Stream;

class Main{
    static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter output = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws IOException{
        int n = sc.nextInt();
        long [] A = new long[n];
        long OR = 0L;
        long answer = (long)1e18+1;
        for(int i=0;i<n;i++) A[i] = sc.nextLong();
        for(int i=0;i<n;i++) OR |= A[i];
        for(int i=0;i<=60;i++) {
            long bit = (OR>>i) & 1;
            if(bit == 0) {
                output.println((1L<<i));
                break;
            }
        }
        output.flush();
    }
}
0