結果

問題 No.988 N×Mマス計算(総和)
ユーザー qqqqqqqqqq
提出日時 2020-02-14 21:26:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 94,700 KB
最終ジャッジ日時 2023-09-20 11:26:38
合計ジャッジ時間 3,186 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,348 KB
testcase_01 AC 70 ms
71,544 KB
testcase_02 AC 71 ms
71,552 KB
testcase_03 AC 69 ms
71,460 KB
testcase_04 AC 68 ms
71,324 KB
testcase_05 AC 68 ms
71,164 KB
testcase_06 AC 71 ms
71,436 KB
testcase_07 AC 70 ms
71,244 KB
testcase_08 AC 71 ms
71,476 KB
testcase_09 AC 71 ms
71,328 KB
testcase_10 AC 91 ms
79,384 KB
testcase_11 AC 99 ms
91,940 KB
testcase_12 AC 111 ms
94,040 KB
testcase_13 AC 94 ms
85,464 KB
testcase_14 AC 92 ms
85,584 KB
testcase_15 AC 88 ms
77,596 KB
testcase_16 AC 104 ms
86,376 KB
testcase_17 AC 110 ms
90,044 KB
testcase_18 AC 100 ms
89,896 KB
testcase_19 AC 110 ms
91,964 KB
testcase_20 AC 123 ms
94,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__


n,m,k = map(int, input().split())
op, *B = input().split()
B = list(map(int, B))
A = [int(input()) for i in range(n)]

if op == "+":
    ans = sum(A)*m + sum(B)*n
    ans %= k
else:
    sum_B = sum(B)
    sum_A = sum(A)
    ans = sum_A*sum_B
    ans %= k
print(ans)
0