結果

問題 No.987 N×Mマス計算(基本)
ユーザー ParSAParSA
提出日時 2020-02-14 21:49:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 763 bytes
コンパイル時間 2,485 ms
コンパイル使用メモリ 78,952 KB
実行使用メモリ 43,752 KB
最終ジャッジ日時 2024-04-16 01:48:42
合計ジャッジ時間 7,498 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
41,752 KB
testcase_01 AC 144 ms
41,904 KB
testcase_02 AC 270 ms
43,016 KB
testcase_03 AC 206 ms
42,376 KB
testcase_04 AC 233 ms
42,668 KB
testcase_05 AC 233 ms
42,472 KB
testcase_06 AC 246 ms
42,828 KB
testcase_07 AC 225 ms
42,368 KB
testcase_08 AC 180 ms
42,056 KB
testcase_09 AC 163 ms
41,596 KB
testcase_10 WA -
testcase_11 AC 254 ms
42,744 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 171 ms
41,936 KB
testcase_15 AC 224 ms
42,412 KB
testcase_16 AC 300 ms
43,268 KB
testcase_17 WA -
testcase_18 AC 293 ms
43,116 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt(); //n行
		
		int m = stdIn.nextInt(); //m列
		
		
		String op = stdIn.next();
		
		int[] b = new int[m];
		
		for(int i = 0; i < m; i++) {
			b[i] = stdIn.nextInt();
		}
		
		int[] a = new int[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		
		if(op.equals("+")) {
			for(int i = 0; i < n; i++) {
				for(int j = 0; j < m; j++) {
					System.out.print(a[i]+b[j]+" ");
				}
				System.out.println();
			}
			
			
		}else {
			for(int i = 0; i < n; i++) {
				for(int j = 0; j < m; j++) {
					System.out.print(a[i]*b[j]+" ");
				}
				System.out.println();
			}
		
		}
		
	}

}
0