結果
問題 |
No.1201 お菓子配り-4
|
ユーザー |
![]() |
提出日時 | 2020-11-26 20:27:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 809 ms / 4,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 426 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 64,652 KB |
最終ジャッジ日時 | 2024-07-23 20:56:44 |
合計ジャッジ時間 | 11,236 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
import sys from math import gcd def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) N,M = I(),I() A,B = LI(),LI() mod = 10**9+7 ans = 0 for i in range(N): a = A[i] for j in range(M): b = B[j] g = gcd(a,b) ans += a*b+a-b+g ans %= mod print(ans)