結果

問題 No.143 豆
ユーザー TDTD
提出日時 2022-05-25 13:14:53
言語 C#
(.NET 8.0.203)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 785 bytes
コンパイル時間 6,931 ms
コンパイル使用メモリ 158,228 KB
実行使用メモリ 176,912 KB
最終ジャッジ日時 2023-10-20 19:10:47
合計ジャッジ時間 7,848 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
30,876 KB
testcase_01 AC 50 ms
30,880 KB
testcase_02 AC 52 ms
30,884 KB
testcase_03 AC 50 ms
30,884 KB
testcase_04 AC 51 ms
30,876 KB
testcase_05 AC 56 ms
30,872 KB
testcase_06 AC 51 ms
30,872 KB
testcase_07 AC 50 ms
30,872 KB
testcase_08 AC 50 ms
30,872 KB
testcase_09 AC 49 ms
30,888 KB
testcase_10 AC 51 ms
30,872 KB
testcase_11 AC 53 ms
30,876 KB
testcase_12 AC 52 ms
30,888 KB
testcase_13 AC 53 ms
30,876 KB
testcase_14 AC 54 ms
30,876 KB
testcase_15 AC 50 ms
30,876 KB
testcase_16 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (104 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 num = 0;
            num = (a * b);
            for (int i = 0; i < c; i++)
            {
                num -= int.Parse(str1[i]);
                if (num < 0)
                {
                    Console.WriteLine("-1");
                    break;
                }
                else if(i==c-1)
                {
                    Console.WriteLine(num.ToString());
                }
            }
        }
    }
}
0