結果

問題 No.143 豆
ユーザー Maeda
提出日時 2025-03-31 13:41:47
言語 C#
(.NET 8.0.404)
結果
MLE  
実行時間 -
コード長 717 bytes
コンパイル時間 8,659 ms
コンパイル使用メモリ 170,064 KB
実行使用メモリ 187,772 KB
最終ジャッジ日時 2025-03-31 13:41:58
合計ジャッジ時間 10,524 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 MLE * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (170 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            string num = Console.ReadLine();
            string[] numList = num.Split(' ');
            double beans = int.Parse(numList[0]) * int.Parse(numList[1]);
            int count = int.Parse(numList[2]);
            numList = null;
            string age = Console.ReadLine();
            string[] ageList = age.Split(' ');
            
            for(int i = 0; i < count; i++)
            {
                beans -= int.Parse(ageList[i]);
                if(beans < 0)
                {
                    beans = -1;
                    break;
                }
            }
            Console.WriteLine(beans);
        }
    }
0