結果

問題 No.988 N×Mマス計算(総和)
ユーザー OhnumaOhnuma
提出日時 2020-04-10 14:24:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 20,068 KB
最終ジャッジ日時 2023-09-20 12:21:33
合計ジャッジ時間 2,803 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 16 ms
7,868 KB
testcase_02 AC 16 ms
7,836 KB
testcase_03 AC 16 ms
7,852 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 15 ms
7,740 KB
testcase_06 AC 15 ms
7,960 KB
testcase_07 AC 16 ms
7,856 KB
testcase_08 AC 16 ms
7,744 KB
testcase_09 AC 15 ms
7,796 KB
testcase_10 AC 91 ms
11,508 KB
testcase_11 AC 77 ms
18,860 KB
testcase_12 AC 177 ms
19,436 KB
testcase_13 AC 65 ms
14,748 KB
testcase_14 AC 69 ms
14,848 KB
testcase_15 AC 113 ms
10,672 KB
testcase_16 AC 156 ms
14,856 KB
testcase_17 AC 182 ms
17,016 KB
testcase_18 AC 75 ms
17,688 KB
testcase_19 AC 152 ms
18,280 KB
testcase_20 AC 226 ms
20,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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