結果

問題 No.740 幻の木
ユーザー ohanaohana
提出日時 2023-10-27 15:10:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 182 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 59,740 KB
最終ジャッジ日時 2024-09-25 13:02:00
合計ジャッジ時間 1,138 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, p, q = map(int, input().split())

cnt = 0
while n > 0:
    cnt += 1
    if p <= (cnt % 12 if cnt % 12 else 12) < p + q:
        n -= 2 * m
    else:
        n -= m

print(cnt)
0