結果

問題 No.143 豆
ユーザー masaktmasakt
提出日時 2017-03-21 01:22:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 1,000 ms
コード長 524 bytes
コンパイル時間 1,900 ms
コンパイル使用メモリ 100,468 KB
実行使用メモリ 22,812 KB
最終ジャッジ日時 2023-09-30 16:58:03
合計ジャッジ時間 3,712 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,644 KB
testcase_01 AC 56 ms
22,740 KB
testcase_02 AC 56 ms
20,716 KB
testcase_03 AC 55 ms
20,856 KB
testcase_04 AC 56 ms
20,628 KB
testcase_05 AC 57 ms
20,720 KB
testcase_06 AC 57 ms
22,624 KB
testcase_07 AC 57 ms
22,688 KB
testcase_08 AC 57 ms
20,708 KB
testcase_09 AC 56 ms
20,632 KB
testcase_10 AC 55 ms
20,640 KB
testcase_11 AC 57 ms
22,812 KB
testcase_12 AC 56 ms
20,616 KB
testcase_13 AC 55 ms
20,640 KB
testcase_14 AC 56 ms
20,688 KB
testcase_15 AC 56 ms
20,724 KB
testcase_16 AC 56 ms
20,888 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 P
{
    static void Main(string[] _)
    {
        _ = Console.ReadLine().Split(' ');
        int k = int.Parse(_[0]);
        int n = int.Parse(_[1]);
        int f = int.Parse(_[2]);
        _ = Console.ReadLine().Split(' ');
        int[] a = new int[f];
        for (int i = 0; i < f; i++)
        {
            a[i] = int.Parse(_[i]);
        }

        int s = k * n;
        for (int i = 0; i < f; i++)
        {
            s -= a[i];
        }
        Console.WriteLine(s < 0 ? -1 : s);
    }
}
0