結果

問題 No.143 豆
ユーザー aaaaaaaaaaaaaa
提出日時 2022-05-25 13:33:50
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 6,664 ms
コンパイル使用メモリ 156,852 KB
実行使用メモリ 175,476 KB
最終ジャッジ日時 2023-10-20 19:11:02
合計ジャッジ時間 8,404 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
30,864 KB
testcase_01 AC 57 ms
30,876 KB
testcase_02 AC 58 ms
30,880 KB
testcase_03 AC 57 ms
30,880 KB
testcase_04 AC 58 ms
30,880 KB
testcase_05 AC 57 ms
30,876 KB
testcase_06 AC 57 ms
30,876 KB
testcase_07 AC 57 ms
30,876 KB
testcase_08 AC 57 ms
30,876 KB
testcase_09 WA -
testcase_10 AC 59 ms
30,876 KB
testcase_11 AC 57 ms
30,880 KB
testcase_12 AC 57 ms
30,892 KB
testcase_13 AC 56 ms
30,880 KB
testcase_14 AC 56 ms
30,884 KB
testcase_15 AC 57 ms
30,884 KB
testcase_16 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (99 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;

            for(int i = 0; i < c; i++)
            {
                num += int.Parse(str1[i]);
            }

            int ans = (a * b) - num;

            if (ans > 0)
            {
                Console.WriteLine(ans.ToString());
                return;
            }

            Console.WriteLine("-1");
        }
    }
}
0