結果
問題 |
No.3249 AND
|
ユーザー |
![]() |
提出日時 | 2025-08-29 21:57:58 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 442 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 30,904 KB |
最終ジャッジ日時 | 2025-08-29 23:59:21 |
合計ジャッジ時間 | 3,671 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 WA * 1 |
ソースコード
N = int(input()) b_list = list(map(int, input().split())) a = N max_bit = 1 while a > 1: # print(max_b) max_bit += 1 a >>= 1 # print(max_bit) r = 0 for n in range(max_bit): k = 2**n if b_list[k - 1] == 2**n: r += 2**n else: continue is_true = True for n in range(N): if (n + 1) & r == b_list[n]: continue else: is_true = False if is_true: print(r) else: print(-1)