結果

問題 No.987 N×Mマス計算(基本)
ユーザー boya978
提出日時 2020-03-01 05:24:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 1,202 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 109,932 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-10-13 20:29:40
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
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