結果

問題 No.143 豆
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-03-20 16:37:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 478 bytes
コンパイル時間 3,290 ms
コンパイル使用メモリ 101,748 KB
実行使用メモリ 23,616 KB
最終ジャッジ日時 2023-09-30 16:43:19
合計ジャッジ時間 4,307 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
21,508 KB
testcase_01 AC 59 ms
21,588 KB
testcase_02 AC 58 ms
21,544 KB
testcase_03 AC 58 ms
21,632 KB
testcase_04 AC 59 ms
21,596 KB
testcase_05 AC 59 ms
21,612 KB
testcase_06 AC 59 ms
23,616 KB
testcase_07 AC 59 ms
21,564 KB
testcase_08 AC 59 ms
21,788 KB
testcase_09 AC 58 ms
21,572 KB
testcase_10 AC 58 ms
23,484 KB
testcase_11 AC 57 ms
21,580 KB
testcase_12 AC 58 ms
21,484 KB
testcase_13 AC 58 ms
21,664 KB
testcase_14 AC 58 ms
21,484 KB
testcase_15 AC 58 ms
23,544 KB
testcase_16 AC 59 ms
21,584 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;

public class Program {
    public static void Main() {
        string[] input = Console.ReadLine().Split(' ');
        int bean = int.Parse(input[0]);
        int pack = int.Parse(input[1]);
        int person = int.Parse(input[2]);
        int[] age = Array.ConvertAll(Console.ReadLine().Split(' '), delegate(string value) {
            return int.Parse(value);
        });
        Console.WriteLine(Math.Max(bean*pack-age.Sum(), -1));
    }
}
0