結果
問題 |
No.3249 AND
|
ユーザー |
![]() |
提出日時 | 2025-08-29 21:34:31 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,360 KB |
実行使用メモリ | 105,216 KB |
最終ジャッジ日時 | 2025-08-29 23:58:00 |
合計ジャッジ時間 | 3,288 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 WA * 1 |
ソースコード
N=int(input()) B=list(map(int,input().split())) ans = 0 for j in range(30): for i in range(N): if (B[i]>>j)&1==1: if ((i+1)>>j)&1==0: print(-1) exit() ans |= (1<<j) if ans == 0: for i in range(40): if (1<<i) > N: print(1<<i) exit() print(ans)