結果

問題 No.23 技の選択
ユーザー lloyzlloyz
提出日時 2022-03-11 20:44:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 246 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 71,572 KB
最終ジャッジ日時 2023-10-14 05:12:09
合計ジャッジ時間 4,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,368 KB
testcase_01 AC 74 ms
71,328 KB
testcase_02 AC 74 ms
71,532 KB
testcase_03 AC 76 ms
71,292 KB
testcase_04 AC 74 ms
71,260 KB
testcase_05 AC 74 ms
71,000 KB
testcase_06 AC 73 ms
71,192 KB
testcase_07 AC 72 ms
71,388 KB
testcase_08 AC 73 ms
71,376 KB
testcase_09 AC 73 ms
71,408 KB
testcase_10 AC 73 ms
71,180 KB
testcase_11 AC 73 ms
71,492 KB
testcase_12 AC 72 ms
71,564 KB
testcase_13 AC 75 ms
71,196 KB
testcase_14 AC 74 ms
71,148 KB
testcase_15 AC 73 ms
71,308 KB
testcase_16 AC 76 ms
71,404 KB
testcase_17 AC 73 ms
71,572 KB
testcase_18 AC 74 ms
71,184 KB
testcase_19 AC 74 ms
71,184 KB
testcase_20 AC 74 ms
71,228 KB
testcase_21 AC 75 ms
71,280 KB
testcase_22 AC 74 ms
71,428 KB
testcase_23 AC 75 ms
71,408 KB
testcase_24 AC 78 ms
71,304 KB
testcase_25 AC 75 ms
71,004 KB
testcase_26 AC 75 ms
71,432 KB
testcase_27 AC 74 ms
71,188 KB
testcase_28 AC 74 ms
71,308 KB
testcase_29 AC 73 ms
71,564 KB
testcase_30 AC 76 ms
71,568 KB
testcase_31 AC 76 ms
71,204 KB
testcase_32 AC 75 ms
71,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, a, d = map(int, input().split())

ans = 10**18
if a >= d:
    ans = (h + a - 1) // a
else:
    cnt = 0
    while h >= 0:
        ans = min(ans, cnt + ((h + d - 1) // d) * 1.5)
        h -= a
        cnt += 1
    ans = min(ans, cnt)
print(ans)
0