結果

問題 No.988 N×Mマス計算(総和)
ユーザー zyxwzyxw
提出日時 2021-02-04 17:35:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 1,577 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 91,412 KB
最終ジャッジ日時 2023-09-13 14:21:46
合計ジャッジ時間 4,748 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,288 KB
testcase_01 AC 69 ms
71,388 KB
testcase_02 AC 72 ms
71,272 KB
testcase_03 AC 70 ms
71,412 KB
testcase_04 AC 70 ms
71,264 KB
testcase_05 AC 71 ms
71,036 KB
testcase_06 AC 70 ms
71,456 KB
testcase_07 AC 70 ms
71,344 KB
testcase_08 AC 69 ms
71,288 KB
testcase_09 AC 70 ms
71,288 KB
testcase_10 AC 107 ms
79,268 KB
testcase_11 AC 111 ms
89,756 KB
testcase_12 AC 132 ms
90,716 KB
testcase_13 AC 107 ms
83,740 KB
testcase_14 AC 108 ms
83,652 KB
testcase_15 AC 112 ms
77,728 KB
testcase_16 AC 126 ms
84,580 KB
testcase_17 AC 135 ms
87,252 KB
testcase_18 AC 110 ms
87,324 KB
testcase_19 AC 129 ms
88,628 KB
testcase_20 AC 148 ms
91,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
data=input().split()
B=map(int,data[1:M+1])
A=[int(input()) for i in range(N)]
Bsum=sum(B)%K
ans=0
if data[0]=="*":
    for i in range(N):
        ans+=A[i]*Bsum
        ans%=K
else:
    ans+=Bsum*N+(sum(A)%K)*M
    ans%=K
print(ans)
0