結果

問題 No.143 豆
ユーザー swdamdrswdamdr
提出日時 2017-01-24 10:11:17
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 2,156 ms
コンパイル使用メモリ 105,784 KB
実行使用メモリ 24,008 KB
最終ジャッジ日時 2023-08-24 21:39:21
合計ジャッジ時間 4,356 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
23,752 KB
testcase_01 AC 62 ms
23,924 KB
testcase_02 AC 61 ms
21,884 KB
testcase_03 AC 61 ms
23,828 KB
testcase_04 AC 62 ms
23,744 KB
testcase_05 AC 62 ms
21,740 KB
testcase_06 AC 62 ms
23,920 KB
testcase_07 AC 62 ms
21,788 KB
testcase_08 AC 61 ms
21,816 KB
testcase_09 WA -
testcase_10 AC 62 ms
23,788 KB
testcase_11 AC 62 ms
22,004 KB
testcase_12 AC 61 ms
21,748 KB
testcase_13 AC 61 ms
21,704 KB
testcase_14 AC 61 ms
21,936 KB
testcase_15 AC 61 ms
23,912 KB
testcase_16 AC 61 ms
23,936 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)
    {
        string s1 = Console.ReadLine();
        string s2 = Console.ReadLine();
        int output;

        int[] array1 = s1.Split(' ').Select(a => int.Parse(a)).ToArray();
        int[] array2 = s2.Split(' ').Select(a => int.Parse(a)).ToArray();

        int exist = array1[0] * array1[1];
        int need = array2.Sum();

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

        Console.WriteLine(output);
        Console.ReadLine();
    }
}
0