結果

問題 No.143 豆
ユーザー shimadandyshimadandy
提出日時 2016-09-05 13:36:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 579 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 99,372 KB
実行使用メモリ 22,852 KB
最終ジャッジ日時 2023-09-30 16:49:40
合計ジャッジ時間 3,975 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,716 KB
testcase_01 AC 58 ms
20,724 KB
testcase_02 AC 56 ms
18,700 KB
testcase_03 AC 57 ms
20,840 KB
testcase_04 AC 58 ms
22,704 KB
testcase_05 AC 58 ms
22,756 KB
testcase_06 AC 57 ms
20,728 KB
testcase_07 AC 57 ms
20,764 KB
testcase_08 AC 57 ms
20,796 KB
testcase_09 AC 57 ms
22,708 KB
testcase_10 AC 57 ms
20,640 KB
testcase_11 AC 57 ms
22,852 KB
testcase_12 AC 56 ms
22,720 KB
testcase_13 AC 56 ms
22,772 KB
testcase_14 AC 56 ms
20,632 KB
testcase_15 AC 57 ms
20,672 KB
testcase_16 AC 57 ms
18,680 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.Collections.Generic;

class Program
{
    /// <summary>
    /// プログラムのエントリポイント
    /// </summary>
    /// <param name="args"></param>
    static void Main(string[] args)
    {
        string[] tmp = Console.ReadLine().Split(' ');

        int k = int.Parse(tmp[0]);
        int n = int.Parse(tmp[1]);

        tmp = Console.ReadLine().Split(' ');

        int age = 0;
        foreach (string s in tmp)
            age += int.Parse(s);

        int ans = k * n - age;

        Console.WriteLine(ans < 0 ? -1 : ans);
    }
}
0