結果
問題 |
No.740 幻の木
|
ユーザー |
|
提出日時 | 2020-07-07 02:26:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 88 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-25 02:22:18 |
合計ジャッジ時間 | 902 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
N, M, P, Q = map(int, input().split()) month_two = Q Q = P + Q - 1 month_one = 12 - month_two yearlost = (M * month_one) + ((2 * M) * month_two) ans = (N // yearlost) * 12 remain = N % yearlost if remain == 0: print(ans) else: for i in range(1, 13): if Q >= i >= P: remain -= 2 * M ans += 1 else: remain -= M ans += 1 if remain <= 0: print(ans) break