結果

問題 No.988 N×Mマス計算(総和)
ユーザー brthyyjp
提出日時 2020-02-14 21:34:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 96,652 KB
最終ジャッジ日時 2024-07-06 06:59:16
合計ジャッジ時間 2,331 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
l = list(map(str, input().split()))
b = [int(l[i]) for i in range(1, m+1)]

op = l[0]
#print(op)
#rint(b)

a = [0]*n
for i in range(n):
    a[i] = int(input())

#print(a)
#print(b)

if op == '+':
    ans = (sum(b)*n + sum(a)*m)%k
else:
    ans = (sum(a)*sum(b))%k
print(ans)
0