結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
23,848 KB
testcase_01 AC 62 ms
23,840 KB
testcase_02 AC 62 ms
21,876 KB
testcase_03 AC 60 ms
21,768 KB
testcase_04 AC 61 ms
21,776 KB
testcase_05 AC 62 ms
21,820 KB
testcase_06 AC 61 ms
21,788 KB
testcase_07 AC 62 ms
21,780 KB
testcase_08 AC 61 ms
23,844 KB
testcase_09 WA -
testcase_10 AC 62 ms
21,928 KB
testcase_11 AC 61 ms
21,740 KB
testcase_12 AC 64 ms
19,780 KB
testcase_13 AC 62 ms
23,824 KB
testcase_14 AC 61 ms
23,880 KB
testcase_15 AC 61 ms
19,892 KB
testcase_16 AC 63 ms
23,980 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 > 0)
        {
            output = exist - need;
        }
        else
        {
            output = -1;
        }

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