結果

問題 No.988 N×Mマス計算(総和)
ユーザー kota_ritskota_rits
提出日時 2020-02-14 21:54:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 21,024 KB
最終ジャッジ日時 2023-09-20 11:46:38
合計ジャッジ時間 2,239 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,756 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 17 ms
7,860 KB
testcase_04 AC 16 ms
7,908 KB
testcase_05 AC 16 ms
7,856 KB
testcase_06 AC 17 ms
7,764 KB
testcase_07 AC 16 ms
7,932 KB
testcase_08 AC 16 ms
7,912 KB
testcase_09 AC 16 ms
7,760 KB
testcase_10 AC 52 ms
11,860 KB
testcase_11 AC 86 ms
18,296 KB
testcase_12 AC 120 ms
21,024 KB
testcase_13 AC 51 ms
14,724 KB
testcase_14 AC 65 ms
14,752 KB
testcase_15 AC 47 ms
10,708 KB
testcase_16 AC 79 ms
17,068 KB
testcase_17 AC 96 ms
19,604 KB
testcase_18 AC 72 ms
17,152 KB
testcase_19 AC 85 ms
17,972 KB
testcase_20 AC 112 ms
20,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
n,m,k = map(int,stdin.readline().rstrip().split())
li = list(map(str,stdin.readline().rstrip().split()))
op = li[0]
b = [int(li[i]) for i in range(1,m+1)]
a = [int(stdin.readline().rstrip())%k for _ in range(n)]
A = sum(a)
B = sum(b)
point = 0
if op == "*":
    for i in range(m):
        point += A*b[i]%k
else:
    point += A*m+B*n
point%=k
print(point)
0