結果

問題 No.987 N×Mマス計算(基本)
ユーザー kat0rikkat0rik
提出日時 2020-02-27 21:28:04
言語 Go
(1.22.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 476 bytes
コンパイル時間 17,083 ms
コンパイル使用メモリ 233,688 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 17:04:22
合計ジャッジ時間 17,383 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 19 ms
5,376 KB
testcase_03 AC 6 ms
5,376 KB
testcase_04 AC 14 ms
5,376 KB
testcase_05 AC 12 ms
5,376 KB
testcase_06 AC 18 ms
5,376 KB
testcase_07 AC 9 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 19 ms
5,376 KB
testcase_12 AC 22 ms
5,376 KB
testcase_13 AC 8 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 10 ms
5,376 KB
testcase_16 AC 24 ms
5,376 KB
testcase_17 AC 16 ms
5,376 KB
testcase_18 AC 23 ms
5,376 KB
testcase_19 AC 33 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var N, M int
	fmt.Scan(&N, &M)
	var op string
	var plus bool
	fmt.Scan(&op)
	if op == "+" {
		plus = true
	}
	B := make([]int, M)
	for i := range B {
		fmt.Scan(&B[i])
	}
	A := make([]int, N)
	for i := range A {
		fmt.Scan(&A[i])
	}
	for i := 0; i < N; i++ {
		for j := 0; j < M; j++ {
			if j > 0 {
				fmt.Print(" ")
			}
			if plus {
				fmt.Print(A[i] + B[j])
			} else {
				fmt.Print(A[i] * B[j])
			}
		}
		fmt.Println()
	}
}
0