結果
問題 |
No.988 N×Mマス計算(総和)
|
ユーザー |
![]() |
提出日時 | 2020-07-18 19:02:07 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 333 bytes |
コンパイル時間 | 135 ms |
コンパイル使用メモリ | 82,788 KB |
実行使用メモリ | 84,496 KB |
最終ジャッジ日時 | 2024-07-06 08:02:24 |
合計ジャッジ時間 | 4,135 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 TLE * 1 -- * 10 |
ソースコード
n, m, k = map(int, input().split()) tmp = list(input().split()) tmp.reverse() op = tmp.pop() B = [int(tmp.pop()) for i in range(m)] A = [int(input()) for i in range(n)] ans = 0 for a in A: for b in B: if op == "+": ans += a + b elif op == "*": ans += a * b ans %= k print(ans)