結果
問題 |
No.987 N×Mマス計算(基本)
|
ユーザー |
|
提出日時 | 2020-03-01 05:10:16 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,217 bytes |
コンパイル時間 | 707 ms |
コンパイル使用メモリ | 113,280 KB |
実行使用メモリ | 28,192 KB |
最終ジャッジ日時 | 2024-10-13 20:29:37 |
合計ジャッジ時間 | 2,317 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 WA * 5 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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]+" "); } } } }