結果

問題 No.988 N×Mマス計算(総和)
ユーザー tter4tter4
提出日時 2020-02-14 22:12:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 329 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 97,064 KB
最終ジャッジ日時 2023-09-20 11:58:56
合計ジャッジ時間 3,876 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,320 KB
testcase_01 AC 77 ms
70,968 KB
testcase_02 AC 80 ms
71,324 KB
testcase_03 AC 77 ms
71,232 KB
testcase_04 AC 79 ms
71,356 KB
testcase_05 AC 79 ms
71,152 KB
testcase_06 AC 77 ms
71,340 KB
testcase_07 AC 78 ms
71,380 KB
testcase_08 AC 76 ms
71,448 KB
testcase_09 AC 75 ms
71,340 KB
testcase_10 AC 119 ms
80,196 KB
testcase_11 AC 126 ms
95,204 KB
testcase_12 AC 149 ms
96,800 KB
testcase_13 AC 123 ms
88,380 KB
testcase_14 AC 120 ms
88,240 KB
testcase_15 AC 122 ms
77,840 KB
testcase_16 AC 141 ms
89,392 KB
testcase_17 AC 148 ms
93,244 KB
testcase_18 AC 127 ms
92,908 KB
testcase_19 AC 147 ms
95,056 KB
testcase_20 AC 161 ms
97,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
opb = list(map(str, input().split()))
op = opb[0]
b = [int(x) for x in opb[1:]]
a = [int(input()) for _ in range(n)]

total = 0
if op == '+':
    total += sum(a) * m % k + sum(b) * n % k
    total %= k
else:
    sumb = sum(b) % k
    suma = sum(a) % k
    total = suma * sumb % k

print(total)
0