結果

問題 No.143 豆
ユーザー tassi_2012tassi_2012
提出日時 2015-02-15 22:46:48
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 1,000 ms
コード長 452 bytes
コンパイル時間 2,103 ms
コンパイル使用メモリ 101,280 KB
実行使用メモリ 22,744 KB
最終ジャッジ日時 2023-09-30 16:31:27
合計ジャッジ時間 4,091 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
22,736 KB
testcase_01 AC 59 ms
20,624 KB
testcase_02 AC 59 ms
22,740 KB
testcase_03 AC 58 ms
20,896 KB
testcase_04 AC 58 ms
20,604 KB
testcase_05 AC 59 ms
20,676 KB
testcase_06 AC 59 ms
22,740 KB
testcase_07 AC 59 ms
22,744 KB
testcase_08 AC 59 ms
20,776 KB
testcase_09 AC 58 ms
20,668 KB
testcase_10 AC 60 ms
22,668 KB
testcase_11 AC 58 ms
22,656 KB
testcase_12 AC 58 ms
20,628 KB
testcase_13 AC 57 ms
20,664 KB
testcase_14 AC 58 ms
20,604 KB
testcase_15 AC 59 ms
22,740 KB
testcase_16 AC 57 ms
20,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class program
{
    public static void Main()
    {
        var str = Console.ReadLine().Split(' ');
        var K = int.Parse(str[0]);
        var N = int.Parse(str[1]);
        var F = int.Parse(str[2]);

        str = Console.ReadLine().Split(' ');
        int sumAge = 0;
        for (int i = 0; i < F; i++)
        {
            sumAge += int.Parse(str[i]);
        }

        Console.WriteLine(K*N-sumAge>=0?K*N-sumAge:-1);
    }
}
0