結果

問題 No.143 豆
ユーザー swdamdrswdamdr
提出日時 2017-01-24 15:19:19
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 1,000 ms
コード長 560 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 103,948 KB
実行使用メモリ 23,900 KB
最終ジャッジ日時 2023-09-30 16:55:31
合計ジャッジ時間 4,185 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
21,836 KB
testcase_01 AC 63 ms
21,768 KB
testcase_02 AC 62 ms
22,004 KB
testcase_03 AC 63 ms
21,968 KB
testcase_04 AC 63 ms
19,864 KB
testcase_05 AC 63 ms
21,784 KB
testcase_06 AC 64 ms
21,776 KB
testcase_07 AC 64 ms
23,900 KB
testcase_08 AC 63 ms
21,780 KB
testcase_09 AC 63 ms
21,780 KB
testcase_10 AC 64 ms
23,852 KB
testcase_11 AC 63 ms
22,000 KB
testcase_12 AC 62 ms
21,872 KB
testcase_13 AC 63 ms
23,760 KB
testcase_14 AC 63 ms
19,992 KB
testcase_15 AC 63 ms
21,812 KB
testcase_16 AC 63 ms
21,776 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;

class Program
{
    static void Main(string[] args)
    {
        int[] arr1 = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
        int[] arr2 = Console.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        int exist = arr1[0] * arr1[1];
        int need = arr2.Sum();
        int ans;

        if (exist - need >= 0)
        {
            ans = exist - need;
        }
        else
        {
            ans = -1;
        }

        Console.WriteLine(ans);
        Console.Read();
    }
}
0