結果

問題 No.988 N×Mマス計算(総和)
ユーザー kota_ritskota_rits
提出日時 2020-02-14 21:48:24
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 504 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 842,976 KB
最終ジャッジ日時 2023-09-20 11:45:02
合計ジャッジ時間 3,644 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,444 KB
testcase_01 AC 71 ms
71,460 KB
testcase_02 AC 78 ms
76,076 KB
testcase_03 AC 76 ms
75,992 KB
testcase_04 AC 71 ms
71,636 KB
testcase_05 AC 76 ms
76,392 KB
testcase_06 AC 76 ms
76,280 KB
testcase_07 AC 77 ms
76,200 KB
testcase_08 AC 77 ms
76,272 KB
testcase_09 AC 72 ms
71,472 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