結果
問題 |
No.1666 累乗数
|
ユーザー |
![]() |
提出日時 | 2021-09-02 00:39:28 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 522 bytes |
コンパイル時間 | 457 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 77,488 KB |
最終ジャッジ日時 | 2024-12-15 09:04:07 |
合計ジャッジ時間 | 9,096 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 19 |
ソースコード
# 誤差を無視 # 二分探索の上限をあらかじめ求めておく lim=[0]*60 for i in range(2,60): lim[i]=int((10**18+10000)**(1/i)) def f(n): cnt=[0]*60 for i in range(59,1,-1): ok=int(n**(1/i))-1 # 約数包除 cnt[i]=ok-sum(cnt[::i]) return sum(cnt)+1 t=int(input()) for _ in range(t): k=int(input()) ng,ok=0,10**18 # f(n)>=k となる最小の n を二分探索で求める while abs(ok-ng)>1: mid=(ok+ng)//2 if f(mid)>=k: ok=mid else: ng=mid print(ok)