結果

問題 No.1201 お菓子配り-4
ユーザー mlihua09mlihua09
提出日時 2020-08-28 22:37:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 951 ms / 4,000 ms
コード長 347 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 77,536 KB
最終ジャッジ日時 2023-08-08 21:15:27
合計ジャッジ時間 13,661 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
76,472 KB
testcase_01 AC 492 ms
77,236 KB
testcase_02 AC 670 ms
77,076 KB
testcase_03 AC 366 ms
76,816 KB
testcase_04 AC 215 ms
76,468 KB
testcase_05 AC 426 ms
76,824 KB
testcase_06 AC 129 ms
76,608 KB
testcase_07 AC 234 ms
76,344 KB
testcase_08 AC 517 ms
76,752 KB
testcase_09 AC 404 ms
76,692 KB
testcase_10 AC 79 ms
76,488 KB
testcase_11 AC 161 ms
76,728 KB
testcase_12 AC 769 ms
77,360 KB
testcase_13 AC 92 ms
76,708 KB
testcase_14 AC 81 ms
75,964 KB
testcase_15 AC 614 ms
76,764 KB
testcase_16 AC 241 ms
76,864 KB
testcase_17 AC 284 ms
76,756 KB
testcase_18 AC 110 ms
76,384 KB
testcase_19 AC 106 ms
76,340 KB
testcase_20 AC 68 ms
71,536 KB
testcase_21 AC 69 ms
71,272 KB
testcase_22 AC 70 ms
71,220 KB
testcase_23 AC 69 ms
71,380 KB
testcase_24 AC 68 ms
71,216 KB
testcase_25 AC 68 ms
71,460 KB
testcase_26 AC 71 ms
71,276 KB
testcase_27 AC 69 ms
71,552 KB
testcase_28 AC 69 ms
71,720 KB
testcase_29 AC 68 ms
71,416 KB
testcase_30 AC 948 ms
77,524 KB
testcase_31 AC 944 ms
77,376 KB
testcase_32 AC 951 ms
77,396 KB
testcase_33 AC 947 ms
77,536 KB
testcase_34 AC 950 ms
77,424 KB
testcase_35 AC 273 ms
76,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

M = int(input())

A = list(map(int, input().split()))

a = sum(A)

ans = 0

from math import gcd

P = 10 ** 9 + 7

for b in map(int, input().split()):
    
    x = 0
    
    for i in A:
        
        g = gcd(i, b)
        
        x -= b - g
        
    x += a * (b + 1)
    
    ans += x
    
    ans %= P
    
print(ans)
0