結果
| 問題 | No.3281 Pacific White-sided Dolphin vs Monster | 
| コンテスト | |
| ユーザー |  kidodesu | 
| 提出日時 | 2025-09-26 22:55:02 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 108 ms / 2,000 ms | 
| コード長 | 422 bytes | 
| コンパイル時間 | 323 ms | 
| コンパイル使用メモリ | 82,852 KB | 
| 実行使用メモリ | 93,460 KB | 
| 最終ジャッジ日時 | 2025-10-03 17:37:24 | 
| 合計ジャッジ時間 | 4,931 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 51 | 
ソースコード
n = int(input())
H = list(map(int, input().split()))
H.sort()
ans = 0
if n > 63:
    ans += n - 63
    H = H[:63]
    n = 63
now = 0
while 1:
    M = H[:]
    for i in range(now-1, -1, -1):
        M.sort(reverse = True)
        t = 1 << i
        M[0] -= t
        if M[0] <= 0:
            M = M[1:]
        if not M:
            print(now + ans)
            exit()
        M.sort(reverse = True)
    now += 1
        
            
            
            
        