結果

問題 No.1201 お菓子配り-4
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-10-01 17:12:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,334 ms / 4,000 ms
コード長 403 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 8,596 KB
最終ジャッジ日時 2023-09-21 07:00:58
合計ジャッジ時間 28,060 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
7,944 KB
testcase_01 AC 1,027 ms
8,536 KB
testcase_02 AC 1,470 ms
8,392 KB
testcase_03 AC 719 ms
7,892 KB
testcase_04 AC 359 ms
7,944 KB
testcase_05 AC 876 ms
7,896 KB
testcase_06 AC 145 ms
7,884 KB
testcase_07 AC 401 ms
7,912 KB
testcase_08 AC 1,094 ms
8,552 KB
testcase_09 AC 809 ms
8,404 KB
testcase_10 AC 22 ms
7,896 KB
testcase_11 AC 220 ms
7,900 KB
testcase_12 AC 1,665 ms
8,532 KB
testcase_13 AC 60 ms
7,896 KB
testcase_14 AC 38 ms
7,884 KB
testcase_15 AC 1,311 ms
8,596 KB
testcase_16 AC 409 ms
7,916 KB
testcase_17 AC 522 ms
7,976 KB
testcase_18 AC 97 ms
7,916 KB
testcase_19 AC 92 ms
7,916 KB
testcase_20 AC 16 ms
7,892 KB
testcase_21 AC 16 ms
7,912 KB
testcase_22 AC 15 ms
7,916 KB
testcase_23 AC 15 ms
7,996 KB
testcase_24 AC 16 ms
7,884 KB
testcase_25 AC 16 ms
7,836 KB
testcase_26 AC 16 ms
7,892 KB
testcase_27 AC 16 ms
7,936 KB
testcase_28 AC 16 ms
7,888 KB
testcase_29 AC 16 ms
7,892 KB
testcase_30 AC 2,105 ms
8,580 KB
testcase_31 AC 2,094 ms
8,444 KB
testcase_32 AC 2,114 ms
8,532 KB
testcase_33 AC 2,097 ms
8,512 KB
testcase_34 AC 2,112 ms
8,368 KB
testcase_35 AC 3,334 ms
8,452 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