結果

問題 No.1176 少ない質問
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-14 09:29:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 1,000 ms
コード長 358 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 76,120 KB
最終ジャッジ日時 2023-08-25 18:39:20
合計ジャッジ時間 2,673 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
75,676 KB
testcase_01 AC 62 ms
76,120 KB
testcase_02 AC 64 ms
75,828 KB
testcase_03 AC 64 ms
75,840 KB
testcase_04 AC 65 ms
75,812 KB
testcase_05 AC 63 ms
75,732 KB
testcase_06 AC 62 ms
75,844 KB
testcase_07 AC 65 ms
75,964 KB
testcase_08 AC 64 ms
75,892 KB
testcase_09 AC 63 ms
75,876 KB
testcase_10 AC 62 ms
75,676 KB
testcase_11 AC 66 ms
75,788 KB
testcase_12 AC 68 ms
75,668 KB
testcase_13 AC 67 ms
75,980 KB
testcase_14 AC 68 ms
75,912 KB
testcase_15 AC 66 ms
75,820 KB
testcase_16 AC 62 ms
75,740 KB
testcase_17 AC 63 ms
76,048 KB
testcase_18 AC 68 ms
75,820 KB
testcase_19 AC 64 ms
75,984 KB
testcase_20 AC 63 ms
75,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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