結果
| 問題 |
No.1666 累乗数
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-09-03 22:25:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 562 bytes |
| コンパイル時間 | 176 ms |
| コンパイル使用メモリ | 82,296 KB |
| 実行使用メモリ | 77,120 KB |
| 最終ジャッジ日時 | 2024-12-15 14:32:32 |
| 合計ジャッジ時間 | 6,074 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 19 |
ソースコード
import sys
input = sys.stdin.readline
P=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61]
def calc(x):
if x==1:
return 1
ANS=1
for p in P:
y=int(x**(1/p))
for i in range(max(2,y-2),y+2):
if i**p>x:
ANS+=i-2
break
return ANS
T=int(input())
for tests in range(T):
n=int(input())
OK=10**18
NG=0
while OK>NG+1:
mid=(OK+NG)//2
#print(mid,calc(mid))
if calc(mid)>=n:
OK=mid
else:
NG=mid
print(OK)
titia