結果

問題 No.804 野菜が苦手
ユーザー HagianHagian
提出日時 2021-06-21 17:11:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 276 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-09-05 01:54:42
合計ジャッジ時間 1,294 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 AC 16 ms
7,872 KB
testcase_02 AC 15 ms
7,868 KB
testcase_03 AC 15 ms
7,872 KB
testcase_04 AC 15 ms
7,940 KB
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 15 ms
7,948 KB
testcase_07 AC 15 ms
7,876 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,872 KB
testcase_10 AC 15 ms
7,872 KB
testcase_11 AC 15 ms
7,944 KB
testcase_12 AC 15 ms
7,876 KB
testcase_13 AC 15 ms
7,884 KB
testcase_14 AC 15 ms
7,992 KB
testcase_15 AC 15 ms
7,828 KB
testcase_16 AC 15 ms
7,884 KB
testcase_17 AC 15 ms
7,884 KB
testcase_18 AC 15 ms
7,932 KB
testcase_19 AC 15 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, C, D = input().split()
A, B, C, D = int(A), int(B), int(C), int(D)
res, su = 0, 0
for i in range(1, D):
    if i % 2 != 0:
        su += C
        B -= C
    else:
        res += 1
        su += 1
        A -= 1
    if su > D or A <= 0 or B < 0:
        break
print(res)
0