結果

問題 No.987 N×Mマス計算(基本)
ユーザー stngstng
提出日時 2022-08-17 10:36:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 65,556 KB
最終ジャッジ日時 2024-04-15 02:05:57
合計ジャッジ時間 1,913 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,688 KB
testcase_01 AC 37 ms
53,560 KB
testcase_02 AC 48 ms
64,700 KB
testcase_03 AC 48 ms
63,528 KB
testcase_04 AC 48 ms
64,448 KB
testcase_05 AC 48 ms
63,316 KB
testcase_06 AC 48 ms
63,616 KB
testcase_07 AC 46 ms
62,708 KB
testcase_08 AC 36 ms
53,060 KB
testcase_09 AC 37 ms
53,948 KB
testcase_10 AC 38 ms
53,196 KB
testcase_11 AC 48 ms
63,580 KB
testcase_12 AC 49 ms
64,516 KB
testcase_13 AC 48 ms
63,308 KB
testcase_14 AC 38 ms
53,500 KB
testcase_15 AC 51 ms
62,888 KB
testcase_16 AC 47 ms
64,280 KB
testcase_17 AC 48 ms
65,140 KB
testcase_18 AC 48 ms
64,012 KB
testcase_19 AC 51 ms
65,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
opb = input().split()
op = opb[0]
b = []
for i in range(1,m+1):
    b.append(int(opb[i]))

a = [int(input()) for i in range(n)]

ans = [[0]*m for i in range(n)]

for i in range(n):
    for j in range(m):
        if op == "+":
            ans[i][j] = a[i]+b[j]
        else:
            ans[i][j] = a[i]*b[j]

for i in range(n):
    print(*ans[i])
0