結果

問題 No.1201 お菓子配り-4
ユーザー mlihua09mlihua09
提出日時 2020-08-28 22:37:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 812 ms / 4,000 ms
コード長 347 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 76,436 KB
最終ジャッジ日時 2024-04-26 13:31:18
合計ジャッジ時間 10,552 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
60,600 KB
testcase_01 AC 407 ms
76,216 KB
testcase_02 AC 576 ms
76,212 KB
testcase_03 AC 298 ms
62,512 KB
testcase_04 AC 164 ms
60,396 KB
testcase_05 AC 344 ms
63,368 KB
testcase_06 AC 88 ms
59,776 KB
testcase_07 AC 179 ms
61,276 KB
testcase_08 AC 426 ms
62,836 KB
testcase_09 AC 323 ms
62,524 KB
testcase_10 AC 47 ms
60,708 KB
testcase_11 AC 114 ms
60,824 KB
testcase_12 AC 648 ms
76,132 KB
testcase_13 AC 57 ms
60,280 KB
testcase_14 AC 49 ms
58,708 KB
testcase_15 AC 505 ms
62,564 KB
testcase_16 AC 184 ms
62,116 KB
testcase_17 AC 226 ms
61,004 KB
testcase_18 AC 73 ms
62,700 KB
testcase_19 AC 71 ms
59,900 KB
testcase_20 AC 38 ms
53,620 KB
testcase_21 AC 36 ms
52,876 KB
testcase_22 AC 38 ms
52,760 KB
testcase_23 AC 38 ms
53,016 KB
testcase_24 AC 37 ms
53,240 KB
testcase_25 AC 38 ms
52,584 KB
testcase_26 AC 38 ms
53,848 KB
testcase_27 AC 38 ms
52,400 KB
testcase_28 AC 38 ms
53,616 KB
testcase_29 AC 37 ms
52,584 KB
testcase_30 AC 812 ms
76,220 KB
testcase_31 AC 800 ms
76,268 KB
testcase_32 AC 793 ms
76,232 KB
testcase_33 AC 798 ms
76,148 KB
testcase_34 AC 805 ms
76,436 KB
testcase_35 AC 53 ms
63,344 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