結果

問題 No.987 N×Mマス計算(基本)
ユーザー curryudon08curryudon08
提出日時 2020-06-23 17:57:14
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 910 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 104,156 KB
実行使用メモリ 24,100 KB
最終ジャッジ日時 2023-09-16 20:03:35
合計ジャッジ時間 4,273 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,972 KB
testcase_01 AC 63 ms
21,952 KB
testcase_02 AC 65 ms
21,932 KB
testcase_03 AC 65 ms
21,940 KB
testcase_04 AC 64 ms
21,760 KB
testcase_05 AC 64 ms
19,832 KB
testcase_06 AC 63 ms
21,928 KB
testcase_07 AC 66 ms
21,940 KB
testcase_08 AC 64 ms
21,876 KB
testcase_09 AC 66 ms
24,100 KB
testcase_10 AC 64 ms
21,856 KB
testcase_11 AC 64 ms
21,880 KB
testcase_12 AC 66 ms
24,032 KB
testcase_13 AC 62 ms
23,904 KB
testcase_14 AC 63 ms
21,928 KB
testcase_15 AC 65 ms
21,988 KB
testcase_16 AC 65 ms
21,908 KB
testcase_17 AC 65 ms
23,908 KB
testcase_18 AC 66 ms
23,904 KB
testcase_19 AC 66 ms
23,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

namespace _0987
{
    class Program
    {
        static void Main(string[] args)
        {
            var _ = Console.ReadLine().Split();
            var n = int.Parse(_[0]);
            var m = int.Parse(_[1]);

            var __ = Console.ReadLine().Split();
            var op = __[0];
            var s = __.Skip(1).Select(t => long.Parse(t)).ToArray();

            for(var i = 0; i < n; i++){
                var x = long.Parse(Console.ReadLine());

                var a = new long[m];
                for(var j = 0; j < m; j++){
                    if(op.Equals("+")){
                        a[j] = s[j] + x;
                    }else{
                        a[j] = s[j] * x;
                    }
                }
                Console.WriteLine(string.Join(" ",a.Select(t => t.ToString())));
            }
        }
    }
}
0