結果
| 問題 |
No.3236 累乗数大好きbot
|
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-08-16 01:18:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 349 ms |
| コンパイル使用メモリ | 82,240 KB |
| 実行使用メモリ | 207,608 KB |
| 最終ジャッジ日時 | 2025-08-16 01:19:10 |
| 合計ジャッジ時間 | 10,058 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 TLE * 2 -- * 24 |
ソースコード
from functools import cache
@cache
def p(x,y):
if y==0:
return 1
elif y==1:
return x
elif y%2==1:
return p(x,y//2)*p(x,y//2)*x
else:
return p(x,y//2)*p(x,y//2)
T=int(input())
for _ in range(T):
n=int(input())
for k in reversed(range(2,40)):
ok=0
ng=10**6
while ng-ok>1:
m=(ok+ng)//2
if p(m,k)<=n:
ok=m
else:
ng=m
if ok**k==n:
print(k)
break
else:
print(1)
sasa8uyauya