結果

問題 No.987 N×Mマス計算(基本)
ユーザー tter4tter4
提出日時 2020-02-14 21:36:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 64,896 KB
最終ジャッジ日時 2024-04-16 01:35:59
合計ジャッジ時間 2,224 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
52,224 KB
testcase_01 AC 47 ms
51,712 KB
testcase_02 AC 65 ms
63,488 KB
testcase_03 AC 60 ms
62,976 KB
testcase_04 AC 62 ms
62,976 KB
testcase_05 AC 68 ms
62,592 KB
testcase_06 AC 64 ms
63,232 KB
testcase_07 AC 59 ms
62,336 KB
testcase_08 AC 45 ms
52,096 KB
testcase_09 AC 48 ms
52,608 KB
testcase_10 AC 47 ms
52,608 KB
testcase_11 AC 63 ms
63,104 KB
testcase_12 AC 60 ms
63,616 KB
testcase_13 AC 59 ms
62,848 KB
testcase_14 AC 45 ms
51,968 KB
testcase_15 AC 59 ms
62,336 KB
testcase_16 AC 61 ms
64,256 KB
testcase_17 AC 60 ms
62,976 KB
testcase_18 AC 64 ms
63,616 KB
testcase_19 AC 64 ms
64,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
opb = list(map(str, input().split()))
op = opb[0]
b = [int(x) for x in opb[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])
        else:
            ans[i].append(a[i]*b[j])

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