結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
31,016 KB
testcase_01 AC 56 ms
31,020 KB
testcase_02 AC 58 ms
31,024 KB
testcase_03 AC 57 ms
31,024 KB
testcase_04 AC 58 ms
31,024 KB
testcase_05 AC 57 ms
31,020 KB
testcase_06 AC 57 ms
31,020 KB
testcase_07 AC 57 ms
31,020 KB
testcase_08 AC 57 ms
31,020 KB
testcase_09 AC 57 ms
31,036 KB
testcase_10 AC 58 ms
31,020 KB
testcase_11 AC 58 ms
31,024 KB
testcase_12 AC 57 ms
31,036 KB
testcase_13 AC 57 ms
31,024 KB
testcase_14 AC 57 ms
31,024 KB
testcase_15 AC 57 ms
31,024 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 = 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