結果

問題 No.1674 Introduction to XOR
ユーザー ossa_2019ossa_2019
提出日時 2021-09-11 00:43:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 602 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 71,636 KB
最終ジャッジ日時 2023-09-03 15:00:23
合計ジャッジ時間 3,608 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,408 KB
testcase_01 AC 75 ms
71,128 KB
testcase_02 AC 77 ms
71,132 KB
testcase_03 AC 75 ms
71,232 KB
testcase_04 AC 76 ms
71,460 KB
testcase_05 AC 75 ms
71,312 KB
testcase_06 AC 75 ms
71,636 KB
testcase_07 AC 77 ms
71,516 KB
testcase_08 AC 78 ms
71,412 KB
testcase_09 AC 77 ms
71,544 KB
testcase_10 AC 77 ms
71,464 KB
testcase_11 AC 74 ms
71,236 KB
testcase_12 AC 74 ms
71,380 KB
testcase_13 AC 75 ms
71,304 KB
testcase_14 AC 77 ms
71,440 KB
testcase_15 AC 76 ms
71,304 KB
testcase_16 AC 75 ms
71,488 KB
testcase_17 AC 75 ms
71,456 KB
testcase_18 AC 76 ms
71,268 KB
testcase_19 AC 76 ms
71,292 KB
testcase_20 AC 76 ms
71,468 KB
testcase_21 AC 76 ms
71,328 KB
testcase_22 AC 76 ms
71,408 KB
testcase_23 AC 75 ms
71,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def main(inp, inps):
    N = int(inp())
    A = list(map(int, inp().split()))
    sum_A = 0
    for a in A:
        sum_A |= a
    ans = sum_A + 1
    for i, b in enumerate(map(int, (bin(sum_A)[2:])[::-1])):
        if not b:
            ans = 2**i
            break
    print(ans)


main(stdin.readline, stdin.readlines)
0