結果

問題 No.988 N×Mマス計算(総和)
ユーザー Ytz_IchiYtz_Ichi
提出日時 2020-02-15 03:12:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 249 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 16,496 KB
最終ジャッジ日時 2023-09-20 12:03:39
合計ジャッジ時間 2,806 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,828 KB
testcase_01 AC 15 ms
7,724 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 15 ms
7,808 KB
testcase_04 AC 15 ms
7,808 KB
testcase_05 AC 16 ms
7,864 KB
testcase_06 AC 15 ms
7,816 KB
testcase_07 AC 15 ms
7,972 KB
testcase_08 AC 16 ms
7,724 KB
testcase_09 AC 15 ms
7,840 KB
testcase_10 AC 98 ms
10,388 KB
testcase_11 AC 77 ms
15,720 KB
testcase_12 AC 180 ms
16,496 KB
testcase_13 AC 80 ms
13,436 KB
testcase_14 AC 68 ms
12,808 KB
testcase_15 AC 118 ms
10,592 KB
testcase_16 AC 171 ms
13,468 KB
testcase_17 AC 205 ms
14,920 KB
testcase_18 AC 75 ms
14,504 KB
testcase_19 AC 172 ms
14,752 KB
testcase_20 AC 249 ms
16,232 KB
権限があれば一括ダウンロードができます

ソースコード

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])) % s
    j += 1
y = [(int(input())) % s for i in range(n)]

total = 0
if x[0] == "+":
    total = m * sum(y) + n * sum(x[1:])
else:
    total = sum(x[1:]) * sum(y)
print(total % s)
0