結果

問題 No.988 N×Mマス計算(総和)
ユーザー mnrmnr
提出日時 2020-03-08 16:23:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,800 KB
実行使用メモリ 48,260 KB
最終ジャッジ日時 2023-09-20 12:15:18
合計ジャッジ時間 8,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
34,200 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 132 ms
29,648 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 131 ms
29,572 KB
testcase_08 AC 133 ms
29,616 KB
testcase_09 AC 130 ms
29,636 KB
testcase_10 WA -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N,M,K = map(int,input().split())
B = input().split()
Bi = []
for i in range(1,M+1):
    Bi.insert(i-1,(int(B[i])%K))

A = []
for i in range(N):
    A.append(int(input())%K)
arra = np.array(A)
arrb = np.array(Bi)

ans = 0
if B[0] == '+':
    ans = (arra.sum()%K)*(M%K) + (arrb.sum()%K)*(N%K)
    ans %= K
elif B[0] == '*':
    for i in range(M):
        ans += (arrb.sum()%K) * (arra.sum()%K)
        ans %= K
print(ans)
0