結果

問題 No.987 N×Mマス計算(基本)
ユーザー boya978boya978
提出日時 2020-03-01 05:24:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 1,202 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 110,476 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-04-21 22:05:39
合計ジャッジ時間 2,222 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
17,664 KB
testcase_01 AC 26 ms
17,920 KB
testcase_02 AC 39 ms
18,304 KB
testcase_03 AC 29 ms
17,792 KB
testcase_04 AC 36 ms
18,048 KB
testcase_05 AC 34 ms
18,176 KB
testcase_06 AC 38 ms
18,048 KB
testcase_07 AC 31 ms
17,664 KB
testcase_08 AC 27 ms
17,792 KB
testcase_09 AC 27 ms
17,920 KB
testcase_10 AC 27 ms
17,664 KB
testcase_11 AC 37 ms
18,176 KB
testcase_12 AC 42 ms
18,688 KB
testcase_13 AC 30 ms
18,048 KB
testcase_14 AC 26 ms
17,920 KB
testcase_15 AC 32 ms
17,920 KB
testcase_16 AC 41 ms
18,176 KB
testcase_17 AC 37 ms
18,048 KB
testcase_18 AC 40 ms
18,304 KB
testcase_19 AC 48 ms
19,072 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{
    public static void Main(){
        
        var inpt = Console.ReadLine().Split();
        long n = long.Parse(inpt[0]),  m = long.Parse(inpt[1]);
        
        inpt  = Console.ReadLine().Split();
        string op = inpt[0];
        long[] horizontal = new long[m];
        for(long i=1;i<m+1;i++){
            horizontal[i-1] = long.Parse(inpt[i]);
        }
        
        long[] vertical = new long[n];
        for(long i=0;i<n;i++){
            vertical[i] = long.Parse(Console.ReadLine());
        }
        
        long[][] table = new long[n][];
        for(long i=0;i<n;i++){
            table[i] = new long[m];
        }

        for(long i=0;i<n;i++){
            for(long j=0;j<m;j++){
                if(op=="+")
                    table[i][j] = vertical[i] + horizontal[j];
                else
                    table[i][j] = vertical[i] * horizontal[j];
            }
        }

        foreach(long[] arry in table){
            for(long j=0;j<m;j++){
                if(j==m-1)
                    Console.WriteLine(arry[j]);
                else
                    Console.Write(arry[j]+" ");
            }
        }

        
    }
}
0