結果

問題 No.804 野菜が苦手
ユーザー yurarayurara
提出日時 2019-04-09 22:01:35
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 108,324 KB
実行使用メモリ 23,992 KB
最終ジャッジ日時 2023-09-18 12:10:10
合計ジャッジ時間 4,284 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 61 ms
21,700 KB
testcase_02 AC 61 ms
21,632 KB
testcase_03 AC 60 ms
21,720 KB
testcase_04 AC 61 ms
21,720 KB
testcase_05 AC 61 ms
21,620 KB
testcase_06 AC 61 ms
23,992 KB
testcase_07 WA -
testcase_08 AC 62 ms
21,728 KB
testcase_09 AC 62 ms
23,772 KB
testcase_10 AC 61 ms
21,668 KB
testcase_11 AC 61 ms
21,792 KB
testcase_12 AC 61 ms
21,768 KB
testcase_13 AC 62 ms
19,748 KB
testcase_14 AC 61 ms
21,716 KB
testcase_15 AC 61 ms
21,696 KB
testcase_16 AC 62 ms
23,760 KB
testcase_17 AC 61 ms
21,688 KB
testcase_18 AC 61 ms
21,704 KB
testcase_19 AC 62 ms
21,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

public class Program
{
    public static void Main()
    {
        var lst = Console.ReadLine().Split(' ').
                        Select(s => int.Parse(s)).ToList();

        var a = lst[0]; var b = lst[1]; var c = lst[2]; var d = lst[3];

        for (; ; )
        {
            if ((a >= 0) && (b >= c) && (d >= c + 1))
            {
                a--;
                b -= c;
                d -= (c + 1);
            }
            else
                break;
        }

        Console.Write("{0}", (lst[0]-a).ToString());

        return;
    }
}
0