結果

問題 No.143 豆
ユーザー しらゆきしらゆき
提出日時 2015-11-18 09:38:48
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 1,000 ms
コード長 569 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 104,124 KB
実行使用メモリ 23,604 KB
最終ジャッジ日時 2023-09-30 16:39:27
合計ジャッジ時間 4,059 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
21,468 KB
testcase_01 AC 62 ms
21,496 KB
testcase_02 AC 62 ms
23,604 KB
testcase_03 AC 62 ms
23,600 KB
testcase_04 AC 63 ms
21,504 KB
testcase_05 AC 62 ms
21,468 KB
testcase_06 AC 62 ms
23,516 KB
testcase_07 AC 62 ms
23,520 KB
testcase_08 AC 62 ms
21,564 KB
testcase_09 AC 62 ms
23,496 KB
testcase_10 AC 62 ms
23,460 KB
testcase_11 AC 62 ms
21,448 KB
testcase_12 AC 62 ms
23,528 KB
testcase_13 AC 62 ms
23,440 KB
testcase_14 AC 62 ms
23,576 KB
testcase_15 AC 62 ms
21,580 KB
testcase_16 AC 61 ms
21,464 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;

class Program
{
    static void Main()
    {
        string[] s = Console.ReadLine().Split();
        int k = int.Parse(s[0]);
        int n = int.Parse(s[1]);
        int f = int.Parse(s[2]);
        int[] a = new int[f];
        string[] str = Console.ReadLine().Split();
        for(int i=0;i< f; i++)
        {
            a[i] = int.Parse(str[i]);
        }
        
        int bean = k * n;
        int ans = 0;

        if (bean >= a.Sum()) ans = bean - a.Sum();
        else ans = -1;

        Console.WriteLine(ans);
    }
}
0