結果

問題 No.1201 お菓子配り-4
ユーザー mkawa2mkawa2
提出日時 2021-07-06 12:18:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 824 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 13,000 KB
最終ジャッジ日時 2023-09-14 04:21:34
合計ジャッジ時間 51,371 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
7,948 KB
testcase_01 AC 2,005 ms
8,472 KB
testcase_02 AC 2,873 ms
8,508 KB
testcase_03 AC 1,416 ms
8,032 KB
testcase_04 AC 691 ms
8,116 KB
testcase_05 AC 1,750 ms
8,452 KB
testcase_06 AC 271 ms
7,948 KB
testcase_07 AC 819 ms
8,036 KB
testcase_08 AC 2,160 ms
8,472 KB
testcase_09 AC 1,640 ms
8,448 KB
testcase_10 AC 28 ms
7,900 KB
testcase_11 AC 431 ms
8,400 KB
testcase_12 AC 3,152 ms
8,500 KB
testcase_13 AC 106 ms
8,320 KB
testcase_14 AC 60 ms
8,000 KB
testcase_15 AC 2,553 ms
8,660 KB
testcase_16 AC 764 ms
7,976 KB
testcase_17 AC 1,059 ms
7,968 KB
testcase_18 AC 177 ms
8,152 KB
testcase_19 AC 173 ms
8,336 KB
testcase_20 AC 16 ms
8,324 KB
testcase_21 AC 16 ms
8,224 KB
testcase_22 AC 16 ms
8,384 KB
testcase_23 AC 16 ms
8,284 KB
testcase_24 AC 16 ms
8,376 KB
testcase_25 AC 16 ms
8,212 KB
testcase_26 AC 16 ms
8,368 KB
testcase_27 AC 16 ms
8,248 KB
testcase_28 AC 16 ms
8,248 KB
testcase_29 AC 17 ms
8,252 KB
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
# md = 998244353
md = 10**9+7

from math import gcd

n = II()
m = II()
aa = LI()
bb = LI()

ans = 0
for a in aa:
    for b in bb:
        s = (a+1)*(b+1)
        t = gcd(a, b)+1
        ans += ((s+t)//2-b-1)*2
        ans %= md
print(ans)
0