結果

問題 No.988 N×Mマス計算(総和)
ユーザー maguchi_p_qmaguchi_p_q
提出日時 2020-02-14 21:31:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 20,148 KB
最終ジャッジ日時 2023-09-20 11:32:57
合計ジャッジ時間 2,893 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,908 KB
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 16 ms
7,760 KB
testcase_03 AC 16 ms
7,880 KB
testcase_04 AC 16 ms
7,860 KB
testcase_05 AC 15 ms
7,800 KB
testcase_06 AC 16 ms
7,764 KB
testcase_07 AC 15 ms
7,888 KB
testcase_08 AC 16 ms
7,756 KB
testcase_09 AC 16 ms
7,752 KB
testcase_10 AC 106 ms
10,460 KB
testcase_11 AC 51 ms
18,860 KB
testcase_12 AC 182 ms
19,432 KB
testcase_13 AC 68 ms
14,832 KB
testcase_14 AC 57 ms
14,804 KB
testcase_15 AC 140 ms
8,356 KB
testcase_16 AC 187 ms
14,876 KB
testcase_17 AC 224 ms
17,092 KB
testcase_18 AC 60 ms
17,560 KB
testcase_19 AC 178 ms
18,332 KB
testcase_20 AC 271 ms
20,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = [int(zz) for zz in input().split()]
B = [zz for zz in input().split()]

s = B[0]
B = sum([int(zz) for zz in B[1:]])
def calc(s,a,b):
    if s == '+':
        return a*M+b
    elif s == '*':
        return a*b

tmp = 0
for i in range(N):
    a = int(input())
    tmp += calc(s,a,B)

print(tmp%K)
0