結果

問題 No.988 N×Mマス計算(総和)
ユーザー oshiioshii
提出日時 2020-03-07 14:15:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 23,268 KB
最終ジャッジ日時 2023-09-20 12:13:23
合計ジャッジ時間 2,880 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,768 KB
testcase_01 AC 16 ms
7,856 KB
testcase_02 AC 17 ms
7,796 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 16 ms
7,796 KB
testcase_05 AC 16 ms
7,856 KB
testcase_06 AC 16 ms
7,764 KB
testcase_07 AC 16 ms
7,832 KB
testcase_08 AC 16 ms
7,800 KB
testcase_09 AC 16 ms
7,736 KB
testcase_10 AC 97 ms
11,876 KB
testcase_11 AC 85 ms
18,156 KB
testcase_12 AC 187 ms
20,876 KB
testcase_13 AC 66 ms
14,740 KB
testcase_14 AC 76 ms
14,804 KB
testcase_15 AC 116 ms
10,512 KB
testcase_16 AC 160 ms
17,228 KB
testcase_17 AC 189 ms
19,632 KB
testcase_18 AC 87 ms
17,140 KB
testcase_19 AC 155 ms
19,772 KB
testcase_20 AC 235 ms
23,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
bw = list(map(str, input().split()))
a = [int(input()) for i in range(n)]
op = bw.pop(0)
b = [int(i) for i in bw]
ans = 0
aa = sum(a)
if op == "+":
	ans = (sum(a) * m + sum(b) * n)%k
else:
	for i in b:
		ans += i*aa
		ans %= k
print (ans)
0