結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2016-07-27 00:30:46 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,210 ms / 5,000 ms |
| コード長 | 354 bytes |
| コンパイル時間 | 283 ms |
| コンパイル使用メモリ | 76,964 KB |
| 実行使用メモリ | 90,012 KB |
| 最終ジャッジ日時 | 2024-06-23 23:39:59 |
| 合計ジャッジ時間 | 13,465 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
import heapq as hpq def solve(): N = int(raw_input()) ans = N+1 Q = [(a,0) for a in map(int,raw_input().split())] hpq.heapify(Q) B = map(int,raw_input().split()) for i in xrange(N): q = Q[:] for j in xrange(N): lv,cnt = hpq.heappop(q) hpq.heappush(q,(lv+B[(i+j)%N]/2,cnt+1)) ans = min(ans,max(q,key=lambda x:x[1])[1]) print ans solve()
Tawara