結果
問題 |
No.3249 AND
|
ユーザー |
![]() |
提出日時 | 2025-08-30 15:01:02 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 460 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 82,400 KB |
実行使用メモリ | 106,752 KB |
最終ジャッジ日時 | 2025-08-30 15:01:07 |
合計ジャッジ時間 | 4,201 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 WA * 3 |
ソースコード
N = int(input()) B = list(map(int, input().split())) if B.count(0) == 0: exit(print(1<<N.bit_count())) ans = [-1]*20 for i in range(N): for j in range(20): if not 1<<j & (i+1): if 1<<j & B[i]: exit(print(-1)) continue if ans[j] != -1 and ans[j] != (B[i]>>j & 1): exit(print(-1)) ans[j] = B[i]>>j & 1 n = 0 for i in range(20): if ans[i] == 1: n |= 1<<i print(n)