結果

問題 No.1666 累乗数
コンテスト
ユーザー wasd314
提出日時 2026-08-17 07:55:12
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 496 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 247 ms
コンパイル使用メモリ 96,228 KB
実行使用メモリ 87,780 KB
最終ジャッジ日時 2026-08-17 07:55:22
合計ジャッジ時間 8,513 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import bisect
from functools import cache

@cache
def count_le(n):
    if n < 1:
        return 0
    ans = 1
    for b in range(2, n + 1):
        if 2**b > n:
            break
        a = bisect.bisect_right(range(n + 1), n, key=lambda a: a**b) - 1
        ans += a - count_le(a)
    return ans


def solve(k):
    ans = bisect.bisect_left(range(10**18 * 2), k, key=count_le)
    return ans


case_t = 1
case_t = int(input())
for _ in [None] * case_t:
    k = int(input())
    print(solve(k))
0