結果

問題 No.987 N×Mマス計算(基本)
ユーザー cccccc
提出日時 2022-09-02 18:23:13
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 938 bytes
コンパイル時間 13,232 ms
コンパイル使用メモリ 169,724 KB
実行使用メモリ 187,708 KB
最終ジャッジ日時 2024-04-27 18:26:24
合計ジャッジ時間 15,239 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
30,720 KB
testcase_01 AC 57 ms
30,976 KB
testcase_02 AC 59 ms
30,848 KB
testcase_03 AC 58 ms
30,976 KB
testcase_04 AC 59 ms
31,232 KB
testcase_05 AC 59 ms
30,976 KB
testcase_06 AC 60 ms
33,044 KB
testcase_07 AC 58 ms
30,720 KB
testcase_08 AC 58 ms
30,592 KB
testcase_09 AC 56 ms
30,848 KB
testcase_10 WA -
testcase_11 AC 59 ms
30,976 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 58 ms
30,972 KB
testcase_15 AC 58 ms
30,976 KB
testcase_16 AC 59 ms
30,848 KB
testcase_17 WA -
testcase_18 AC 60 ms
31,084 KB
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (94 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.cs(15,15): warning CS0168: 変数 '_ans' は宣言されていますが、使用されていません [/home/judge/data/code/main.csproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;


class Program
{
    static void Main()
    {
        var NM = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var opB = Console.ReadLine().Split().ToArray();
        var op = opB[0];
        var num = opB.Skip(1).Select(int.Parse).ToArray();
        int[] _ans;

        for (var i = 0; i < NM[0]; i++)
        {
            // 標準入力A取得
            var A = int.Parse(Console.ReadLine());

                if ( op == "+" )
                {
                    var ans = Array.ConvertAll(num, i => i + A);
                    Console.WriteLine(String.Join(" ",ans));
                }
                    else if ( op == "*")
                {
                    var ans = Array.ConvertAll(num, i => i * A);
                    Console.WriteLine(String.Join(" ",ans));
                }
        }
    }
}
0