結果

問題 No.987 N×Mマス計算(基本)
ユーザー 👑 H20H20
提出日時 2021-07-15 11:03:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 76,648 KB
最終ジャッジ日時 2023-09-17 16:22:29
合計ジャッジ時間 2,940 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,948 KB
testcase_01 AC 72 ms
71,152 KB
testcase_02 AC 116 ms
76,356 KB
testcase_03 AC 87 ms
76,548 KB
testcase_04 AC 88 ms
76,648 KB
testcase_05 AC 85 ms
76,620 KB
testcase_06 AC 87 ms
76,492 KB
testcase_07 AC 86 ms
76,356 KB
testcase_08 AC 76 ms
71,272 KB
testcase_09 AC 76 ms
71,076 KB
testcase_10 AC 75 ms
71,264 KB
testcase_11 AC 84 ms
76,340 KB
testcase_12 AC 85 ms
76,576 KB
testcase_13 AC 84 ms
76,284 KB
testcase_14 AC 74 ms
71,396 KB
testcase_15 AC 85 ms
76,492 KB
testcase_16 AC 85 ms
76,580 KB
testcase_17 AC 87 ms
76,436 KB
testcase_18 AC 87 ms
76,568 KB
testcase_19 AC 89 ms
76,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
B = list(input().split())
OP = B[0]
B = list(map(int, B[1:]))
A = []
for _ in range(N):
    A.append(int(input()))
ANS = [[0]*M for _ 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