結果

問題 No.1201 お菓子配り-4
ユーザー 37zigen37zigen
提出日時 2020-08-30 07:44:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 279 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 13,896 KB
最終ジャッジ日時 2024-04-27 01:34:04
合計ジャッジ時間 36,608 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 225 ms
10,880 KB
testcase_01 AC 2,659 ms
11,008 KB
testcase_02 AC 3,997 ms
11,136 KB
testcase_03 AC 1,868 ms
11,008 KB
testcase_04 AC 924 ms
11,008 KB
testcase_05 AC 2,334 ms
11,008 KB
testcase_06 AC 362 ms
10,880 KB
testcase_07 AC 1,024 ms
11,008 KB
testcase_08 AC 2,806 ms
11,136 KB
testcase_09 AC 2,082 ms
10,880 KB
testcase_10 AC 45 ms
11,008 KB
testcase_11 AC 564 ms
10,880 KB
testcase_12 TLE -
testcase_13 AC 146 ms
10,752 KB
testcase_14 AC 87 ms
10,880 KB
testcase_15 AC 3,443 ms
11,008 KB
testcase_16 AC 1,051 ms
11,008 KB
testcase_17 AC 1,351 ms
10,880 KB
testcase_18 AC 245 ms
10,880 KB
testcase_19 AC 226 ms
11,008 KB
testcase_20 AC 29 ms
10,752 KB
testcase_21 AC 30 ms
10,880 KB
testcase_22 AC 30 ms
10,880 KB
testcase_23 AC 30 ms
10,752 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 30 ms
10,752 KB
testcase_26 AC 30 ms
10,880 KB
testcase_27 AC 31 ms
10,880 KB
testcase_28 AC 30 ms
10,880 KB
testcase_29 AC 30 ms
10,880 KB
testcase_30 TLE -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0