結果
| 問題 |
No.3281 Pacific White-sided Dolphin vs Monster
|
| コンテスト | |
| ユーザー |
kidodesu
|
| 提出日時 | 2025-09-26 22:40:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 640 bytes |
| コンパイル時間 | 332 ms |
| コンパイル使用メモリ | 82,096 KB |
| 実行使用メモリ | 93,932 KB |
| 最終ジャッジ日時 | 2025-09-26 22:40:51 |
| 合計ジャッジ時間 | 5,577 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 10 |
ソースコード
n = int(input())
H = list(map(int, input().split()))
H.sort()
ans = 0
if n > 63:
ans += n - 63
H = H[:63]
n = 63
def f(a, t):
if a >> t & 1:
now = t + 1
while a >> now & 1:
now += 1
s = 1 << now
a = a // s * s + s
return a
m = n
for i in range(63):
ans += 1
if H[0] <= 1 << i:
H[0] = 0
else:
for j in range(m):
if H[j] >> i & 1:
H[j] ^= 1 << i
break
H.sort()
if H[0] == 0:
H = H[1:]
m -= 1
if m == 0:
break
H = [f(H[j], i) for j in range(m)]
print(ans)
kidodesu