結果

問題 No.143 豆
ユーザー curryudon08curryudon08
提出日時 2020-02-17 00:33:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 1,000 ms
コード長 583 bytes
コンパイル時間 2,216 ms
コンパイル使用メモリ 105,492 KB
実行使用メモリ 23,936 KB
最終ジャッジ日時 2023-09-30 17:45:12
合計ジャッジ時間 4,102 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
23,936 KB
testcase_01 AC 61 ms
21,908 KB
testcase_02 AC 61 ms
19,856 KB
testcase_03 AC 61 ms
21,932 KB
testcase_04 AC 61 ms
23,816 KB
testcase_05 AC 61 ms
21,848 KB
testcase_06 AC 61 ms
21,964 KB
testcase_07 AC 61 ms
19,776 KB
testcase_08 AC 62 ms
21,940 KB
testcase_09 AC 61 ms
21,696 KB
testcase_10 AC 61 ms
23,896 KB
testcase_11 AC 62 ms
23,912 KB
testcase_12 AC 61 ms
21,788 KB
testcase_13 AC 61 ms
23,872 KB
testcase_14 AC 60 ms
21,968 KB
testcase_15 AC 63 ms
23,828 KB
testcase_16 AC 61 ms
21,828 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;
using System.Collections.Generic;

namespace _0143
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray();
            var k = s[0];
            var n = s[1];
            var f = s[2];
            var a = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray();

            if(k * n >= a.Sum()){
                Console.WriteLine(k * n - a.Sum());
            }else{
                Console.WriteLine(-1);
            }
        }
    }
}
0