結果

問題 No.143 豆
ユーザー yurarayurara
提出日時 2019-04-09 21:30:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 1,000 ms
コード長 411 bytes
コンパイル時間 2,306 ms
コンパイル使用メモリ 104,168 KB
実行使用メモリ 23,920 KB
最終ジャッジ日時 2023-09-30 17:30:30
合計ジャッジ時間 4,544 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,828 KB
testcase_01 AC 64 ms
21,832 KB
testcase_02 AC 64 ms
21,920 KB
testcase_03 AC 64 ms
23,892 KB
testcase_04 AC 64 ms
21,892 KB
testcase_05 AC 64 ms
21,816 KB
testcase_06 AC 65 ms
21,868 KB
testcase_07 AC 65 ms
21,944 KB
testcase_08 AC 64 ms
23,920 KB
testcase_09 AC 64 ms
19,740 KB
testcase_10 AC 64 ms
23,836 KB
testcase_11 AC 64 ms
21,780 KB
testcase_12 AC 63 ms
19,888 KB
testcase_13 AC 65 ms
21,956 KB
testcase_14 AC 64 ms
21,788 KB
testcase_15 AC 64 ms
21,772 KB
testcase_16 AC 63 ms
21,772 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 l = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToList();
        var values = Console.ReadLine().Split(' ');

        var total = l[0] * l[1];
        var amount = values.Sum(i => int.Parse(i));

        Console.Write("{0}", (total >= amount) ? (total - amount) : -1);

        return;
    }
}
0