結果
問題 |
No.1666 累乗数
|
ユーザー |
![]() |
提出日時 | 2021-09-03 21:51:12 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 580 bytes |
コンパイル時間 | 302 ms |
コンパイル使用メモリ | 81,776 KB |
実行使用メモリ | 87,680 KB |
最終ジャッジ日時 | 2024-12-15 12:33:54 |
合計ジャッジ時間 | 58,888 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | TLE * 19 |
ソースコード
import sys input=sys.stdin.readline #文字列入力はするな!! from math import log def f(x): if x==0:return 0 res=1 for b in range(2,64): ok=0 ng=log(10**18)/log(b) ng+=10 ng=int(ng) while ng-ok>1: mid=(ok+ng)//2 if mid**b<=x:ok=mid else:ng=mid res+=ok-1 if x>=16:res-=1 return res T=int(input()) for _ in range(T): k=int(input()) ok=10**18+10 ng=0 while ok-ng>1: mid=(ok+ng)//2 if f(mid)>=k:ok=mid else:ng=mid print(ok)