結果

問題 No.988 N×Mマス計算(総和)
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-05 18:14:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 280 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 23,320 KB
最終ジャッジ日時 2023-09-02 06:48:38
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,900 KB
testcase_01 AC 15 ms
7,964 KB
testcase_02 AC 15 ms
7,852 KB
testcase_03 AC 15 ms
7,784 KB
testcase_04 AC 15 ms
7,948 KB
testcase_05 AC 15 ms
7,808 KB
testcase_06 AC 15 ms
7,864 KB
testcase_07 AC 15 ms
7,904 KB
testcase_08 AC 15 ms
7,816 KB
testcase_09 AC 15 ms
7,824 KB
testcase_10 AC 101 ms
11,852 KB
testcase_11 AC 70 ms
18,328 KB
testcase_12 AC 188 ms
21,016 KB
testcase_13 AC 78 ms
14,828 KB
testcase_14 AC 67 ms
14,916 KB
testcase_15 AC 136 ms
10,644 KB
testcase_16 AC 186 ms
17,136 KB
testcase_17 AC 225 ms
19,800 KB
testcase_18 AC 74 ms
17,052 KB
testcase_19 AC 182 ms
19,820 KB
testcase_20 AC 280 ms
23,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k=map(int,input().split())
l=list(map(str,input().split()))
a=[int(input()) for _ in range(n)]
b=[]
for i in range(1,m+1):
    b.append(int(l[i]))
A=sum(a)
B=sum(b)
if l[0]=='+':
    ans=0
    for i in a:
        ans+=i*m+B
        ans%=k
else:
    ans=0
    for i in a:
        ans+=i*B
        ans%=k
print(ans)
0