結果

問題 No.1201 お菓子配り-4
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-10-01 17:13:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 985 ms / 4,000 ms
コード長 403 bytes
コンパイル時間 1,137 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 76,536 KB
最終ジャッジ日時 2023-09-21 07:01:16
合計ジャッジ時間 14,811 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
75,784 KB
testcase_01 AC 515 ms
76,376 KB
testcase_02 AC 709 ms
76,292 KB
testcase_03 AC 383 ms
76,536 KB
testcase_04 AC 225 ms
76,420 KB
testcase_05 AC 450 ms
76,292 KB
testcase_06 AC 133 ms
75,856 KB
testcase_07 AC 247 ms
76,356 KB
testcase_08 AC 546 ms
76,408 KB
testcase_09 AC 423 ms
76,380 KB
testcase_10 AC 80 ms
76,400 KB
testcase_11 AC 168 ms
76,316 KB
testcase_12 AC 794 ms
76,420 KB
testcase_13 AC 99 ms
76,400 KB
testcase_14 AC 85 ms
76,032 KB
testcase_15 AC 639 ms
76,504 KB
testcase_16 AC 248 ms
76,524 KB
testcase_17 AC 297 ms
76,320 KB
testcase_18 AC 114 ms
76,420 KB
testcase_19 AC 110 ms
76,420 KB
testcase_20 AC 72 ms
71,392 KB
testcase_21 AC 72 ms
71,444 KB
testcase_22 AC 72 ms
71,224 KB
testcase_23 AC 71 ms
71,360 KB
testcase_24 AC 72 ms
71,340 KB
testcase_25 AC 72 ms
71,220 KB
testcase_26 AC 71 ms
71,216 KB
testcase_27 AC 74 ms
71,340 KB
testcase_28 AC 71 ms
71,308 KB
testcase_29 AC 72 ms
71,304 KB
testcase_30 AC 984 ms
76,288 KB
testcase_31 AC 985 ms
76,352 KB
testcase_32 AC 984 ms
76,348 KB
testcase_33 AC 981 ms
76,308 KB
testcase_34 AC 983 ms
76,132 KB
testcase_35 AC 332 ms
76,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    from math import gcd
    input = sys.stdin.readline
    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 i in a:
        for j in b:
            ans += (i - 1) * (j + 1) + gcd(i, j) + 1
            ans %= mod
    print(ans)
if __name__ == "__main__":
    main()
0