結果

問題 No.740 幻の木
ユーザー TeepaBlueTeepaBlue
提出日時 2018-10-13 17:20:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 421 ms / 2,000 ms
コード長 552 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-20 20:06:53
合計ジャッジ時間 1,291 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 27 ms
10,880 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 27 ms
10,752 KB
testcase_05 AC 28 ms
10,752 KB
testcase_06 AC 421 ms
10,752 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 32 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l = input().split()
l = list(map(int,l))
leaves = l[0]
fallen = l[1]
wind_season  = l[2]
wind_lasting = l[3]
month = 1
wind_count = 0
count = 0
is_wind = False

while True:
    if leaves <= 0:
        print(count)
        break
    if month == wind_season:
        is_wind = True
    if is_wind:
        wind_count += 1
    if wind_count > wind_lasting:
        wind_count = 0
        is_wind = False
    if is_wind:
        leaves -= (fallen * 2)
    else:
        leaves -= fallen
    count += 1
    month += 1
    if month == 13:
        month = 1

0