結果

問題 No.988 N×Mマス計算(総和)
ユーザー prd_xxxprd_xxx
提出日時 2020-02-14 21:59:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 10,516 KB
実行使用メモリ 23,644 KB
最終ジャッジ日時 2023-09-20 11:53:03
合計ジャッジ時間 2,722 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,680 KB
testcase_01 AC 20 ms
8,540 KB
testcase_02 AC 20 ms
8,544 KB
testcase_03 AC 19 ms
8,576 KB
testcase_04 AC 20 ms
8,540 KB
testcase_05 AC 20 ms
8,588 KB
testcase_06 AC 20 ms
8,548 KB
testcase_07 AC 19 ms
8,640 KB
testcase_08 AC 20 ms
8,544 KB
testcase_09 AC 19 ms
8,616 KB
testcase_10 AC 91 ms
12,584 KB
testcase_11 AC 56 ms
18,736 KB
testcase_12 AC 157 ms
21,380 KB
testcase_13 AC 67 ms
15,244 KB
testcase_14 AC 57 ms
14,976 KB
testcase_15 AC 120 ms
11,044 KB
testcase_16 AC 158 ms
17,536 KB
testcase_17 AC 185 ms
20,136 KB
testcase_18 AC 61 ms
17,492 KB
testcase_19 AC 154 ms
20,220 KB
testcase_20 AC 226 ms
23,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
N,M,K = map(int,input().split())
op,*B = input().split()
A = [int(input()) for i in range(N)]

sa = sum(A)
sb = sum([int(b) for b in B])

if op=='*':
    ans = sa*sb%K
else:
    ans = (sa*M+sb*N)%K
print(ans)
0