結果

問題 No.988 N×Mマス計算(総和)
ユーザー kota_ritskota_rits
提出日時 2020-02-14 21:45:34
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 496 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 8,376 KB
最終ジャッジ日時 2023-09-20 11:40:24
合計ジャッジ時間 5,459 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,968 KB
testcase_01 AC 16 ms
7,852 KB
testcase_02 AC 18 ms
8,280 KB
testcase_03 AC 17 ms
7,740 KB
testcase_04 AC 16 ms
7,840 KB
testcase_05 AC 17 ms
8,328 KB
testcase_06 AC 17 ms
8,212 KB
testcase_07 AC 18 ms
8,376 KB
testcase_08 AC 17 ms
7,744 KB
testcase_09 AC 16 ms
7,840 KB
testcase_10 TLE -
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]
        else:
            lin[i][j] = a[i]+b[j]
point = 0
for i in lin:
    point += sum(i)
    point %= k
print(point)
0