結果

問題 No.987 N×Mマス計算(基本)
ユーザー rymg111rymg111
提出日時 2020-09-22 21:43:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 761 bytes
コンパイル時間 2,211 ms
コンパイル使用メモリ 73,508 KB
実行使用メモリ 60,444 KB
最終ジャッジ日時 2023-09-09 04:12:53
合計ジャッジ時間 7,733 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,736 KB
testcase_01 AC 121 ms
55,676 KB
testcase_02 AC 287 ms
57,524 KB
testcase_03 AC 194 ms
55,960 KB
testcase_04 AC 264 ms
57,300 KB
testcase_05 AC 257 ms
57,660 KB
testcase_06 AC 266 ms
57,724 KB
testcase_07 AC 201 ms
56,384 KB
testcase_08 AC 165 ms
56,168 KB
testcase_09 AC 163 ms
56,100 KB
testcase_10 WA -
testcase_11 AC 275 ms
57,888 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 164 ms
56,144 KB
testcase_15 AC 202 ms
56,464 KB
testcase_16 AC 293 ms
57,500 KB
testcase_17 WA -
testcase_18 AC 289 ms
57,508 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int raws = sc.nextInt();
		int columns = sc.nextInt();
		String op = sc.next();
		int[] rawNum = new int[raws];
		int[] colNum = new int[columns];
		for(int i = 0; i < columns; i++) {
			colNum[i] = sc.nextInt();
		}
		for(int j = 0; j < raws; j++) {
			rawNum[j] = sc.nextInt();
		}
		for(int k = 0; k < raws; k++) {
			for(int l = 0; l < columns; l++) {
				calculate(op, rawNum[k], colNum[l]);
				System.out.print(" ");
			}
			System.out.println("");
		}
	}
	public static void calculate(String op, int raw, int col) {
		if(op.equals("*")) {
			System.out.print(raw * col);
		} else {
			System.out.print(raw + col);
		}
	}
}
0