結果
| 問題 |
No.3281 Pacific White-sided Dolphin vs Monster
|
| コンテスト | |
| ユーザー |
kidodesu
|
| 提出日時 | 2025-09-26 22:31:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 640 bytes |
| コンパイル時間 | 295 ms |
| コンパイル使用メモリ | 82,448 KB |
| 実行使用メモリ | 93,864 KB |
| 最終ジャッジ日時 | 2025-09-26 22:31:51 |
| 合計ジャッジ時間 | 5,039 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 10 |
ソースコード
n = int(input())
H = list(map(int, input().split()))
H.sort()
ans = 0
if n > 60:
ans += n - 60
H = H[:60]
n = 60
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(61):
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