結果

問題 No.1674 Introduction to XOR
ユーザー merlinmerlin
提出日時 2021-09-10 21:29:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 1,000 ms
コード長 695 bytes
コンパイル時間 2,502 ms
コンパイル使用メモリ 72,088 KB
実行使用メモリ 49,824 KB
最終ジャッジ日時 2023-09-02 15:59:41
合計ジャッジ時間 4,610 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,412 KB
testcase_01 AC 42 ms
49,264 KB
testcase_02 AC 42 ms
49,024 KB
testcase_03 AC 43 ms
49,288 KB
testcase_04 AC 43 ms
49,464 KB
testcase_05 AC 42 ms
49,112 KB
testcase_06 AC 42 ms
49,364 KB
testcase_07 AC 43 ms
49,200 KB
testcase_08 AC 43 ms
49,108 KB
testcase_09 AC 42 ms
49,208 KB
testcase_10 AC 42 ms
49,076 KB
testcase_11 AC 42 ms
49,372 KB
testcase_12 AC 42 ms
49,364 KB
testcase_13 AC 42 ms
49,248 KB
testcase_14 AC 43 ms
49,100 KB
testcase_15 AC 45 ms
49,216 KB
testcase_16 AC 41 ms
49,412 KB
testcase_17 AC 44 ms
49,292 KB
testcase_18 AC 45 ms
49,112 KB
testcase_19 AC 45 ms
49,124 KB
testcase_20 AC 45 ms
49,824 KB
testcase_21 AC 41 ms
49,292 KB
testcase_22 AC 45 ms
49,060 KB
testcase_23 AC 44 ms
49,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,c[]=new int[63],j; long a;
        for(i=0;i<n;i++)
        {
            a=Long.parseLong(s[i]);
            for(j=0;j<63;j++)
            if(((a>>j)&1)==1) c[j]++;
        }

        long ans=0;
        for(i=0;i<63;i++)
        if(c[i]==0)
        {
            ans=1l<<i;
            break;
        }
        System.out.println(ans);
    }
}
0