結果

問題 No.1201 お菓子配り-4
ユーザー tktk_snsntktk_snsn
提出日時 2022-05-01 05:46:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 956 ms / 4,000 ms
コード長 276 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 76,628 KB
最終ジャッジ日時 2023-09-12 20:57:47
合計ジャッジ時間 14,034 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
76,292 KB
testcase_01 AC 503 ms
76,372 KB
testcase_02 AC 686 ms
76,136 KB
testcase_03 AC 374 ms
76,136 KB
testcase_04 AC 220 ms
76,628 KB
testcase_05 AC 437 ms
76,456 KB
testcase_06 AC 131 ms
75,992 KB
testcase_07 AC 239 ms
76,440 KB
testcase_08 AC 530 ms
76,420 KB
testcase_09 AC 411 ms
76,544 KB
testcase_10 AC 83 ms
76,460 KB
testcase_11 AC 164 ms
76,544 KB
testcase_12 AC 771 ms
76,460 KB
testcase_13 AC 96 ms
76,360 KB
testcase_14 AC 85 ms
76,128 KB
testcase_15 AC 623 ms
76,136 KB
testcase_16 AC 247 ms
76,388 KB
testcase_17 AC 291 ms
76,404 KB
testcase_18 AC 115 ms
76,328 KB
testcase_19 AC 112 ms
76,124 KB
testcase_20 AC 72 ms
71,220 KB
testcase_21 AC 71 ms
71,176 KB
testcase_22 AC 72 ms
71,344 KB
testcase_23 AC 73 ms
71,060 KB
testcase_24 AC 72 ms
71,208 KB
testcase_25 AC 72 ms
71,124 KB
testcase_26 AC 72 ms
71,272 KB
testcase_27 AC 72 ms
71,388 KB
testcase_28 AC 72 ms
71,268 KB
testcase_29 AC 72 ms
71,276 KB
testcase_30 AC 954 ms
76,572 KB
testcase_31 AC 951 ms
76,608 KB
testcase_32 AC 956 ms
76,496 KB
testcase_33 AC 954 ms
76,340 KB
testcase_34 AC 954 ms
76,328 KB
testcase_35 AC 275 ms
76,432 KB
権限があれば一括ダウンロードができます

ソースコード

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 b in B:
    for a in A:
        ans += a * (b + 1) % mod
        ans -= b - gcd(a, b)
        ans %= mod

print(ans)
0