結果
問題 | No.988 N×Mマス計算(総和) |
ユーザー |
![]() |
提出日時 | 2020-04-10 14:24:11 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 292 ms / 2,000 ms |
コード長 | 283 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 22,480 KB |
最終ジャッジ日時 | 2024-07-06 07:41:29 |
合計ジャッジ時間 | 3,075 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
n,m,k = map(int,input().split()) B = list(map(str, input().split())) op = B[0] B = [int(i) for i in B[1:]] A = [int(input()) for _ in range(n)] if op=='+': print((sum(B)*n + sum(A)*m)%k) else: ret = 0 sa = sum(A)%k for b in B: ret += (b*sa)%k print(ret%k)