結果
問題 |
No.3236 累乗数大好きbot
|
ユーザー |
![]() |
提出日時 | 2025-08-16 01:18:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 453 bytes |
コンパイル時間 | 350 ms |
コンパイル使用メモリ | 82,556 KB |
実行使用メモリ | 165,124 KB |
最終ジャッジ日時 | 2025-08-16 01:18:30 |
合計ジャッジ時間 | 10,373 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 5 TLE * 1 -- * 25 |
ソースコード
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)*y 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)