結果

問題 No.988 N×Mマス計算(総和)
ユーザー ああいいああいい
提出日時 2021-12-24 19:24:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 246 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 25,160 KB
最終ジャッジ日時 2023-10-19 22:22:21
合計ジャッジ時間 3,723 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,104 KB
testcase_01 AC 30 ms
10,104 KB
testcase_02 AC 30 ms
10,108 KB
testcase_03 AC 29 ms
10,108 KB
testcase_04 AC 30 ms
10,104 KB
testcase_05 AC 30 ms
10,112 KB
testcase_06 AC 31 ms
10,112 KB
testcase_07 AC 30 ms
10,112 KB
testcase_08 AC 29 ms
10,104 KB
testcase_09 AC 34 ms
10,108 KB
testcase_10 AC 104 ms
14,032 KB
testcase_11 AC 63 ms
20,208 KB
testcase_12 AC 168 ms
22,896 KB
testcase_13 AC 77 ms
16,700 KB
testcase_14 AC 66 ms
16,700 KB
testcase_15 AC 134 ms
12,588 KB
testcase_16 AC 172 ms
19,092 KB
testcase_17 AC 201 ms
21,652 KB
testcase_18 AC 69 ms
19,044 KB
testcase_19 AC 166 ms
21,736 KB
testcase_20 AC 246 ms
25,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int,input().split())
l = input().split()
op = l[0]
del l[0]
B = list(map(int,l))
A = [int(input()) for _ in range(N)]

if op == '*':
    print((sum(A) % K) * (sum(B) % K) % K)
else:
    print((sum(A) * M + sum(B) * N) % K )
0