結果

問題 No.1573 Divisor Function
ユーザー vwxyzvwxyz
提出日時 2023-11-28 15:16:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 24,448 KB
最終ジャッジ日時 2023-11-28 15:16:53
合計ジャッジ時間 7,179 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,984 KB
testcase_01 AC 30 ms
9,984 KB
testcase_02 AC 176 ms
24,448 KB
testcase_03 AC 28 ms
9,984 KB
testcase_04 AC 28 ms
9,984 KB
testcase_05 AC 28 ms
9,984 KB
testcase_06 AC 30 ms
9,984 KB
testcase_07 AC 29 ms
9,984 KB
testcase_08 AC 30 ms
9,984 KB
testcase_09 AC 30 ms
9,984 KB
testcase_10 AC 29 ms
9,984 KB
testcase_11 AC 29 ms
9,984 KB
testcase_12 AC 29 ms
9,984 KB
testcase_13 AC 29 ms
9,984 KB
testcase_14 AC 30 ms
9,984 KB
testcase_15 AC 29 ms
9,984 KB
testcase_16 AC 30 ms
9,984 KB
testcase_17 AC 29 ms
9,984 KB
testcase_18 AC 156 ms
22,656 KB
testcase_19 AC 171 ms
24,192 KB
testcase_20 AC 113 ms
18,560 KB
testcase_21 AC 167 ms
23,552 KB
testcase_22 AC 147 ms
21,760 KB
testcase_23 AC 129 ms
19,712 KB
testcase_24 AC 147 ms
21,248 KB
testcase_25 AC 175 ms
24,320 KB
testcase_26 AC 153 ms
22,272 KB
testcase_27 AC 131 ms
19,712 KB
testcase_28 AC 113 ms
18,688 KB
testcase_29 AC 160 ms
22,912 KB
testcase_30 AC 157 ms
22,144 KB
testcase_31 AC 128 ms
19,712 KB
testcase_32 AC 160 ms
22,784 KB
testcase_33 AC 175 ms
24,192 KB
testcase_34 AC 77 ms
14,720 KB
testcase_35 AC 113 ms
18,560 KB
testcase_36 AC 69 ms
13,824 KB
testcase_37 AC 162 ms
23,424 KB
testcase_38 AC 174 ms
24,448 KB
testcase_39 AC 175 ms
24,448 KB
testcase_40 AC 172 ms
24,448 KB
testcase_41 AC 175 ms
24,448 KB
testcase_42 AC 180 ms
24,448 KB
testcase_43 AC 175 ms
24,448 KB
testcase_44 AC 179 ms
24,448 KB
testcase_45 AC 176 ms
24,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

def Inverse_Proportion(N):
    retu=[]
    for i in range(1,N+1):
        if i==N or N//i>N//(i+1):
            retu.append(((i,i+1),N//i))
        else:
            for j in range(N//i,0,-1):
                retu.append(((N//(j+1)+1,N//j+1),j))
            break
    return retu

N,M=map(int,readline().split())
mod=998244353
ans=0
for (l,r),j in Inverse_Proportion(N):
    l=min(l,M+1)
    r=min(r,M+1)
    ans+=(l+r-1)*(r-l)//2*j*(j+1)//2+(l+r-1)*(r-l)//2*j
    ans%=mod
print(ans)
0