結果

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

テストケース

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

            }
        }
    }
}
0