結果
問題 | No.988 N×Mマス計算(総和) |
ユーザー |
![]() |
提出日時 | 2020-02-14 21:26:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 138 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 92,928 KB |
最終ジャッジ日時 | 2024-07-06 06:51:39 |
合計ジャッジ時間 | 2,041 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ n,m,k = map(int, input().split()) op, *B = input().split() B = list(map(int, B)) A = [int(input()) for i in range(n)] if op == "+": ans = sum(A)*m + sum(B)*n ans %= k else: sum_B = sum(B) sum_A = sum(A) ans = sum_A*sum_B ans %= k print(ans)