結果

問題 No.988 N×Mマス計算(総和)
ユーザー pete1288998pete1288998
提出日時 2020-06-21 01:37:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 24,024 KB
最終ジャッジ日時 2023-09-20 12:40:16
合計ジャッジ時間 2,825 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,972 KB
testcase_01 AC 16 ms
7,828 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 15 ms
7,824 KB
testcase_04 AC 15 ms
7,812 KB
testcase_05 AC 16 ms
7,780 KB
testcase_06 AC 15 ms
7,808 KB
testcase_07 AC 15 ms
7,804 KB
testcase_08 AC 16 ms
7,788 KB
testcase_09 AC 15 ms
7,776 KB
testcase_10 AC 93 ms
12,204 KB
testcase_11 AC 53 ms
18,968 KB
testcase_12 AC 161 ms
21,248 KB
testcase_13 AC 76 ms
15,260 KB
testcase_14 AC 55 ms
14,956 KB
testcase_15 AC 134 ms
10,648 KB
testcase_16 AC 186 ms
17,404 KB
testcase_17 AC 223 ms
20,308 KB
testcase_18 AC 58 ms
17,564 KB
testcase_19 AC 183 ms
19,992 KB
testcase_20 AC 273 ms
24,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int,input().split())

l = list(input().split())
op = l[0]
b = l[1:]
b = [int(i) for i in b]

a = []
for i in range(n):
    a.append(int(input()))

ans = 0
if op == "+":
    for i in b:
        ans += (i*n)
    
    for j in a:
        ans += (j*m)
else:
    ans = sum(a)*sum(b)
    
print(ans%k)
0