結果

問題 No.988 N×Mマス計算(総和)
ユーザー motor_radialmotor_radial
提出日時 2020-03-11 17:48:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 266 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 19,320 KB
最終ジャッジ日時 2023-09-20 12:16:00
合計ジャッジ時間 2,900 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,716 KB
testcase_01 AC 15 ms
7,924 KB
testcase_02 AC 16 ms
7,904 KB
testcase_03 AC 16 ms
7,892 KB
testcase_04 AC 16 ms
7,720 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 16 ms
7,872 KB
testcase_07 AC 15 ms
7,924 KB
testcase_08 AC 16 ms
7,816 KB
testcase_09 AC 15 ms
7,820 KB
testcase_10 AC 101 ms
10,336 KB
testcase_11 AC 53 ms
18,180 KB
testcase_12 AC 175 ms
18,636 KB
testcase_13 AC 69 ms
14,236 KB
testcase_14 AC 56 ms
14,284 KB
testcase_15 AC 137 ms
8,308 KB
testcase_16 AC 182 ms
14,512 KB
testcase_17 AC 215 ms
16,520 KB
testcase_18 AC 60 ms
16,812 KB
testcase_19 AC 178 ms
17,268 KB
testcase_20 AC 266 ms
19,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
opB=list(input().split())
op=opB.pop(0)
B=sum([int(i) for i in opB])
s=0
for _ in range(N):
    A=int(input())
    if op=="*":
        s+=(B*A)
    elif op=="+":
        s+=(B+M*A)
print(s%K)
0