結果

問題 No.988 N×Mマス計算(総和)
ユーザー s_shoheis_shohei
提出日時 2020-04-11 16:30:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 96,368 KB
最終ジャッジ日時 2023-09-20 12:21:30
合計ジャッジ時間 3,480 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,460 KB
testcase_01 AC 71 ms
71,272 KB
testcase_02 AC 73 ms
71,364 KB
testcase_03 AC 71 ms
71,576 KB
testcase_04 AC 72 ms
71,292 KB
testcase_05 AC 76 ms
71,336 KB
testcase_06 AC 73 ms
71,556 KB
testcase_07 AC 71 ms
71,496 KB
testcase_08 AC 75 ms
71,268 KB
testcase_09 AC 71 ms
71,292 KB
testcase_10 AC 112 ms
79,848 KB
testcase_11 AC 123 ms
93,816 KB
testcase_12 AC 145 ms
95,952 KB
testcase_13 AC 115 ms
86,736 KB
testcase_14 AC 114 ms
86,832 KB
testcase_15 AC 117 ms
78,164 KB
testcase_16 AC 136 ms
87,708 KB
testcase_17 AC 145 ms
92,088 KB
testcase_18 AC 123 ms
92,100 KB
testcase_19 AC 141 ms
93,668 KB
testcase_20 AC 158 ms
96,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int, input().split())
tmp = list(map(str, input().split()))
a=[int(input()) for i in range(n)]

op=tmp[0]
b=[]
for num in tmp[1:]:
    b.append(int(num))

sm_a=sum(a)
sm_b=sum(b)

if op=="*":
    ans=sm_a*sm_b
else:
    ans=sm_a*len(b) + sm_b*len(a)

print(ans%k)
0