結果

問題 No.987 N×Mマス計算(基本)
ユーザー raven7959raven7959
提出日時 2021-09-06 10:50:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,540 KB
実行使用メモリ 76,508 KB
最終ジャッジ日時 2023-08-24 05:33:33
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,076 KB
testcase_01 AC 72 ms
71,068 KB
testcase_02 AC 99 ms
76,208 KB
testcase_03 AC 91 ms
76,440 KB
testcase_04 AC 89 ms
76,508 KB
testcase_05 AC 85 ms
76,312 KB
testcase_06 AC 85 ms
76,316 KB
testcase_07 AC 84 ms
76,228 KB
testcase_08 AC 72 ms
70,916 KB
testcase_09 AC 74 ms
71,116 KB
testcase_10 AC 74 ms
70,804 KB
testcase_11 AC 83 ms
76,028 KB
testcase_12 AC 84 ms
75,980 KB
testcase_13 AC 86 ms
76,180 KB
testcase_14 AC 74 ms
71,148 KB
testcase_15 AC 85 ms
76,308 KB
testcase_16 AC 85 ms
76,432 KB
testcase_17 AC 85 ms
76,160 KB
testcase_18 AC 84 ms
76,124 KB
testcase_19 AC 86 ms
76,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
L=list(input().split())
B=list(map(int,L[1:]))
A=[int(input()) for _ in range(N)]
ANS=[[0]*M for _ in range(N)]
def f(x,y):
  if L[0]=="+":
    return x+y
  else:
    return x*y
for i in range(N):
  for j in range(M):
    ANS[i][j]=f(A[i],B[j])
for ans in ANS:
  print(*ans)
0