結果

問題 No.988 N×Mマス計算(総和)
ユーザー 👑 H20H20
提出日時 2021-07-15 11:08:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 93,284 KB
最終ジャッジ日時 2023-09-17 16:29:59
合計ジャッジ時間 4,937 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,236 KB
testcase_01 AC 75 ms
71,148 KB
testcase_02 AC 80 ms
71,136 KB
testcase_03 AC 76 ms
71,316 KB
testcase_04 AC 75 ms
71,428 KB
testcase_05 AC 77 ms
71,136 KB
testcase_06 AC 74 ms
71,196 KB
testcase_07 AC 75 ms
71,208 KB
testcase_08 AC 75 ms
71,156 KB
testcase_09 AC 75 ms
71,208 KB
testcase_10 AC 215 ms
79,576 KB
testcase_11 AC 122 ms
91,164 KB
testcase_12 AC 152 ms
93,284 KB
testcase_13 AC 118 ms
85,084 KB
testcase_14 AC 117 ms
84,876 KB
testcase_15 AC 122 ms
79,764 KB
testcase_16 AC 136 ms
87,100 KB
testcase_17 AC 147 ms
89,644 KB
testcase_18 AC 122 ms
89,940 KB
testcase_19 AC 142 ms
91,748 KB
testcase_20 AC 160 ms
93,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int,input().split())
B = list(input().split())
OP = B[0]
B = list(map(int, B[1:]))
A = []
for _ in range(N):
    A.append(int(input()))
ANS = 0
if OP=='+':
    for a in A:
        ANS = (ANS+a*M)%K
    for b in B:
        ANS = (ANS+b*N)%K
else:
    SB = sum(B)
    for a in A:
        ANS = (ANS+a*SB)%K
print(ANS)
0