結果

問題 No.988 N×Mマス計算(総和)
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-12 23:01:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 11,996 KB
実行使用メモリ 21,152 KB
最終ジャッジ日時 2023-10-20 02:45:15
合計ジャッジ時間 3,807 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,120 KB
testcase_01 AC 28 ms
10,120 KB
testcase_02 AC 28 ms
10,124 KB
testcase_03 AC 29 ms
10,124 KB
testcase_04 AC 28 ms
10,120 KB
testcase_05 AC 29 ms
10,128 KB
testcase_06 AC 29 ms
10,128 KB
testcase_07 AC 29 ms
10,128 KB
testcase_08 AC 29 ms
10,120 KB
testcase_09 AC 28 ms
10,124 KB
testcase_10 AC 47 ms
12,708 KB
testcase_11 AC 57 ms
20,120 KB
testcase_12 AC 77 ms
20,728 KB
testcase_13 AC 51 ms
16,264 KB
testcase_14 AC 49 ms
16,264 KB
testcase_15 AC 48 ms
12,540 KB
testcase_16 AC 69 ms
16,376 KB
testcase_17 AC 79 ms
18,560 KB
testcase_18 AC 56 ms
18,780 KB
testcase_19 AC 74 ms
19,432 KB
testcase_20 AC 92 ms
21,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import add, mul
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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