結果

問題 No.1573 Divisor Function
ユーザー mkawa2mkawa2
提出日時 2021-06-27 15:25:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 1,082 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 11,016 KB
実行使用メモリ 8,308 KB
最終ジャッジ日時 2023-09-07 17:29:17
合計ジャッジ時間 4,271 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,308 KB
testcase_01 AC 17 ms
8,116 KB
testcase_02 AC 93 ms
8,260 KB
testcase_03 AC 16 ms
8,180 KB
testcase_04 AC 16 ms
8,240 KB
testcase_05 AC 16 ms
8,096 KB
testcase_06 AC 16 ms
8,140 KB
testcase_07 AC 16 ms
8,132 KB
testcase_08 AC 17 ms
8,124 KB
testcase_09 AC 16 ms
8,080 KB
testcase_10 AC 17 ms
8,236 KB
testcase_11 AC 17 ms
8,116 KB
testcase_12 AC 17 ms
8,040 KB
testcase_13 AC 17 ms
8,116 KB
testcase_14 AC 17 ms
8,224 KB
testcase_15 AC 16 ms
8,200 KB
testcase_16 AC 17 ms
8,092 KB
testcase_17 AC 17 ms
8,260 KB
testcase_18 AC 83 ms
8,052 KB
testcase_19 AC 91 ms
8,252 KB
testcase_20 AC 60 ms
8,080 KB
testcase_21 AC 89 ms
8,076 KB
testcase_22 AC 76 ms
8,036 KB
testcase_23 AC 68 ms
8,224 KB
testcase_24 AC 75 ms
8,100 KB
testcase_25 AC 92 ms
8,292 KB
testcase_26 AC 80 ms
8,112 KB
testcase_27 AC 67 ms
8,148 KB
testcase_28 AC 60 ms
8,168 KB
testcase_29 AC 83 ms
8,284 KB
testcase_30 AC 82 ms
8,260 KB
testcase_31 AC 69 ms
8,056 KB
testcase_32 AC 85 ms
7,912 KB
testcase_33 AC 92 ms
8,284 KB
testcase_34 AC 41 ms
8,164 KB
testcase_35 AC 61 ms
8,224 KB
testcase_36 AC 37 ms
8,128 KB
testcase_37 AC 87 ms
8,136 KB
testcase_38 AC 93 ms
8,276 KB
testcase_39 AC 92 ms
8,296 KB
testcase_40 AC 92 ms
8,304 KB
testcase_41 AC 93 ms
8,160 KB
testcase_42 AC 93 ms
8,300 KB
testcase_43 AC 93 ms
8,056 KB
testcase_44 AC 93 ms
8,272 KB
testcase_45 AC 94 ms
8,204 KB
権限があれば一括ダウンロードができます

ソースコード

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.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.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 BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
# 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

n, m = LI()
ans = 0

last = -1
for j in range(1, m+1):
    if j**2 > n: break
    cnt = n//j
    last = cnt
    cnt += cnt*(cnt+1)//2%md
    ans += cnt*j
    ans %= md

for c in range(last-1, 0, -1):
    l = n//(c+1)+1
    r = min(n//c, m)
    if l > r: continue
    cnt = (c+c*(c+1)//2)%md
    ans += (l+r)*(r-l+1)//2*cnt%md
    ans %= md
    if n//c > m: break

print(ans)
0