結果

問題 No.1201 お菓子配り-4
ユーザー ayaoniayaoni
提出日時 2020-11-26 20:27:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 955 ms / 4,000 ms
コード長 356 bytes
コンパイル時間 1,018 ms
コンパイル使用メモリ 87,332 KB
実行使用メモリ 77,148 KB
最終ジャッジ日時 2023-10-01 03:29:28
合計ジャッジ時間 14,838 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
76,800 KB
testcase_01 AC 500 ms
77,076 KB
testcase_02 AC 692 ms
77,064 KB
testcase_03 AC 372 ms
77,020 KB
testcase_04 AC 226 ms
76,732 KB
testcase_05 AC 442 ms
76,936 KB
testcase_06 AC 134 ms
76,756 KB
testcase_07 AC 242 ms
77,056 KB
testcase_08 AC 530 ms
76,688 KB
testcase_09 AC 412 ms
76,924 KB
testcase_10 AC 86 ms
76,984 KB
testcase_11 AC 168 ms
76,692 KB
testcase_12 AC 767 ms
76,984 KB
testcase_13 AC 95 ms
76,848 KB
testcase_14 AC 86 ms
76,896 KB
testcase_15 AC 623 ms
77,148 KB
testcase_16 AC 243 ms
76,980 KB
testcase_17 AC 290 ms
76,920 KB
testcase_18 AC 111 ms
77,036 KB
testcase_19 AC 110 ms
76,736 KB
testcase_20 AC 72 ms
71,788 KB
testcase_21 AC 71 ms
71,744 KB
testcase_22 AC 71 ms
71,252 KB
testcase_23 AC 72 ms
71,188 KB
testcase_24 AC 71 ms
71,528 KB
testcase_25 AC 71 ms
71,436 KB
testcase_26 AC 71 ms
71,528 KB
testcase_27 AC 70 ms
71,420 KB
testcase_28 AC 72 ms
71,456 KB
testcase_29 AC 71 ms
71,184 KB
testcase_30 AC 950 ms
76,692 KB
testcase_31 AC 954 ms
76,756 KB
testcase_32 AC 951 ms
77,016 KB
testcase_33 AC 955 ms
77,084 KB
testcase_34 AC 942 ms
76,868 KB
testcase_35 AC 279 ms
76,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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