結果

問題 No.804 野菜が苦手
ユーザー taktak
提出日時 2019-03-27 16:11:37
言語 F#
(.NET 7)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 4,210 ms
コンパイル使用メモリ 162,056 KB
実行使用メモリ 24,368 KB
最終ジャッジ日時 2023-08-01 10:27:37
合計ジャッジ時間 6,822 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
24,308 KB
testcase_01 AC 63 ms
22,280 KB
testcase_02 AC 65 ms
24,368 KB
testcase_03 AC 64 ms
20,280 KB
testcase_04 AC 64 ms
20,148 KB
testcase_05 AC 65 ms
24,304 KB
testcase_06 AC 63 ms
22,440 KB
testcase_07 AC 65 ms
24,332 KB
testcase_08 AC 64 ms
22,320 KB
testcase_09 AC 63 ms
22,268 KB
testcase_10 AC 62 ms
24,328 KB
testcase_11 AC 63 ms
22,312 KB
testcase_12 AC 63 ms
22,300 KB
testcase_13 AC 62 ms
24,292 KB
testcase_14 AC 62 ms
20,292 KB
testcase_15 AC 62 ms
22,276 KB
testcase_16 AC 62 ms
22,328 KB
testcase_17 AC 61 ms
22,304 KB
testcase_18 AC 63 ms
22,304 KB
testcase_19 AC 64 ms
24,344 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System


let solve a b c d =
    let isEnable a b c d =
        let j1 = a * c <= b
        let j2 = a + b <= d
        j1 && j2
    [ for iA in 0 .. a do 
      for iB in 0 .. b do
      if isEnable iA iB c d then yield iA ]
    |> Seq.max

let a, b, c, d =
    let t = Console.ReadLine().Split() |> Array.map int
    t.[0], t.[1], t.[2], t.[3]

solve a b c d
|> Console.WriteLine
0