結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
17,664 KB
testcase_01 AC 26 ms
17,792 KB
testcase_02 AC 38 ms
18,176 KB
testcase_03 AC 28 ms
17,792 KB
testcase_04 AC 36 ms
18,048 KB
testcase_05 AC 33 ms
18,048 KB
testcase_06 AC 38 ms
17,792 KB
testcase_07 AC 31 ms
17,920 KB
testcase_08 AC 26 ms
17,664 KB
testcase_09 AC 26 ms
17,792 KB
testcase_10 WA -
testcase_11 AC 37 ms
18,048 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 27 ms
17,792 KB
testcase_15 AC 31 ms
17,920 KB
testcase_16 AC 42 ms
18,432 KB
testcase_17 WA -
testcase_18 AC 41 ms
18,432 KB
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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();
        int n = int.Parse(inpt[0]),  m = int.Parse(inpt[1]);
        
        inpt  = Console.ReadLine().Split();
        string op = inpt[0];
        int[] horizontal = new int[m];
        for(int i=1;i<m+1;i++){
            horizontal[i-1] = int.Parse(inpt[i]);
        }
        
        int[] vertical = new int[n];
        for(int i=0;i<n;i++){
            vertical[i] = int.Parse(Console.ReadLine());
        }
        
        int[][] table = new int[n][];
        for(int i=0;i<n;i++){
            table[i] = new int[m];
        }

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

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

        
    }
}
0