結果

問題 No.988 N×Mマス計算(総和)
ユーザー Ytz_Ichi
提出日時 2020-02-15 03:01:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 401 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 19,908 KB
最終ジャッジ日時 2024-07-06 07:21:59
合計ジャッジ時間 3,970 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, s = map(int, input().split())
x = input().split()
j = 1
for i in range(len(x) - 1):
    x[j] = int(x[j])
    j += 1
y = [int(input()) for i in range(n)]

sum = 0
if x[0] == "+":
    for i in y:
        for j in range(len(x) - 1):
            sum += (i + x[j + 1]) % s
else:
    for i in y:
        ax = ""
        for j in range(len(x) - 1):
            sum += (i * x[j + 1]) % s
print(sum % s)
0