Problem:


Score : 200 points

Problem Statement

You are given a positive integer X.
Find the largest perfect power that is at most X.
Here, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2.

Constraints

1 ≤ X ≤ 1000

X is an integer.

Input

Input is given from Standard Input in the following format:

X

Output

Print the largest perfect power that is at most X.

Sample Input 1

10

Sample Output 1

9

There are four perfect powers that are at most 10: 1, 4, 8 and 9.
We should print the largest among them, 9.

Sample Input 2

1

Sample Output 2

1

Sample Input 3

999

Sample Output 3

961



Sample input:
10


Sample output:
9

Submission status: Runtime Error

Solution code:
X = int(input())

for n in range(32):
    for e in range(2,11):
        if n**e <= X:
            se = set(n**e)

answer = max(se)
print(answer)

Submission status: Runtime Error

Solution code:
#pypyは内包表記使わない, rstrip注意
#提出前に見返すこと！
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 1000000007

    x = int(input())
    for i in range(x, 0, -1):
        for b in range(1, 35):
            for p in range(2, 10):
                if b**p==i:
                    print(i)
                    eixt()

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x=int(input())
i,j=2,1
ans=[]
while True:
    j+=1
    if i**j>x:
        i+=1
        j=2
        if i**j>x:
            break
    ans.append(i**j)
print(max(ans))

Submission status: Runtime Error

Solution code:

x=int(input())
a=[]
ans=0

for i in range(1,32):
            for j in range(2,10):
                        ans=i**j
                        if ans<x:
                                    a.append(ans)   
                                    i+=1
                        else:
                                    break
                        
            #print(a)
print(max(a))
"""
while ans<x:
"""

Submission status: Runtime Error

Solution code:
x=int(input())
ans=0
for i in range(1,32):
  for j in range(2,11):
    if pow(i,j)=<x:
      ans=max(pow(i,j),ans)
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
 
ans=0
for i in range(1,x):
    for j in range(2,x):
        if b**p<=x:
            ans=b**p
        else:
            break
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
print(max(i ** j for i in range(2, 34) for j in range(2, 11) if i ** j <= x))

Submission status: Runtime Error

Solution code:
n =(int)(input().split())
ans=0
for i in range(n):
  if i*i <= n:
    ans =i
print(ans)

Submission status: Runtime Error

Solution code:
n =map(int,input().split())
ans=0
for i in range(n):
  if i*i <= n:
    ans =i
print(ans)

Submission status: Runtime Error

Solution code:
X = int(input())
l = []
for i in range(2, int(X ** 0.5) + 1):
  j = 2
  while i ** j <= X:
    j += 1
  l.append(i ** j)
l.sort()
print(l[-1])

Submission status: Runtime Error

Solution code:
x=int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
li=[]
def f(n):
  c=0
  while x%n==0:
    x //= n
    c+=1
  return c
ans=0
for p in prime:
  ans = max(ans,f(p))
print(ans)

Submission status: Runtime Error

Solution code:
from math import log, sqrt
max_num = 1
for i in range(2, int(sqrt(X)) + 1):
    max_num = max(max_num, i ** int(log(X, i)))

print(max_num)

Submission status: Runtime Error

Solution code:
x = int(input())
c = 1
for i in range(1,x):
    for j in range(2,x)
        if i**j <= x:
            c = max(c, i**j)
        else:break
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
ans =[]
for i in range(1,n//2+2):
     for j in range(2,10):
          if i**j <= n:
print(max(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
ans =[]
for i in range(1,n//2+1):
     for j in range(2,10):
          if i**j <= n:
               ans.append(i**j)

print(max(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
ans =[]
for i in range(1,n//2+1):
     for j in range(10):
          if i**j < n:
               ans.append(i**j)

print(max(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
ans =[]
for i in range(1,n//2):
     for j in range(1,10):
          if i**j < n:
               ans.append(i**j)

print(max(ans))

Submission status: Runtime Error

Solution code:
X=int(input())
list=[]
for i in range(1, X):
  for j in range(2, X):
    if (i**j)<=X:
      list.append(i**j)
print(max(list))

Submission status: Runtime Error

Solution code:
X=int(input())
list=[]
for i in range(1, X):
  for j in range(2, X):
    if i**j<=X:
      list.append(i**j)
print(max(list))

Submission status: Runtime Error

Solution code:
X=int(input())
max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        if max>1:
          max=i**j
        else:
          break
print(max)

Submission status: Runtime Error

Solution code:
X=int(input())
for i in range(1, X):
	for j in range(2, X):
      if i**j<=X:
        max=i**j
      else:
        break
print(max(1, max))

Submission status: Runtime Error

Solution code:
X=int(input())
max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        max=i**j
      else:
        break
print(max(1, max))

Submission status: Runtime Error

Solution code:
X=int(input())
If X==1:
  max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        max=i**j
print(max)

Submission status: Runtime Error

Solution code:
=int(input())
for i in range(1, X):
  for j in range(2, X):
    if i**j<=X:
      max=i**j
print(max)

Submission status: Runtime Error

Solution code:
x=int(input())
c=1
for b in range(1,x):
    for p in rangenge(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)

Submission status: Runtime Error

Solution code:
from bisect import bisect_left
n = input()
lst = []
lst.append(1)
for i in range(2, int(math.sqrt(1000)) + 1):
    for j in range(2, 10):
        if i ** j <= 1000 and i ** j not in lst:
            lst.append(i ** j)

lst.sort()
print(lst[bisect_left(lst, n) - 1] if n not in lst else lst[bisect_left(lst, n)])

Submission status: Runtime Error

Solution code:
import numpy as np
X = int(input())
ans = 1
for b in range(int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.pow(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.pow(b, p))
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
X = int(input())
ans = 1
for b in range(np.ceil(np.sqrt(X))):
    p = 0
    while b**p <= X:
        p += 1
    p -= 1
    ans = max(ans, b**p)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
X = int(input())
for b in range(np.ceil(np.sqrt(X))):
    p = 0
    while b**p <= X:
        p += 1
    p -= 1
    ans = max(ans, b**p)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
for i in reversed(range(n + 1)):
    if math.sqrt(i).is_integer():
        print(i)
        break

Submission status: Runtime Error

Solution code:
z

Submission status: Runtime Error

Solution code:
X = int(input())
if X == 1:
    print(1)
else:
    maxa = 0
    for i in range(2,32):
        for j in range(2,11):
            if i**j <= X:
                maxa = max(maxa,i**j)
print(maxa)

Submission status: Runtime Error

Solution code:
x=int(input())
for i in range(1,x+1):
  if (i**2)>x:
    ans=(i-1)**2
    break
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
for i in range(1,x+1):
  if i**2>x:
    ans=(i-1)**2
    break
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
i=0
a=[]
while x>=i**2:
    i+=1
    a.append((i-1)**2)
    while x>=i**j:
        j+=1
        a.append((i-1)**j)
print(max(a))

Submission status: Runtime Error

Solution code:
x = int(input())
ans = 0
for b in range(1, x):
    for p in range(2, x):
        if b ** p <= x:
            ans = max(ansm, b**p)

print(ans)

Submission status: Runtime Error

Solution code:
import math
x=int(input())
ans=[1]
for i in range(2,x+1):
    #print(i)
    k=math.floor(math.log(x,i)))
    ans.append(i**(k+1))
print(max(ans))
#print(ans)

Submission status: Runtime Error

Solution code:
import math
x=int(input())
ans=[1]
for i in range(2,x+1):
    #print(i)
    k=math.floor(math.ceil(x,i))
    ans.append(i**k)
print(max(ans))
#print(ans)

Submission status: Runtime Error

Solution code:
A=[1]
for i in range(1,33):
  for j in range(1, 11):
    if i**j<X:
      A.append(i**j)
print(A[-1])

Submission status: Runtime Error

Solution code:
X=int(input())
Y=[]
for i in range(1,X):
    for j in range(2,X):
        if pow(i,j)>X:
            break
        Y.append(pow(i,j))

print(max(Y))

Submission status: Runtime Error

Solution code:
X=int(input())
Y=[]
for i in range(1,X):
    for j in range(2,X):
        if pow(i,j)>X:
            break;
        Y.append(pow(i,j))

print(max(Y))

Submission status: Runtime Error

Solution code:
X=int(input())
Y=[]
for i in range(1,X):
    for j in range(2,X):
        if i**j>X:
            break;
        Y.append(i**j)

print(max(Y))

Submission status: Runtime Error

Solution code:
X = int(input())
A =[]
for b in range(1,int(X**0.5)+1):
  for p in range(2,X):
    if b**p > X:
      A.append(b**(p-1))
      break
print(max(A))

Submission status: Runtime Error

Solution code:
a=int(input())
import math
b=int(math.log(a, 2)
c=1
if b!=1:
  for i in range(2,b+1,1):
    c=max(c,int(a**(1/i))**i)
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
import math
b=int(math.sqrt(a))
c=1
for i in range(b):
  c=max(c,int(a**(1/i))**i)
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
import math
b=int(math.sqrt(a))
c=1
for i in range(b):
  c=max(c,(int(a**(1/i)))**i)
print(c)

Submission status: Runtime Error

Solution code:
Jupyter Notebook
ABC098B
Current Kernel Logo
Python 3 
File
Edit
View
Insert
Cell
Kernel
Widgets
Help

X =int(input())
ans = 0
for i in range(1,X+1):
    for j in range(2,11):
        A = i ** j
        if(A<=X):
            ans = max(ans,A)
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
a=[]
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**j<=x:
            a.append(i**j)
print(max(a))

Submission status: Runtime Error

Solution code:
x=int(input())
a=[]
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**j<=x:
            a.append(i**j)
print(max(set(a)))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
x=int(input())
ans=[]
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**j<=x:
            ans.append(i**j)
        else:
            break
ans.sort(reverse=True)
print(ans[0])
#print(ans)

Submission status: Runtime Error

Solution code:
X=int(input())
c=[]
for i in range(0,X):
  for k in range(2,X):
    if (i+1)**k<=X:
      c.append((i+1)**k)
print(max(c))

Submission status: Runtime Error

Solution code:
x = int(input())
ans = []
for i in range(1,x):
    for j in range(2,10):
        if i**j > x:
            break
        else:
            ans.append(i**j)
print(max(ans))

Submission status: Runtime Error

Solution code:
x = int(input())
l = []
for i in range(1, x+1): #b
  for j in range(2, x+1): #p
    bq = i**j
    if bq > x:
      break
    l.append(bq)
print(max(l))

Submission status: Runtime Error

Solution code:
x=int(input())
c=1

for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
      else:break

print(c)

Submission status: Runtime Error

Solution code:
def solve():
    x = int(input())
    l = [i**j for i in range(1,x+1) for j in range(2,x+1) if i**j<=x]
    return max(l)
        
if __name__ == '__main__':
    print(solve())

Submission status: Runtime Error

Solution code:
import math
X = int(input())
n = math.ceil(X**0.5)
lst = []
for i in range(2, n):
  a = 2
  while i**a <= X:
    lst.append(i**a)
    a += 1
lst.sort()
print(lst[-1])

Submission status: Runtime Error

Solution code:
x = int(input())
li,p,ans = [],1,0

for b in range(2,int(x**0.5//1)+1):
    while b**p<=x:
        ans = max(ans,b**p)
        p += 1
        li.append(b**(p-1))
        if b**p>x:
            p = 1
            break
        
print(max(li))

Submission status: Runtime Error

Solution code:
from sys import exit
n = int(input())
powlist = set()
k = 2
chance = True
while chance:
    for i in range(1, n):
        key = i**k
        if key <= n:
            powlist.add(key)
        else:
            k += 1
            judge = i
            break
    if judge == 2:
        chance = False
print(max(powlist))

Submission status: Runtime Error

Solution code:
x = int(input())
if x < 4:
  print(1)
  exit()
import math
for i in range(2,x):
  if math.floor(math.log(x,i))>1:
    result = max(result, i ** math.floor(math.log(x,i)))
print(result)

Submission status: Runtime Error

Solution code:
x = int(input())
c = 1
for b in range(2,x):
  for p in range(2,x):
    if b**p <= x:
      c = max(c,b**P)
    else:
      break
print(c)

Submission status: Runtime Error

Solution code:
from math import sqrt
x=int(input())
c=1
for b in range(1,int(sqrt(x))+1):
  for p in range(2,x):
    if b**p<=x:
      c=mac(b**p,c)
    else:
      break
print(c)

Submission status: Runtime Error

Solution code:
X = int(input())
c=1
for b in range(1,X):
    for p in range(2,X):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)

Submission status: Runtime Error

Solution code:
x=int(input())
p=x**0.5
ans=[]
for i in range(1,p+1):
  j=2
  while True:
    if i**j<=x:
      ans.append(i**j)
    else:
      break
    j+=1
print(max(ans))

Submission status: Runtime Error

Solution code:
x=int(input())
p=x**0.5
ans=[]
for i in range(1,p+1):
  j=2
  while True:
    if i**j<=p:
      ans.append(i**j)
    else:
      break
    j+=1
print(max(ans))

Submission status: Runtime Error

Solution code:
x=int(input())
ans=0
for i in range(2,11):
  for j in range(x):
    if x-j**i>0 and j**i>ans:
      tmp=j**i
    else:
      break
  ans=[tmp,ans][tmp<ans]
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
c=1
for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
      else:break
print(c)

Submission status: Runtime Error

Solution code:
X = int(input())
List =[]
for i in range(33):
    if i >= X:
        break
    for j in range(2,11):
        if i**j < X :
            pass
        elif i**j == X:
            List.append(i**j)
            break
        else:
            List.append(i**(j-1))
            break
print(max(List))

Submission status: Runtime Error

Solution code:
x=int(input())
li=[]
for i in range(1,1001):
    for j in range(2,11):
        if i**j<=1000:
            li.append(i**j)
li=set(li)
li=sorted(list(li))

i=0
while li[i] <=x:
    i+=1
print(li[i-1])

Submission status: Runtime Error

Solution code:
N = int(input())
ans=1
for i in range(1:32):
    for j in range(1:10):
        if i**j <= N:
            ans = max(ans,i**j)
        else:
            break
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(1:32):
    for j in range(1:10):
        if i**j <= N:
            ans = max(ans,i**j)
print(ans)

Submission status: Runtime Error

Solution code:
c = 1
import math
a = int(input())
for i in range(1, int(math.sqrt(a))):
  for j in range(2, int(a/2):
    if i ** j <= a:
      c = max(c, i**j)
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=1
for i in range(32):
  j=i
  while(j<x):
    j*=i
  ans=max(ans,j//i)
print(ans)

Submission status: Runtime Error

Solution code:
prin(int(int(input()) ** 0.5))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

asset = []

for b in range(1,100):
    for p in range(2,100):
        tmp = pow(b, p)
        if tmp < 1001:
            if tmp not in asset:
                asset.append(tmp)

#print(asset)

x = int(input())

new_asset = []
for i in range(len(asset)):
    if asset[i] < x:
        new_asset.append(asset[i])

print(max(new_asset))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

asset = []

for b in range(1,1000):
    for p in range(2,100):
        tmp = pow(b, p)
        if tmp < 1001:
            if tmp not in asset:
                asset.append(tmp)

#print(asset)

x = int(input())

new_asset = []
for i in range(len(asset)):
    if asset[i] < x:
        new_asset.append(asset[i])

print(max(new_asset))

Submission status: Runtime Error

Solution code:
x = int(input())
ans = 0
lis = []
for i in range(1, x + 1):
    for j in range(2, x+1):
        ans = i ** j
        if ans <= x:
            lis.append(ans)
print(lis[-1])

Submission status: Runtime Error

Solution code:
x = int(input())
set_x = set(n**e for n in range(32) for e in range(2, 11) if n**e <= X)
ans = max(set_x)
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
c=1
for i in range(1,x):
  for j in range(2,x):
    if b**j<=x:
      c=max(c,b**j)
    else:
      break
print(c)

Submission status: Runtime Error

Solution code:
x = int(input())
li = list(range(2,x+1))
ans = [1]
n = 2
while li[0]**n < x:
    for i in range(x-1):
        if li[i]**n > x:
            ans.append(li[i-1]**n)
            break
    n += 1
print(max(ans))

Submission status: Runtime Error

Solution code:
ans_list = []
for i in range(2, 10):
    ans_list.append(2 ** i)
for i in range(2, 7):
    ans_list.append(3 ** i)
for i in range(2, 5):
    ans_list.append(5 ** i)
for i in range(2, 4):
    ans_list.append(7 ** i)
num = [11, 13, 17, 19, 23, 29, 31]
for i in num:
    ans_list.append(i ** 2)
X = int(input())
for i in range(X, 0, -1):
    if i in ans_list:
        ans = i
        break
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
num = 2
idx = 2
nums = []
while True:
  if num**idx > N:
    if idx == 2:
      break
    else:
      num += 1
      idx = 2
      continue
  else:
    nums.append(num**idx)
    idx += 1
nums.sort(key=lambda x:-x)
print(nums[0])

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#A
def A():
    a, b, c, d = LI()
    x = abs(a - b)
    y = abs(b - c)
    z = abs(a - c)
    if (x <= d and y <= d) or z <= d:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    X = II()
    x = [False] * (10 ** 3 + 1)
    x[1] = True
    for i in range(2, int(10 ** 1.5) + 1):
        x[i] = True
        for k in raneg(2,10 ** 3 // i + 1):
            x[i*k] = True
    for i in range(x, -1, -1):
        if x[i]:
            print(i)
            return
    return

#C
def C():
    s = stdin.readline().rstrip()
    K = II() - 1
    ans = []
    for i in range(len(s)):
        for k in range(K+1):
            b = s[i:i + k + 1]
            ans.append(b)
    ans = list(set(ans))
    ans.sort()
    print(ans[K])
    return

#D
def D():
    n, m = LI()
    p = LI_()
    xy = LIR_(m)
    size = [1 for _ in range(n)]
    height = [1 for _ in range(n)]
    par = [i for i in range(n)]
    def find(x):
        if par[x] == x:
            return x
        else:
            par[x] = find(par[x])
            return par[x]
    def union(x, y):
        s1 = find(x)
        s2 = find(y)
        if s1 != s2:
            if height[s1] < height[s2]:
                par[s1] = s2
                size[s2] += size[s1]
                size[s1] = 0
            else:
                par[s2] = s1
                size[s1] += size[s2]
                size[s2] = 0
                if height[s1] == height[s2]:
                    height[s1] += 1

    for x,y in xy:
        union(x, y)
    ans = 0
    for i in range(n):
        if find(p[i]) == find(i):
            ans += 1
    
    print(ans)
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Runtime Error

Solution code:
x = int(input())
a = set()

for i in range(2,32):
    for j in range(10):
        if i ** j >= x:
            break
        a.add(i ** j)
print(max(a))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

def prime_factor(n):
    ass = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            ass.append(i)
            n = n // i
    if n != 1:
        ass.append(n)
    return ass

X = int(input())
i = X

while True:
    if len(prime_factor(i)) >= 2 and len(set(prime_factor(i))) == 1: 
        print(i)
        exit()
    else:
        i -= 1

Submission status: Runtime Error

Solution code:
X = int(input())
ans = [1]


if X == 1 or X == 2:
    print(1)
else:
	for i in range(2, X + 1):
    	num = i
    	count = 1
    	while num ** i <= X:
            count += 1
            ans.append(num ** i)
            
    print(max(ans))

Submission status: Runtime Error

Solution code:
X = int(input())
ans = [1]


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** i <= X:
            count += 1
            ans.append(num ** i)
	print(max(ans))

Submission status: Runtime Error

Solution code:
X = int(input())
ans = set(1)


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** i <= X:
            count += 1
            ans.add(num ** i)
print(max(ans))

Submission status: Runtime Error

Solution code:
import math

X = int(input())
for i in range(X,-1,0):
  sqrt_x = math.sqrt(i)
  if sqrt_x.is_integer():
    print(i)
    return

Submission status: Runtime Error

Solution code:
x=int(input())
beki=[]
for b in range(1,x+1):
  for p in range(2,x+1):
    if b**p<=x:
      beki.append(b**p)
    else:
      break
print(max(beki))

Submission status: Runtime Error

Solution code:
import math

x=int(input())

if x<4:
	print(x)
else:
	result=2
	for i in range(2,x):
		for j in range(2,x):
			if i**j<=x:
				result=max(result,i**j)
			else:
				break;
print(result)

Submission status: Runtime Error

Solution code:
x = int(input())
if x = 1:
  print(1)
else:
  ans = 2
  for i in range(2, x):
    for j in range(2, x):
      if i ** j <= x:
        ans = max(ans, i ** j)
  print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())

while math.sqrt(a) % 1 != 0:
  a -= 1
  
print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
if n<=3:
  print(1)
else:
  ans=4
  for i in range(2,int(n**(1/2)+1)):
    e=2
    while i**e<=n:
      if i**e>ans:
        ans=i**e
print(ans)

Submission status: Runtime Error

Solution code:
X=int(input())
l=[2,3,5,7,11,13,17,19,23,29,31,37]
ans=[]
for i in l:
    tmp=i**2
    while tmp<=X:
        ans.append(tmp)
        tmp*=i

print(max(ans))

Submission status: Runtime Error

Solution code:
x = int(input())
if x == 1:
    print(1)
else:
    n = 1
    for i in range(1,32):
        for j in range(2,10):
            m = i**j
            if m <= x and m > n:
                n = m
print(n)

Submission status: Runtime Error

Solution code:
X=int(input())
ans=1
for i in range(2,33):
    j=2
    while(i**J<=X):
        if i**j>ans:
            ans=i**j
        j+=1

print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
print(max([i**ii for i in range(2,34) for ii in range(2,11) if i**ii <= x]))

Submission status: Runtime Error

Solution code:
X = int(input())
b = []

for i in range(2, 32):
    p = 2
    while i ** p <= X:
        b.append(i ** p)
        p += 1

print(max(b))

Submission status: Runtime Error

Solution code:

X = int(input())
b = []

for i in range(2, 32):
    p = 2
    while i ** p <= X:
        b.append(i ** p)
        p += 1

print(max(b))

Submission status: Runtime Error

Solution code:
x = int(input())
print(max([int(x**(1/i))**i for i in range(10)]))

Submission status: Runtime Error

Solution code:
x = int(input())
print(max([int(x**(1/i))**i for i in range(100)]))

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 1
for i in range(1,1001):
    for j in range(2,1001):
        if i**j > n:
            break
        if ans < i**j =< n:
            ans = i**j
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for b in range(33):
  for p in range(2,10):
    if b**p > x:
      break
    ans = max(ans, b**p)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for b in range(1001):
  for p in range(2,10):
    if b**p > x:
      break
    ans = max(ans, b**p)
print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())
ans=[]

for p in range(2,x+1):
    b=2
    while p**b<=x:
        ans.append(p**b)
        b+=1
print(max(ans))

Submission status: Runtime Error

Solution code:
import numpy as np
import math
import time

t1 = time.time()

x = int(input())

answer = 1

if(x!=1):
    for i in range(2, x):
        for j in range(2, x):
            if(j**i>x):
                answer = (j-1)**i
                break
        else:
            continue
        break

print(f"最大の冪乗数:{answer}")

t2=time.time()
elapsed_time=t2-t1
print(f"所用時間:{elapsed_time}")

Submission status: Runtime Error

Solution code:
import numpy as np
import math

x = int(input())

answer = 1

if(x!=1):
    for i in range(2, x):
        for j in range(2, x):
            if(j**i>x):
                answer = (j-1)**i
                break
        else:
            continue
        break

print(f"最大の冪乗数:{answer}")

Submission status: Runtime Error

Solution code:
import sys
import math

def isExponential(i : int) -> bool:
    for j in range(math.sqrt(i)):
        devidend = i
        devisor = j
        while 1:
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return 1
                else:
                    devidend //= devisor
    return 0
x = int(input())
for i in range(x,0,-1):
    if isExponential(i):
        print(i)
        break

Submission status: Runtime Error

Solution code:
n = int(input())
c = 1
for i in range(1, n):
    for j in range(2, n):
        if i**j<=x:
            c=max(c, i**j)
print(c)

Submission status: Runtime Error

Solution code:
X = int(input())
x = int(X**0.5)
num = []
for b in range(2,x+1) :
    p = 2
    while b**p <= X :
        p += 1
    num.append(b**(p-1))
print(max(num))

Submission status: Runtime Error

Solution code:
# ABC097B - Exponential
x = int(input())
lst = []

for i in range(1, 32):
    for j in range(1, 10):
        if i ** j == x:
            print(x)
            exit()
        elif i ** j < x and i ** j not in lst:
            lst.append(i ** j)
        elif i ** j > x:
            break
            
lst.append(x)
lst = sorted(lst)

print(lst[lst.index(1000) - 1])

Submission status: Runtime Error

Solution code:
X = int(input())

bekijosu=[]

for i in range(2, 1001):
    for j in range(2,10):
        if i ** j <= 1000:
            bekijosu.append(i ** j)

print(max([n for n in bekijosu if n <= X]))

Submission status: Runtime Error

Solution code:
N = int(input())
list=[]
for i in range(1, N+1):
    for j in range(2, N):
        tmp = i ** j
        if tmp <= N:
            list.append(tmp)
        else:
            break

print(max(list))

Submission status: Runtime Error

Solution code:
from sympy import factorint

ans=1
for i in range(int(input()), 1, -1):
	f=factorint(i)
	if len(f) == 1 and sum(f.values()) > 1:
		ans=i
		break

print(ans)

Submission status: Runtime Error

Solution code:
X = int(input())
lists = []
max = 1
for i in range(1,X+1):
    for j in range(2,X+1):
        if i**j <= X:
           lists.append(i**j)
lists.sort()
print(lists[-1])

Submission status: Runtime Error

Solution code:
x = int(input())
def isExp(num):
	if num ==1 : return True
	for i in range(2,11):
		pow(num, 1/i) % 1.0 == 0.0: return True
	return False
def solve():
	for i in range(x,0,-1):
		if isExp(i): return i

print(solve())

Submission status: Runtime Error

Solution code:
import math
X = int(input())
answer = 0

for i in range(2,math.floor(X)):
  for j in range(2,11):
    if i**J <= X:
      answer = max(answer,i**j)
      
print(answer)

Submission status: Runtime Error

Solution code:
x = int(input())

def isPrime(n):
  if n%2==0 or n%3==0: return True
  for i in range(2, int(n**0.5)+1):
    if n%i==0: return False
  return True
primes = [i for i in range(2,1000) if isPrime(i)]

def isExponentiation(n):
  i = 0
  flag = False
  while(primes[i]<n):
    if n%primes[i]==0:
      if flag: return False
      else: flag = True
    i+=1
  return flag

print( max([i for i in range(x) if isExponentiation(i)]) )

Submission status: Runtime Error

Solution code:
x = int(input())
t = []
for b in range(2, x+1):
    c = b * b
    for p in range(2, x):
        while (c < x):
            t.append(c)
            c = c * b
print(max(t))

Submission status: Runtime Error

Solution code:
x=int(input())
if x==1:
    print(1)
    a=True
for i in range(33):
    if a:
        break
    if i**2<x:
        pass
    else:
        print((i-1)**2)
        break

Submission status: Runtime Error

Solution code:
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
        else:
            break
print(max(exps))

Submission status: Runtime Error

Solution code:
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
print(max(exps))

Submission status: Runtime Error

Solution code:
from sys import stdin
X = int(stdin.readline().rstrip())
exps=[]
for i in range(1,X+1):
    for j in range(2,X+1):
        if 1 <= i**j <= X:
            exps.append(i**j)
print(max(exps))