結果

問題 No.143 豆
ユーザー NoNo
提出日時 2015-04-19 17:32:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 914 bytes
コンパイル時間 3,253 ms
コンパイル使用メモリ 100,636 KB
実行使用メモリ 22,884 KB
最終ジャッジ日時 2023-09-30 16:33:30
合計ジャッジ時間 3,862 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,716 KB
testcase_01 AC 57 ms
22,796 KB
testcase_02 AC 56 ms
20,692 KB
testcase_03 AC 58 ms
20,700 KB
testcase_04 AC 57 ms
20,768 KB
testcase_05 AC 58 ms
22,764 KB
testcase_06 AC 57 ms
20,824 KB
testcase_07 AC 56 ms
20,792 KB
testcase_08 AC 56 ms
20,640 KB
testcase_09 AC 56 ms
20,664 KB
testcase_10 AC 57 ms
20,824 KB
testcase_11 AC 57 ms
22,760 KB
testcase_12 AC 57 ms
22,884 KB
testcase_13 AC 57 ms
20,696 KB
testcase_14 AC 58 ms
20,752 KB
testcase_15 AC 57 ms
22,684 KB
testcase_16 AC 56 ms
18,860 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;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Programming
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int K = int.Parse(str[0]);
            int N = int.Parse(str[1]);
            int F = int.Parse(str[2]);
            int[] A = new int[F];

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

            //------------------------------------

            int needBeen = 0;
            foreach (var item in A)
            {
                needBeen += item;
            }

            int total = K * N - needBeen;

            if (total < 0) total = -1;
            Console.WriteLine(total);
        }
    }
}
0