結果

問題 No.988 N×Mマス計算(総和)
ユーザー brthyyjpbrthyyjp
提出日時 2020-02-14 21:34:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 97,036 KB
最終ジャッジ日時 2023-09-20 11:34:55
合計ジャッジ時間 3,698 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,200 KB
testcase_01 AC 74 ms
71,392 KB
testcase_02 AC 74 ms
71,176 KB
testcase_03 AC 74 ms
70,992 KB
testcase_04 AC 77 ms
71,296 KB
testcase_05 AC 76 ms
71,224 KB
testcase_06 AC 76 ms
71,212 KB
testcase_07 AC 78 ms
71,488 KB
testcase_08 AC 77 ms
71,392 KB
testcase_09 AC 74 ms
71,396 KB
testcase_10 AC 117 ms
79,944 KB
testcase_11 AC 125 ms
94,760 KB
testcase_12 AC 144 ms
96,440 KB
testcase_13 AC 120 ms
87,892 KB
testcase_14 AC 117 ms
87,800 KB
testcase_15 AC 118 ms
77,932 KB
testcase_16 AC 135 ms
89,348 KB
testcase_17 AC 150 ms
93,036 KB
testcase_18 AC 123 ms
92,716 KB
testcase_19 AC 144 ms
94,732 KB
testcase_20 AC 161 ms
97,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
l = list(map(str, input().split()))
b = [int(l[i]) for i in range(1, m+1)]

op = l[0]
#print(op)
#rint(b)

a = [0]*n
for i in range(n):
    a[i] = int(input())

#print(a)
#print(b)

if op == '+':
    ans = (sum(b)*n + sum(a)*m)%k
else:
    ans = (sum(a)*sum(b))%k
print(ans)
0