結果

問題 No.988 N×Mマス計算(総和)
ユーザー shamioshamio
提出日時 2020-06-02 17:04:56
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 253 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 19,164 KB
最終ジャッジ日時 2023-09-20 12:25:27
合計ジャッジ時間 2,867 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,888 KB
testcase_01 AC 15 ms
7,792 KB
testcase_02 AC 16 ms
7,964 KB
testcase_03 AC 16 ms
7,780 KB
testcase_04 AC 16 ms
7,988 KB
testcase_05 AC 15 ms
7,800 KB
testcase_06 AC 16 ms
7,904 KB
testcase_07 AC 16 ms
7,876 KB
testcase_08 AC 16 ms
7,856 KB
testcase_09 AC 15 ms
7,876 KB
testcase_10 AC 96 ms
10,492 KB
testcase_11 AC 78 ms
18,188 KB
testcase_12 AC 176 ms
18,496 KB
testcase_13 AC 79 ms
14,296 KB
testcase_14 AC 69 ms
14,176 KB
testcase_15 AC 115 ms
10,460 KB
testcase_16 AC 171 ms
14,516 KB
testcase_17 AC 206 ms
16,576 KB
testcase_18 AC 78 ms
16,832 KB
testcase_19 AC 172 ms
17,348 KB
testcase_20 AC 253 ms
19,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
op, *b = input().split()
b = list(map(int, b))
a = [int(input()) for _ in range(n)]

a_sum = sum(a)
ans = 0
for eb in b:
    if op == "*":
        ans += eb * a_sum
    else:
        ans += eb * n + a_sum

    ans %= k

print(ans)
0