結果

問題 No.143 豆
ユーザー arasabakiarasabaki
提出日時 2016-03-08 21:57:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 1,000 ms
コード長 617 bytes
コンパイル時間 2,611 ms
コンパイル使用メモリ 106,096 KB
実行使用メモリ 23,848 KB
最終ジャッジ日時 2023-09-30 16:43:03
合計ジャッジ時間 4,679 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,572 KB
testcase_01 AC 63 ms
23,600 KB
testcase_02 AC 62 ms
23,680 KB
testcase_03 AC 63 ms
23,700 KB
testcase_04 AC 62 ms
21,576 KB
testcase_05 AC 63 ms
21,696 KB
testcase_06 AC 64 ms
23,688 KB
testcase_07 AC 63 ms
21,660 KB
testcase_08 AC 64 ms
23,848 KB
testcase_09 AC 63 ms
21,556 KB
testcase_10 AC 62 ms
21,652 KB
testcase_11 AC 63 ms
23,672 KB
testcase_12 AC 65 ms
19,600 KB
testcase_13 AC 62 ms
21,628 KB
testcase_14 AC 64 ms
21,800 KB
testcase_15 AC 63 ms
23,672 KB
testcase_16 AC 63 ms
21,612 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;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var firstInput = Console.ReadLine().Split();
            var secoundinput = Console.ReadLine().Split();

            int beans = int.Parse(firstInput[0]) * int.Parse(firstInput[1]);
            int ageTotal = secoundinput.Select(i => int.Parse(i)).Sum();

            if (beans < ageTotal)
            {
                Console.WriteLine(-1);
            }
            else
            {
                Console.WriteLine(beans - ageTotal);
            }
        }
    }
}
0