結果

問題 No.988 N×Mマス計算(総和)
ユーザー ryo_n
提出日時 2020-02-14 21:30:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 353 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 85,644 KB
最終ジャッジ日時 2024-07-06 06:57:09
合計ジャッジ時間 4,236 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = [int(x) for x in input().split()]
C = [x for x in input().split()]
B = [int(x) for x in C[1:]]
A = [int(input()) for _ in range(N)]

ans = 0

for j in range(N):
    for i in range(M):
        if C[0] == '+':
            ans += A[j] + B[i]
            ans %= K
        else:
            ans += A[j] * B[i]
            ans %= K

print(ans % K)

0