結果
問題 |
No.3249 AND
|
ユーザー |
![]() |
提出日時 | 2025-08-29 21:31:05 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 405 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 82,372 KB |
実行使用メモリ | 106,856 KB |
最終ジャッジ日時 | 2025-08-29 23:57:45 |
合計ジャッジ時間 | 4,490 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 20 WA * 1 |
ソースコード
N = int(input()) B = list(map(int, input().split())) 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)