結果
| 問題 | No.1666 累乗数 |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-09-03 22:25:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 562 bytes |
| 記録 | |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 85,208 KB |
| 実行使用メモリ | 81,832 KB |
| 最終ジャッジ日時 | 2026-05-26 00:57:13 |
| 合計ジャッジ時間 | 4,614 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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