結果

問題 No.988 N×Mマス計算(総和)
ユーザー 💕💖💞💕💖💞
提出日時 2020-03-31 16:48:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 347 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 42,040 KB
最終ジャッジ日時 2023-09-20 12:20:49
合計ジャッジ時間 5,789 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
29,484 KB
testcase_01 AC 132 ms
29,520 KB
testcase_02 AC 134 ms
29,508 KB
testcase_03 AC 132 ms
29,608 KB
testcase_04 AC 133 ms
29,512 KB
testcase_05 AC 134 ms
29,556 KB
testcase_06 AC 134 ms
29,464 KB
testcase_07 AC 133 ms
29,560 KB
testcase_08 AC 133 ms
29,552 KB
testcase_09 AC 134 ms
29,532 KB
testcase_10 AC 206 ms
32,612 KB
testcase_11 AC 174 ms
40,204 KB
testcase_12 AC 276 ms
40,700 KB
testcase_13 AC 185 ms
35,908 KB
testcase_14 AC 178 ms
36,148 KB
testcase_15 AC 240 ms
32,380 KB
testcase_16 AC 273 ms
36,948 KB
testcase_17 AC 307 ms
39,096 KB
testcase_18 AC 184 ms
38,808 KB
testcase_19 AC 268 ms
39,556 KB
testcase_20 AC 347 ms
42,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n,m,k = map(int, input().split())
l1 = input().split()
op = l1.pop(0)

bs = np.array(list(map(int, l1))) % k
ax = np.array([int(input()) for a in range(n)]) % k
if op == '+':
    print( (bs.sum() * n  + ax.sum() * m) % k)
else:
    x = ((bs.sum()%k) * (ax.sum()%k))%k
    print(x)
0