結果

問題 No.143 豆
ユーザー shima1104shima1104
提出日時 2019-03-12 18:55:57
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 659 bytes
コンパイル時間 3,373 ms
コンパイル使用メモリ 101,980 KB
実行使用メモリ 22,856 KB
最終ジャッジ日時 2023-09-30 17:28:52
合計ジャッジ時間 4,627 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,668 KB
testcase_01 AC 56 ms
20,700 KB
testcase_02 AC 56 ms
20,636 KB
testcase_03 AC 58 ms
22,856 KB
testcase_04 AC 57 ms
20,748 KB
testcase_05 AC 57 ms
22,640 KB
testcase_06 AC 58 ms
22,752 KB
testcase_07 AC 57 ms
22,716 KB
testcase_08 AC 57 ms
20,696 KB
testcase_09 AC 56 ms
20,644 KB
testcase_10 AC 57 ms
22,744 KB
testcase_11 AC 55 ms
20,700 KB
testcase_12 AC 56 ms
20,640 KB
testcase_13 AC 56 ms
20,704 KB
testcase_14 AC 57 ms
20,812 KB
testcase_15 AC 57 ms
20,800 KB
testcase_16 AC 56 ms
20,652 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace test_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] n = Console.ReadLine().Split(' ');

            int mame = int.Parse(n[0]) * int.Parse(n[1]);
            int family = int.Parse(n[2]);

            string[] years = Console.ReadLine().Split(' ');

            for(int i= 0; i < family; i++)
            {
                mame -= int.Parse(years[i]);
                
            }

            if(mame < 0)
            {
                Console.WriteLine(-1);
            }
            else
            {
                Console.WriteLine(mame);
            }


        }
    }
}
0