結果

問題 No.988 N×Mマス計算(総和)
ユーザー ryo_nryo_n
提出日時 2020-02-14 21:30:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 353 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 76,044 KB
最終ジャッジ日時 2023-09-20 11:32:48
合計ジャッジ時間 5,109 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,264 KB
testcase_01 AC 72 ms
71,300 KB
testcase_02 AC 81 ms
76,044 KB
testcase_03 AC 75 ms
75,912 KB
testcase_04 AC 75 ms
71,364 KB
testcase_05 AC 76 ms
75,964 KB
testcase_06 AC 73 ms
75,984 KB
testcase_07 AC 76 ms
75,888 KB
testcase_08 AC 77 ms
75,804 KB
testcase_09 AC 72 ms
71,432 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, K = [int(x) for x in input().split()]
C = [x for x in input().split()]
B = [int(x) for x in C[1:]]
A = [int(input()) for _ in range(N)]

ans = 0

for j in range(N):
    for i in range(M):
        if C[0] == '+':
            ans += A[j] + B[i]
            ans %= K
        else:
            ans += A[j] * B[i]
            ans %= K

print(ans % K)

0