結果

問題 No.1260 たくさんの多項式
ユーザー 37zigen37zigen
提出日時 2020-12-19 06:48:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 463 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 10,156 KB
最終ジャッジ日時 2023-10-21 09:00:14
合計ジャッジ時間 69,791 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,489 ms
10,140 KB
testcase_01 AC 1,503 ms
10,140 KB
testcase_02 AC 1,491 ms
10,140 KB
testcase_03 AC 1,493 ms
10,140 KB
testcase_04 AC 1,441 ms
10,140 KB
testcase_05 AC 1,517 ms
10,140 KB
testcase_06 AC 1,500 ms
10,140 KB
testcase_07 AC 1,501 ms
10,140 KB
testcase_08 AC 1,465 ms
10,140 KB
testcase_09 AC 1,482 ms
10,140 KB
testcase_10 AC 1,511 ms
10,140 KB
testcase_11 AC 1,476 ms
10,140 KB
testcase_12 AC 1,568 ms
10,140 KB
testcase_13 AC 1,503 ms
10,140 KB
testcase_14 AC 1,473 ms
10,140 KB
testcase_15 AC 1,504 ms
10,140 KB
testcase_16 AC 1,486 ms
10,140 KB
testcase_17 AC 1,478 ms
10,140 KB
testcase_18 AC 1,511 ms
10,140 KB
testcase_19 AC 1,528 ms
10,140 KB
testcase_20 TLE -
testcase_21 AC 1,809 ms
10,140 KB
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 AC 1,950 ms
10,140 KB
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 1,953 ms
10,156 KB
testcase_36 AC 1,944 ms
10,156 KB
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 AC 1,759 ms
10,156 KB
testcase_49 TLE -
testcase_50 AC 1,784 ms
10,156 KB
testcase_51 TLE -
testcase_52 AC 1,875 ms
10,156 KB
testcase_53 AC 1,971 ms
10,156 KB
testcase_54 TLE -
testcase_55 TLE -
testcase_56 AC 1,970 ms
10,156 KB
testcase_57 TLE -
testcase_58 AC 1,949 ms
10,156 KB
testcase_59 TLE -
testcase_60 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x, b):
    ret = 0
    while x > 0:
        ret += x % b
        x //= b
    return ret


p = 10**9 + 7
N = int(input())
ans = 0

L = min(N + 1, 10**6)
for i in range(2, L):
    ans += f(N, i)
    ans %= p

for a1 in range(1, 10 ** 6):
    r = min(N, N // a1)
    l = max(L - 1, N // (1 + a1))
    if r - l <= 0:
        continue
    ans += (r - l) * a1 % p
    ans %= p
    ans += N * (r - l) - a1 * (r - l) * (r + l + 1) // 2 % p
    ans %= p

print(ans)
0