結果

問題 No.804 野菜が苦手
ユーザー yurara
提出日時 2019-04-09 22:01:35
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 815 ms
コンパイル使用メモリ 114,144 KB
実行使用メモリ 27,392 KB
最終ジャッジ日時 2024-07-05 03:05:51
合計ジャッジ時間 2,074 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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