結果

問題 No.1666 累乗数
ユーザー 👑 rin204rin204
提出日時 2023-12-20 22:45:54
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 668 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,448 KB
最終ジャッジ日時 2023-12-20 22:46:05
合計ジャッジ時間 10,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
83,072 KB
testcase_01 AC 1,593 ms
76,780 KB
testcase_02 AC 1,700 ms
77,068 KB
testcase_03 AC 1,715 ms
76,684 KB
testcase_04 AC 1,660 ms
77,196 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

M = 65

for _ in range(int(input())):
    k = int(input())
    if k == 1:
        print(1)
        continue

    k -= 1
    l = 1
    r = 10**18
    while r - l > 1:
        cnt = 0
        m = (l + r) // 2
        C = [0] * (M + 1)
        for i in range(M, 1, -1):
            c = int(m ** (1 / i))
            while pow(c, i) <= m:
                c += 1
            while pow(c, i) > m:
                c -= 1
            c -= 1
            C[i] = c
            for j in range(i + 1, M + 1):
                if j % i == 0:
                    C[i] -= C[j]
            cnt += C[i]
        if cnt >= k:
            r = m
        else:
            l = m
    print(r)
0