結果

問題 No.987 N×Mマス計算(基本)
ユーザー bluemeganebluemegane
提出日時 2020-02-15 11:17:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 784 ms
コンパイル使用メモリ 110,308 KB
実行使用メモリ 26,212 KB
最終ジャッジ日時 2024-04-16 03:08:50
合計ジャッジ時間 2,006 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
22,196 KB
testcase_01 AC 28 ms
24,108 KB
testcase_02 AC 28 ms
24,160 KB
testcase_03 AC 27 ms
26,080 KB
testcase_04 AC 29 ms
24,236 KB
testcase_05 AC 27 ms
21,808 KB
testcase_06 AC 28 ms
26,088 KB
testcase_07 AC 26 ms
24,116 KB
testcase_08 AC 27 ms
23,980 KB
testcase_09 AC 27 ms
24,108 KB
testcase_10 AC 27 ms
23,912 KB
testcase_11 AC 28 ms
26,212 KB
testcase_12 AC 29 ms
26,212 KB
testcase_13 AC 28 ms
24,160 KB
testcase_14 AC 27 ms
23,904 KB
testcase_15 AC 28 ms
24,168 KB
testcase_16 AC 29 ms
24,300 KB
testcase_17 AC 30 ms
26,084 KB
testcase_18 AC 28 ms
24,300 KB
testcase_19 AC 31 ms
26,200 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        var a = new long[m];
        line = Console.ReadLine().Trim().Split(' ');
        var op = line[0];
        for (int i = 1; i <= m; i++) a[i - 1] = int.Parse(line[i]);
        var ans = new long[m];
        for (int i = 0; i < n; i++)
        {
            var t = long.Parse(Console.ReadLine().Trim());
            for (int j = 0; j < m; j++)
                ans[j] = op == "+" ? a[j] + t : a[j] * t;
            Console.WriteLine(string.Join(" ", ans));
        }
    }
}

0