結果
| 問題 | No.3550 Another Rurumaru Function Problem |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-04-23 00:28:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 397 bytes |
| 記録 | |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 103,552 KB |
| 最終ジャッジ日時 | 2026-05-22 21:47:15 |
| 合計ジャッジ時間 | 5,430 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 13 WA * 28 |
ソースコード
def f(x, y):
res = 0
for i in range(max(x.bit_length(), y.bit_length())):
xi = (x >> i) & 1
yi = (y >> i) & 1
if i % 2 == 0:
res |= (xi & yi) << i
else:
res |= (xi | yi) << i
return res
N = int(input())
A = [int(s) for s in input().split()]
A.sort()
dp = A[0]
for i in range(1, N):
dp = max(f(dp, A[i]), A[i])
print(dp)