結果

問題 No.1260 たくさんの多項式
ユーザー tanon710tanon710
提出日時 2020-10-17 02:00:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 269 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 77,588 KB
最終ジャッジ日時 2023-09-28 07:13:21
合計ジャッジ時間 13,067 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
76,684 KB
testcase_01 AC 75 ms
77,104 KB
testcase_02 AC 72 ms
76,680 KB
testcase_03 AC 75 ms
76,752 KB
testcase_04 AC 72 ms
76,684 KB
testcase_05 AC 73 ms
76,736 KB
testcase_06 AC 72 ms
76,600 KB
testcase_07 AC 69 ms
77,064 KB
testcase_08 AC 74 ms
76,816 KB
testcase_09 AC 73 ms
77,056 KB
testcase_10 AC 73 ms
77,068 KB
testcase_11 AC 71 ms
77,040 KB
testcase_12 AC 72 ms
76,604 KB
testcase_13 AC 70 ms
76,824 KB
testcase_14 AC 71 ms
77,052 KB
testcase_15 AC 70 ms
76,868 KB
testcase_16 AC 69 ms
77,048 KB
testcase_17 AC 71 ms
77,156 KB
testcase_18 AC 72 ms
77,120 KB
testcase_19 AC 71 ms
77,044 KB
testcase_20 AC 269 ms
77,140 KB
testcase_21 AC 126 ms
76,892 KB
testcase_22 AC 239 ms
77,156 KB
testcase_23 AC 205 ms
76,680 KB
testcase_24 AC 210 ms
76,812 KB
testcase_25 AC 183 ms
77,148 KB
testcase_26 AC 202 ms
76,976 KB
testcase_27 AC 174 ms
76,668 KB
testcase_28 AC 260 ms
77,528 KB
testcase_29 AC 216 ms
77,140 KB
testcase_30 AC 158 ms
77,128 KB
testcase_31 AC 206 ms
76,796 KB
testcase_32 AC 206 ms
76,680 KB
testcase_33 AC 184 ms
77,028 KB
testcase_34 AC 260 ms
77,584 KB
testcase_35 AC 149 ms
76,652 KB
testcase_36 AC 140 ms
76,664 KB
testcase_37 AC 208 ms
77,140 KB
testcase_38 AC 223 ms
77,520 KB
testcase_39 AC 259 ms
77,300 KB
testcase_40 AC 216 ms
76,884 KB
testcase_41 AC 241 ms
77,508 KB
testcase_42 AC 199 ms
77,180 KB
testcase_43 AC 247 ms
77,588 KB
testcase_44 AC 194 ms
76,792 KB
testcase_45 AC 177 ms
77,116 KB
testcase_46 AC 178 ms
76,648 KB
testcase_47 AC 203 ms
77,060 KB
testcase_48 AC 95 ms
77,032 KB
testcase_49 AC 167 ms
77,032 KB
testcase_50 AC 122 ms
76,796 KB
testcase_51 AC 253 ms
77,468 KB
testcase_52 AC 135 ms
76,940 KB
testcase_53 AC 153 ms
76,968 KB
testcase_54 AC 260 ms
77,456 KB
testcase_55 AC 264 ms
77,304 KB
testcase_56 AC 160 ms
77,020 KB
testcase_57 AC 211 ms
76,596 KB
testcase_58 AC 154 ms
77,028 KB
testcase_59 AC 211 ms
76,964 KB
testcase_60 AC 266 ms
77,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7

n=int(input())
ans=0
for i in range(2,int(n**0.5)+1):
    tn=n
    while tn!=0:
        ans+=tn%i
        tn//=i
    ans%=mod
for i in range(1,int(n**0.5)+1):
    l=max(n//(i+1)+1,int(n**0.5)+1)
    r=n//i
    ans+=i*(r-l+1)
    ans+=i*(((r-l)*(r-l+1))//2)+(n%r)*(r-l+1)
    ans%=mod
print(ans)
0