結果

問題 No.1517 Party Location
ユーザー mobchanmobchan
提出日時 2023-04-24 16:33:48
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 8,384 ms
コンパイル使用メモリ 168,084 KB
実行使用メモリ 185,600 KB
最終ジャッジ日時 2024-04-26 04:56:09
合計ジャッジ時間 9,647 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
29,952 KB
testcase_01 AC 54 ms
30,080 KB
testcase_02 AC 55 ms
29,696 KB
testcase_03 AC 56 ms
29,696 KB
testcase_04 AC 55 ms
29,824 KB
testcase_05 AC 55 ms
30,080 KB
testcase_06 AC 55 ms
29,952 KB
testcase_07 AC 54 ms
29,952 KB
testcase_08 AC 55 ms
29,824 KB
testcase_09 AC 55 ms
29,824 KB
testcase_10 AC 55 ms
29,696 KB
testcase_11 AC 54 ms
31,832 KB
testcase_12 AC 55 ms
29,684 KB
testcase_13 AC 66 ms
31,232 KB
testcase_14 AC 55 ms
185,600 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (97 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var d = int.Parse(Console.ReadLine());
        var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var a = input[0];
        var b = input[1];
        var minCost = (a + b) * d;

        for (var i = 0; i <= d; i++)
        {
            minCost = Math.Min(minCost, a * i + (d - i) * b);
        }
        Console.WriteLine(minCost);
    }
}
0