結果

問題 No.988 N×Mマス計算(総和)
ユーザー tnodinotnodino
提出日時 2022-02-04 20:45:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 97,272 KB
最終ジャッジ日時 2023-09-02 04:22:40
合計ジャッジ時間 5,137 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,360 KB
testcase_01 AC 68 ms
71,216 KB
testcase_02 AC 67 ms
71,304 KB
testcase_03 AC 66 ms
71,256 KB
testcase_04 AC 68 ms
71,364 KB
testcase_05 AC 65 ms
71,212 KB
testcase_06 AC 66 ms
71,356 KB
testcase_07 AC 66 ms
71,384 KB
testcase_08 AC 66 ms
70,920 KB
testcase_09 AC 70 ms
71,324 KB
testcase_10 AC 112 ms
80,392 KB
testcase_11 AC 118 ms
95,460 KB
testcase_12 AC 142 ms
96,896 KB
testcase_13 AC 109 ms
88,084 KB
testcase_14 AC 108 ms
88,072 KB
testcase_15 AC 111 ms
79,868 KB
testcase_16 AC 129 ms
89,184 KB
testcase_17 AC 139 ms
92,960 KB
testcase_18 AC 114 ms
92,976 KB
testcase_19 AC 135 ms
95,088 KB
testcase_20 AC 153 ms
97,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int,input().split())
L = list(input().split())
op = L[0]
B = list(map(int, L[1:]))
S = sum(B)
A = list(int(input()) for _ in range(N))
ans = 0
for i in range(N):
    if op == '+':
        ans += (A[i] * M) + S
    else:
        ans += A[i] * S
    ans %= K
print(ans)
0