結果

問題 No.988 N×Mマス計算(総和)
ユーザー gorugo30gorugo30
提出日時 2021-02-25 09:52:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 96,768 KB
最終ジャッジ日時 2024-09-25 08:33:20
合計ジャッジ時間 3,643 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = map(int, input().split())
opB = list(input().split())
op = opB[0]
B = list(map(int, opB[1:]))
A = [int(input()) for i in range(N)]
if op == "+":
    ans = (M * sum(A) + N * sum(B)) % K
else:
    ans = (sum(A) * sum(B)) % K
print(ans)
0