結果

問題 No.143 豆
ユーザー TDTD
提出日時 2022-05-25 11:47:29
言語 C#
(.NET 8.0.203)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 738 bytes
コンパイル時間 6,657 ms
コンパイル使用メモリ 157,384 KB
実行使用メモリ 175,940 KB
最終ジャッジ日時 2023-10-20 19:09:52
合計ジャッジ時間 7,508 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
30,872 KB
testcase_01 AC 52 ms
30,876 KB
testcase_02 AC 52 ms
30,880 KB
testcase_03 AC 55 ms
30,880 KB
testcase_04 AC 52 ms
30,880 KB
testcase_05 AC 55 ms
30,876 KB
testcase_06 AC 54 ms
30,876 KB
testcase_07 AC 52 ms
30,876 KB
testcase_08 AC 51 ms
30,876 KB
testcase_09 AC 52 ms
30,892 KB
testcase_10 AC 52 ms
30,876 KB
testcase_11 AC 53 ms
30,880 KB
testcase_12 AC 51 ms
30,892 KB
testcase_13 AC 54 ms
30,880 KB
testcase_14 AC 52 ms
30,880 KB
testcase_15 AC 54 ms
30,880 KB
testcase_16 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (100 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            string[] str1 = Console.ReadLine().Split(' ');
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int c = int.Parse(str[2]);
            int d = 0;
            int num = 0;
            for (int i = 0; i < c; i++)
            {
                d += int.Parse(str1[i]);
            }
            num = (a * b)-d;
            if (num < 0)
            {
                Console.WriteLine("-1");
            }
            else
            {
                Console.WriteLine(num.ToString());
            }
        }
    }
}
0