結果

問題 No.804 野菜が苦手
ユーザー masato-fullmoonmasato-fullmoon
提出日時 2019-07-26 15:18:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 8,004 KB
最終ジャッジ日時 2023-09-15 00:21:34
合計ジャッジ時間 1,330 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,820 KB
testcase_02 AC 14 ms
7,776 KB
testcase_03 AC 14 ms
7,820 KB
testcase_04 AC 14 ms
7,848 KB
testcase_05 AC 15 ms
7,920 KB
testcase_06 AC 14 ms
7,824 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 13 ms
7,916 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
7,924 KB
testcase_15 AC 14 ms
7,856 KB
testcase_16 AC 15 ms
7,856 KB
testcase_17 AC 13 ms
7,872 KB
testcase_18 AC 14 ms
7,860 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

veg,meat,mul,limit = map(int,input().split())

assert 1<=veg<=100
assert 1<=meat<=100
assert 1<=mul<=100
assert 1<=limit<=100

vegs = []
for i in range(1,veg+1):
    for j in range(1,meat+1):
        if meat == i*mul:
            if limit > i+j:
                vegs.append(i)
            elif limit == i+j:
                vegs.append(i)

if len(vegs) > 1:
    print(max(vegs))
else:
    print(0)
0