結果

問題 No.988 N×Mマス計算(総和)
ユーザー mayuutannmayuutann
提出日時 2020-02-16 10:17:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 15,996 KB
最終ジャッジ日時 2023-09-20 12:05:41
合計ジャッジ時間 2,788 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 16 ms
7,932 KB
testcase_03 AC 15 ms
7,844 KB
testcase_04 AC 15 ms
7,856 KB
testcase_05 AC 16 ms
7,760 KB
testcase_06 AC 16 ms
7,828 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 15 ms
7,816 KB
testcase_09 AC 15 ms
7,768 KB
testcase_10 AC 101 ms
9,856 KB
testcase_11 AC 45 ms
15,232 KB
testcase_12 AC 169 ms
15,652 KB
testcase_13 AC 67 ms
12,372 KB
testcase_14 AC 54 ms
12,288 KB
testcase_15 AC 137 ms
7,844 KB
testcase_16 AC 177 ms
12,672 KB
testcase_17 AC 211 ms
14,188 KB
testcase_18 AC 55 ms
14,576 KB
testcase_19 AC 171 ms
14,756 KB
testcase_20 AC 259 ms
15,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K=map(int,input().split())
op,*B=input().split()
b_sum=sum(map(int,B))
_sum=0
for i in range(N):
    A=int(input())
    if op=="+":
        _sum += A*M + b_sum
    else:
        _sum += A * b_sum
print(_sum % K)    
0