結果

問題 No.987 N×Mマス計算(基本)
ユーザー maspymaspy
提出日時 2020-02-19 12:11:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 532 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 44,576 KB
最終ジャッジ日時 2024-04-16 20:46:30
合計ジャッジ時間 14,091 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 517 ms
44,576 KB
testcase_01 AC 521 ms
44,452 KB
testcase_02 AC 523 ms
44,448 KB
testcase_03 AC 520 ms
44,576 KB
testcase_04 AC 523 ms
44,072 KB
testcase_05 AC 521 ms
44,060 KB
testcase_06 AC 531 ms
44,448 KB
testcase_07 AC 520 ms
44,068 KB
testcase_08 AC 510 ms
44,072 KB
testcase_09 AC 515 ms
44,072 KB
testcase_10 AC 523 ms
44,068 KB
testcase_11 AC 527 ms
44,448 KB
testcase_12 AC 525 ms
44,064 KB
testcase_13 AC 516 ms
44,536 KB
testcase_14 AC 518 ms
44,068 KB
testcase_15 AC 519 ms
44,196 KB
testcase_16 AC 521 ms
44,320 KB
testcase_17 AC 523 ms
44,096 KB
testcase_18 AC 527 ms
44,068 KB
testcase_19 AC 532 ms
44,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# %%
import numpy as np
stdin = open(0)
# %%
N, M = map(int, stdin.readline().split())
op = stdin.read(1)

# %%
AB = np.fromstring(stdin.read(), np.int64, sep=' ')

# %%
B = AB[:M]
A = AB[M:]

# %%
f = np.add if op == '+' else np.multiply
C = f.outer(A, B)

# %%
print('\n'.join(' '.join(row) for row in C.astype(str)))

# %%
0