結果
問題 | No.9 モンスターのレベル上げ |
ユーザー | nsd_fb |
提出日時 | 2015-02-19 04:56:48 |
言語 | Python2 (2.7.18) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 531 bytes |
コンパイル時間 | 70 ms |
コンパイル使用メモリ | 6,664 KB |
実行使用メモリ | 6,592 KB |
最終ジャッジ日時 | 2023-09-06 02:23:23 |
合計ジャッジ時間 | 42,590 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 13 ms
6,276 KB |
testcase_01 | AC | 13 ms
6,264 KB |
testcase_02 | AC | 4,236 ms
6,388 KB |
testcase_03 | AC | 3,323 ms
6,592 KB |
testcase_04 | AC | 1,783 ms
6,492 KB |
testcase_05 | AC | 1,178 ms
6,484 KB |
testcase_06 | AC | 419 ms
6,388 KB |
testcase_07 | AC | 19 ms
6,380 KB |
testcase_08 | AC | 553 ms
6,524 KB |
testcase_09 | AC | 4,117 ms
6,548 KB |
testcase_10 | AC | 12 ms
6,312 KB |
testcase_11 | AC | 3,947 ms
6,364 KB |
testcase_12 | TLE | - |
testcase_13 | AC | 3,916 ms
6,588 KB |
testcase_14 | AC | 4,125 ms
6,376 KB |
testcase_15 | AC | 3,768 ms
6,372 KB |
testcase_16 | AC | 77 ms
6,404 KB |
testcase_17 | AC | 2,427 ms
6,452 KB |
testcase_18 | AC | 2,035 ms
6,500 KB |
testcase_19 | AC | 51 ms
6,340 KB |
ソースコード
import heapq n = input() a = map(int, raw_input().split()) b = map(int, raw_input().split()) init = [] for level in a: init.append((level, 0)) heapq.heapify(init) ans = float("inf") for offset in xrange(-n, 0): queue = list(init) for i in xrange(offset, offset + n): level, battle = heapq.heappop(queue) heapq.heappush(queue, (level + b[i] // 2, battle + 1)) max_battle = 0 for level, battle in queue: max_battle = max(max_battle, battle) ans = min(ans, max_battle) print ans