結果

問題 No.987 N×Mマス計算(基本)
ユーザー suppy193suppy193
提出日時 2021-05-01 22:15:12
言語 Ruby
(3.2.2)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 11,476 KB
実行使用メモリ 16,536 KB
最終ジャッジ日時 2023-09-27 11:14:58
合計ジャッジ時間 2,715 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,124 KB
testcase_01 AC 74 ms
15,288 KB
testcase_02 AC 81 ms
15,344 KB
testcase_03 AC 74 ms
15,508 KB
testcase_04 AC 80 ms
15,556 KB
testcase_05 AC 82 ms
15,612 KB
testcase_06 AC 84 ms
15,700 KB
testcase_07 AC 80 ms
15,576 KB
testcase_08 AC 77 ms
15,064 KB
testcase_09 AC 76 ms
15,316 KB
testcase_10 AC 76 ms
15,112 KB
testcase_11 AC 80 ms
15,608 KB
testcase_12 AC 82 ms
16,240 KB
testcase_13 AC 76 ms
15,636 KB
testcase_14 AC 75 ms
15,092 KB
testcase_15 AC 79 ms
15,664 KB
testcase_16 AC 84 ms
15,540 KB
testcase_17 AC 83 ms
16,376 KB
testcase_18 AC 85 ms
15,576 KB
testcase_19 AC 93 ms
16,536 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, m = gets.split(' ')
b = gets.split(' ')
a = ['']
(1..n.to_i).each do |j|
	a << gets.chop
end
if b[0] == "+"
	(1..n.to_i).each do |j|
		(1..m.to_i).each do |i|
			printf "#{a[j].to_i + b[i].to_i}"
			if i != m.to_i
				printf " "
			end
		end
		printf "\n"
	end
else
	(1..n.to_i).each do |j|
		(1..m.to_i).each do |i|
			printf "#{a[j].to_i * b[i].to_i}"
			if i != m.to_i
				printf " "
			end
		end
		printf "\n"
	end
end
0