結果
問題 | No.1201 お菓子配り-4 |
ユーザー |
|
提出日時 | 2020-08-30 07:53:06 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 996 ms / 4,000 ms |
コード長 | 279 bytes |
コンパイル時間 | 336 ms |
コンパイル使用メモリ | 82,028 KB |
実行使用メモリ | 64,956 KB |
最終ジャッジ日時 | 2024-11-14 17:56:01 |
合計ジャッジ時間 | 12,974 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
from math import gcdMOD=10**9+7N=int(input())M=int(input())A=list(map(int,input().split()))B=list(map(int,input().split()))ans=0for a in A:for b in B:d=b//gcd(a,b)W=bH=W*a//bans+=(H+1)*(W+1)-2*W+(W-1)//dans%=MODprint(ans)