結果

問題 No.988 N×Mマス計算(総和)
ユーザー えいじえいじ
提出日時 2023-10-06 22:53:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 268 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 19,248 KB
最終ジャッジ日時 2023-10-06 22:53:49
合計ジャッジ時間 3,118 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,864 KB
testcase_01 AC 17 ms
7,800 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,960 KB
testcase_04 AC 16 ms
7,892 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 16 ms
7,916 KB
testcase_07 AC 16 ms
7,924 KB
testcase_08 AC 16 ms
7,856 KB
testcase_09 AC 16 ms
7,944 KB
testcase_10 AC 92 ms
11,048 KB
testcase_11 AC 48 ms
18,224 KB
testcase_12 AC 159 ms
18,680 KB
testcase_13 AC 63 ms
14,296 KB
testcase_14 AC 53 ms
14,316 KB
testcase_15 AC 127 ms
10,660 KB
testcase_16 AC 167 ms
15,520 KB
testcase_17 AC 197 ms
16,780 KB
testcase_18 AC 54 ms
16,752 KB
testcase_19 AC 159 ms
17,436 KB
testcase_20 AC 268 ms
19,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = [int(x) for x in input().split()]
b = input().split()
op = b.pop(0)
sb = sum(list(map(int, b)))
a = [int(input()) for _ in range(n)]
s = 0
for aa in a:
    if op == "+":
        s += sb + aa * m
    else:
        s += sb * aa
print(s % k)
0