結果

問題 No.987 N×Mマス計算(基本)
ユーザー netyo715netyo715
提出日時 2021-07-12 14:07:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2023-09-14 20:33:27
合計ジャッジ時間 1,840 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,820 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 20 ms
8,260 KB
testcase_03 AC 17 ms
8,176 KB
testcase_04 AC 19 ms
8,172 KB
testcase_05 AC 18 ms
8,104 KB
testcase_06 AC 19 ms
8,460 KB
testcase_07 AC 18 ms
8,172 KB
testcase_08 AC 16 ms
7,844 KB
testcase_09 AC 16 ms
7,904 KB
testcase_10 AC 16 ms
7,872 KB
testcase_11 AC 20 ms
8,172 KB
testcase_12 AC 21 ms
8,348 KB
testcase_13 AC 17 ms
8,248 KB
testcase_14 AC 17 ms
7,904 KB
testcase_15 AC 17 ms
8,316 KB
testcase_16 AC 21 ms
8,104 KB
testcase_17 AC 19 ms
8,272 KB
testcase_18 AC 21 ms
8,460 KB
testcase_19 AC 23 ms
8,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
r = input().split()
op = r[0]
B = list(map(int, r[1:]))
A = [int(input()) for _ in range(N)]
ans = [[] for _ in range(N)]
for i in range(N):
    for j in range(M):
        if op=="+":
            ans[i].append(A[i]+B[j])
        if op=="*":
            ans[i].append(A[i]*B[j])

for r in ans:
    print(*r)
0