結果

問題 No.988 N×Mマス計算(総和)
ユーザー kota_ritskota_rits
提出日時 2020-02-14 21:47:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 504 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 553,760 KB
最終ジャッジ日時 2023-09-20 11:44:53
合計ジャッジ時間 4,257 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,212 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 18 ms
8,216 KB
testcase_03 AC 17 ms
7,772 KB
testcase_04 AC 17 ms
7,792 KB
testcase_05 AC 18 ms
8,200 KB
testcase_06 AC 19 ms
8,296 KB
testcase_07 AC 19 ms
8,192 KB
testcase_08 AC 17 ms
7,792 KB
testcase_09 AC 16 ms
7,788 KB
testcase_10 MLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
n,m,k = map(int,stdin.readline().rstrip().split())
li = list(map(str,stdin.readline().rstrip().split()))
op = li[0]
b = [int(li[i]) for i in range(1,m+1)]
a = [int(stdin.readline().rstrip()) for _ in range(n)]
lin = [[0 for i in range(m)]for j in range(n)]
for i in range(n):
    for j in range(m):
        if op == "*":
            lin[i][j] = (a[i]*b[j])%k
        else:
            lin[i][j] = (a[i]+b[j])%k
point = 0
for i in lin:
    point += sum(i)
    point %= k
print(point)
0