結果
問題 | No.988 N×Mマス計算(総和) |
ユーザー |
![]() |
提出日時 | 2020-02-15 03:12:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 287 ms / 2,000 ms |
コード長 | 293 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 19,076 KB |
最終ジャッジ日時 | 2024-07-06 07:22:23 |
合計ジャッジ時間 | 2,913 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
n, m, s = map(int, input().split()) x = input().split() j = 1 for i in range(len(x) - 1): x[j] = (int(x[j])) % s j += 1 y = [(int(input())) % s for i in range(n)] total = 0 if x[0] == "+": total = m * sum(y) + n * sum(x[1:]) else: total = sum(x[1:]) * sum(y) print(total % s)