結果

問題 No.1176 少ない質問
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-14 09:20:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 71,744 KB
最終ジャッジ日時 2023-08-25 18:32:04
合計ジャッジ時間 3,793 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,464 KB
testcase_01 AC 73 ms
71,476 KB
testcase_02 AC 72 ms
71,388 KB
testcase_03 AC 73 ms
71,484 KB
testcase_04 AC 73 ms
71,540 KB
testcase_05 AC 71 ms
71,564 KB
testcase_06 AC 73 ms
71,476 KB
testcase_07 AC 73 ms
71,476 KB
testcase_08 AC 72 ms
71,440 KB
testcase_09 AC 70 ms
71,552 KB
testcase_10 AC 72 ms
71,228 KB
testcase_11 AC 72 ms
71,668 KB
testcase_12 AC 72 ms
71,448 KB
testcase_13 AC 71 ms
71,480 KB
testcase_14 AC 71 ms
71,340 KB
testcase_15 AC 71 ms
71,744 KB
testcase_16 AC 71 ms
71,548 KB
testcase_17 AC 71 ms
71,336 KB
testcase_18 AC 74 ms
71,228 KB
testcase_19 AC 71 ms
71,480 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

"""
n択問題m問なので、m**n通り
答えはmin(nm|a<m**n)
2<=a<=10**18 ~ 2**60
->答えは最大でも120
"""
a=int(input())
ans=120
for x in range(2,120):
  st=set()
  for y in range(1,int(x**0.5)+1):
    if x%y==0:
      st.add((x//y,y))
  for u,v in st:
    if a<pow(u,v):
      ans=min(ans,u*v)
    if a<pow(v,u):
      ans=min(ans,u*v)
print(ans)
0