結果
問題 |
No.1201 お菓子配り-4
|
ユーザー |
|
提出日時 | 2020-08-30 07:44:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 279 bytes |
コンパイル時間 | 304 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 18,088 KB |
最終ジャッジ日時 | 2024-11-14 17:55:47 |
合計ジャッジ時間 | 62,144 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 TLE * 7 |
ソースコード
from math import gcd MOD=10**9+7 N=int(input()) M=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) ans=0 for a in A: for b in B: d=b//gcd(a,b) W=b H=W*a//b ans+=(H+1)*(W+1)-2*W+(W-1)//d ans%=MOD print(ans)