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())
l=[]
for i in range(2,x+1):
  t=i*i
  while t <=x:
    l.append(t)
    t*=i
print(max(l))

Submission status: Runtime Error

Solution code:
n=int(input())
m = int(pow(n,1/2)) + 1
k = 0
for i in range(m):
  fi n > pow(i,2):
    break
  else:
    k = pow(i,2)
print(k)

Submission status: Runtime Error

Solution code:
x=int(input())
l=[]
for b in range (2,32):
    for i in range (1,10):
        if b**i <=x:
            l.append (b**i)
print(max(l))

Submission status: Runtime Error

Solution code:
x=int(input())
l=[]
for b in range (2,32):
    for i in range (1,10):
        if b**i <=x:
            l.apprnd b**i
print(max(l))

Submission status: Runtime Error

Solution code:
x=int(input())
l=[]
for b in range (2,32):
    for i in range (1,10):
        if b**i <=x:
            l.apprnd b**j
print(max(l))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X=int(input())
i=2
L=[]
import math
while math.floor(X**(1/i))!=1:
    L.append(math.floor(X**(1/i))**i)
    i+=1
print(max(L))

Submission status: Runtime Error

Solution code:
X=int(input())
i=2
L=[]
import math
while math.floor(X**(1/i))!=1:
    L.append(math.floor(X**(1/i))**2)
    i+=1
print(max(L))

Submission status: Runtime Error

Solution code:
import sys

def main():
  input = sys.stdin.readline
  X = int(input())
  while X > 0:
    index = []
    for i in range(2, X):
      c = 0
      x = X
      while x % i == 0 and x > 1:
        c += 1
        x //= i
      if c != 0:
        index.append(c)
    if len(index) == 0:
      X -= 1
    elif len(set(index)) == 1 and index[0] != 1:
      ans = X
      break
    elif all([i % 2 == 0 for i in index]):
      ans = X
      break
    else:
      X -= 1
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
x=int(input())
l=[]
for s in range(1,x):
  for t in range(2,x):
    if s**t<x:
      l.append(s**t)
    if s**t>x:
      break
print(max(l))

Submission status: Runtime Error

Solution code:
x=int(input())
l=[]
for s in range(x):
  for t in range(2,x):
    if s**t<=x:
      l.append(s**t)
print(max(l))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
for i in range(i,n+1):
    if i**2 > n:
        print((i-1)**2)
        exit()
    elif i**2 == n:
        print(i**2)
        exit()

Submission status: Runtime Error

Solution code:
x = int(input())
ans = []
for i in range(2, x):
    for l in range(2, x):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break

print(int(ans[len(ans)-1]))

Submission status: Runtime Error

Solution code:
x = int(input())
ans = []
for i in range(2, x):
    for l in range(2, x):
        if i ** l <= x:
            ans.append(i ** l)
        if i ** l > x:
            break

print(ans[len(ans)-1])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
from math import sqrt,floor
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    X = int(lines.pop(0))
    s = floor(sqrt(X))
    res = 1
    for c in range(s, 1, -1):
        print(c)
        while( c**n <= X ):
            res = max(res, c**n)
            n += 1

    print(res)
#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())

    # for i in range(1, n + 1):
    #     if

    # i = 1
    # while i * i <= n:
    #     i += 1
    #
    # print((i - 1) ** 2)

    ans = [1]
    for i in range(2, n + 1):
        j = 2
        while i ** j <= n:
            ans.append(i ** j)
            j += 1

    print(max[ans])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x = int(input())
for b in range(x):
	for p in range(x):
		if b >0 and p >=2:
			if b**p > x:
				break
			ans = b ** p
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
for b in range(x):
	for p in range(x):
		if b >0 and p >=2:
			if b**p > x:
				break
			ans = b ** p
print(ans

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
L=set()
for i in range(5):
    for j in range(len(S)-i):
        L.add((S[j:j+i+1]))
L = sorted(list(L))
print(L[K-1])

Submission status: Runtime Error

Solution code:
def function(X):
  	B = list(range(31, 0, -1))
    res = 0
    for b in B:
        p = 2
        cp = p
        while True:
            tmp = b ** p
            if tmp > X:
                break
            else:
                res = max(res,tmp)
                if b == 1: break
                cp = p
                p += 1
    return res

X = int(input())
print(function(X))

Submission status: Runtime Error

Solution code:
X = int(input())

p = 2
res = 0
for b in B:
    p = 2
    cp = p
    while True:
        tmp = b ** p
        if tmp > X:
            break
        else:
            res = max(res,tmp)
            if b == 1: break
            cp = p
            p += 1

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(1,33):
    if i*i>n:
    print((i-1)*(i-1))
    break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X =int(input())
list = []
for k in range(X):
    for j in range(X):
        if k**2 > X:
            break
        elif k**j > X:
            list.append(k**(j-1))
            break
            
print(max(list))

Submission status: Runtime Error

Solution code:
# -*- coding; utd-8 -*-
X = int(input())
import math
a = [math.pow(i,j) for j in range(2,10) for i in range(1,32) if math.pow(i,j)<X]
print(int(max(a)))

Submission status: Runtime Error

Solution code:
# -*- coding; utd-8 -*-
X = int(input())
import math
a = []
for i in range(1,32):
  a = [math.pow(i,j) for j in range(2,10) if math.pow(i,j)<X]
print(max(a))

Submission status: Runtime Error

Solution code:
# -*- coding utf-8 -*-
X = int(input())
a = []
for i in range(11):
  a.append(j ** i for j in range(j ** i < 1000) if X > j**i)
b = []
for i in range(11;32):
  b.append(i ** 2 if X > i ** 2)
L = a+b
print(sum(L))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
a =[]
c = 1
n = 2
while c <= 33:
	n = 2
    c += 1
    while c**n<=1000:
        a.append(c*n)
        n +=1
a.sort()
for i in range(len(a)):
    if a[i] > x:
        a[i] = -1000
    else:
        a[i] -= x
print(a[a.index(max(a))])

Submission status: Runtime Error

Solution code:
a = int(input())

i = 2
max_num = 1
flag_outer = True
while i < a:      
    j = 2
  	temp = 0

  	while i**j < a:
    	temp = i**j
    	j+=1

    if temp > max_num and temp < a:
    	max_num = temp
      	i+=1
print(max_num)

Submission status: Runtime Error

Solution code:
X = int(input())
if X == 1:
    print(1)
else:
    ans = 1
    for i in range(2, X+1):
        for k in range(2, 10):
            now = i ** k
            if now <= X:
                ans = max(ans, now)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
c=[0]*10
for i in range(1:10):
    c[i]=(int(n**(1/i)))**i
    if c[i]>n:
        c[i]=0
print(max(c))

Submission status: Runtime Error

Solution code:
n=int(input())
c=[0]*10
for i in range(1:10):
    c[i]=(int(n**(1/i)))**i
    if c[i]>0:
        c[i]=0
print(max(c))

Submission status: Runtime Error

Solution code:
import  math
print (int (math.sqrt (int (input ()))**2)

Submission status: Runtime Error

Solution code:
import math 

x = int(input())
a = []
if x == 1:
  print(1)
else:
  for i in range(1,x):
    for j in range(2,32):
      if math.log(i,j).is_integer() == True:
        a.append(i)
print(max(a))

Submission status: Runtime Error

Solution code:
import math 

x = int(input())
a = []
if x == 1:
  print(1)
for i in range(1,x):
  for j in range(2,32):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))

Submission status: Runtime Error

Solution code:
import math 

x = int(input())
a = []
for i in range(1,x):
  for j in range(2,32):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))

Submission status: Runtime Error

Solution code:
import math

x = int(input())
a = []
for i in range(1,x):
  for j in range(2,10):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import os
f = open("input.txt", "r")
sys.stdin = f

x = int(input())
p = 2
list_prob = []
ind = 0
i = 1
while p < 11:
    ind = i ** p
    while ind < 1001:
        list_prob.append(int(i ** p))
        i += 1
        ind = i ** p
    i = 1
    p += 1
list_prob.append(1001)
list_prob.sort()
while i < len(list_prob):
    if list_prob[i] <= x and list_prob[i+1] > x:
        print(list_prob[i])
        break
    i += 1

Submission status: Runtime Error

Solution code:
x = int(input())
p = 2
list_prob = []
ind = 0
i = 1
while p < 11:
    ind = i ** p
    while ind < 1001:
        list_prob.append(int(i ** p))
        i += 1
        ind = i ** p
    i = 1
    p += 1
list_prob.sort()
while i < len(list_prob):
    if list_prob[i] <= x and list_prob[i+1] > x:
        print(list_prob[i])
        break
    i += 1

Submission status: Runtime Error

Solution code:
arr = [0 for _ in range(1001)]
arr[1] = 1
for i in range(2,32):
    if arr[i]==1:
        continue
    tmp=i
    while i <=1000:
        arr[tmp]=1
        tmp*=i

for x in range(int(input()),0,-1):
    if arr[x]==1:
        print(x)
        break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X = int(input())

for i in range(X):
    B=i*i
    if i*i < X:
        print(max(B))

Submission status: Runtime Error

Solution code:
#97b
x = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
array.sort(reverse=True)
print(array[0])

Submission status: Runtime Error

Solution code:
n = int(input())
array = []
for i in range(2,33):
  for j in range(10):
    a = i**j
    if a <= n:
      array.append(a)
array.sort(reversed=True)
print(array[0])

Submission status: Runtime Error

Solution code:

n = int(input())
array = []
for i in range(2,33):
  if j in range(10):
    a = i**j
    if a <= n:
      array.append(a)
array.sort(reversed=True)
print(array[0])

Submission status: Runtime Error

Solution code:
X = int(input())
L = []
ANS = []
for i in range(1,33) :
    for j in range(2,11) :
        if i**j <= 1000 :
            l = i**j
            L.append(l)
L = list(set(L))
L = sorted(L)
for j in range(len(L)) :
    if L[j] <= X < L[j+1] :
        ans = L[j]
        ANS.append(ans)
print(max(ANS))

Submission status: Runtime Error

Solution code:
X = int(input())
s=0
for i in range(33)
    if X >= i**2
        s = i**2
print(s)

Submission status: Runtime Error

Solution code:
X = int(input())

import math
def is_beki(n):
  for i in range(2, int(math.sqrt(n)//1)+1):
    beki = i
    while beki <= n:
      if beki == n:
        return True
      beki = beki * i
  return False

for i in range(X, 1, -1):
  if is_beki(i):
    break
print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 1000

if n == 1:
    print(n)
else:
    for b in range(2, 33):
        for p in range(2, 11):
            if n-b**p > 0:
                result = min(ans, b**p)

print(result)

Submission status: Runtime Error

Solution code:
X = int(input())
 
ans = 1
p = 2
A = set()
for i in range(2,X):
  if(i in A):
    continue
  p = 1
  while(True):
    p += 1
    power = i ** p
    if(power <= X):
      A.add(power)
      tmp = power
      pass
    else:
      break
  if(ans<tmp):
    ans = tmp
  if(p == 2):
    break
  
print(ans)
X = int(input())
 
ans = 0
p = 2
A = set()
for i in range(X):
  if(i in A):
    continue
  p = 1
  while(True):
    p += 1
    power = i ** p
    if(power <= X):
      A.add(power)
      tmp = power
      pass
    else:
      break
  if(ans<tmp):
    ans = tmp
  if(p == 2):
    break
  
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X/2):
  for j in range(2,X/2):
    beki = i ** j
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Submission status: Runtime Error

Solution code:
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X/2):
  for j in range(2,X/2):
    beki = i %% j
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Submission status: Runtime Error

Solution code:
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = i %% j
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Submission status: Runtime Error

Solution code:
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = b %% p
    
    if beki > max_beki:
      if beki <= X:
        max_beki = beki
      
print(max_beki)

Submission status: Runtime Error

Solution code:
#標準入力
X = int(input())

max_beki = 1
for i in range(1,X):
  for j in range(2,X):
    beki = b %% p
    
    if beki > max_beki:
      max_beki = beki
      
print(max_beki)

Submission status: Runtime Error

Solution code:
print(max([max(i**j for j in range(10) if i**j<=x) for i in range(x)] for x in range(int(input())**0.5+1)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())
def beki(n):
    for i in range(2,10000):
        if n%i==0:
            t=
            while n>=1:
                n/=i
                if n==1 and t>=1:
                    return True
                if n<1:
                    return False
                t+=1
y=1
for i in range (1,x+1):
    if beki(i)==True:
        y=i
print(y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
def get_pnum_list(n):
    N = [i for i in range(2,n+1)]
    marked = [False] * (n+1)
    pnum_list = []
    for i in range(2, n+1):
        if marked[i] is False:
            pnum_list.append(i)
            j = i
            while j <= n:
                marked[j] = True
                j += i
    return pnum_list

x = int(input())
pnum_list = get_pnum_list(int(math.sqrt(x)))
ans_list = []
for p in pnum_list:
    y = 1
    while x % p == 0:
        x = x // p
        y = y * p
    ans_list.append(y)
print(max(ans_list))

Submission status: Runtime Error

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

for i in range(2, x):
    sum = i
    while sum * i <= x:
        sum = sum * i
        result.append(sum)

print(sorted(result)[-1])

Submission status: Runtime Error

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

for i in range(2, x):
    sum = i
    while sum * i <= 1000:
        sum = sum * i
        result.append(sum)

print(sorted(result)[-1])

Submission status: Runtime Error

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

def solve(X):
	# b^p = xとなるxを探す
	for x in range(X, 1, -1)
    	for b in range(2, x):
    		p = math.log(x, b)
    		if float.is_integer(p):
    			return x
    	return 1

if __name__ == "__main__":
	X = int(input())
	print(solve(X))

Submission status: Runtime Error

Solution code:
x = int(input())
a = []
for i in range(2,34):
	n = i**2
	while n <= x:
		a.append(n)
		n = n*i

print(max(a))

Submission status: Runtime Error

Solution code:
import numpy as np
import time
from itertools import takewhile

t1 = time.time()

N = int(input())
n = int(np.ceil(np.sqrt(N)))

for k in range(n):
    k += 1
    if k == 1:
        max_num = 1
    else:
        temp = max(takewhile(lambda x : x < N, (k**i for i in count())))
        max_num = max(max_num,temp)
print(max_num)
t2 = time.time()
print(t2-t1)

Submission status: Runtime Error

Solution code:
import math
import numpy as np
from itertools import takewhile

N = int(input())
n = math.ceil(math.sqrt(N))

for k in range(n):
    k += 1
    if k == 1:
        max_num = 1
    else:
        temp = max(takewhile(lambda x : x < N, (k**i for i in count())))
        max_num = max(max_num,temp)
print(max_num)

Submission status: Runtime Error

Solution code:
a = int(input())
l = []

for i in range(2a):
  l.append(i**2)

for i in range(a):
    if a == 1:
        print(a)
    elif a == l[i]:
        print(l[i])
        break
    elif a-l[i] < 0:
        print(l[i-1])
        break

Submission status: Runtime Error

Solution code:
X = int(input())
l = []
vall= []
for l1 in range(1,X+1):
  for l2 in range(2,X+1):
    l.append(l1 ** l2)
for val in l:
  if(val<=X):
    vall.append(val)
print(max(vall))

Submission status: Runtime Error

Solution code:
X = int(input())

beki = []

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

new_beki=[e for e in beki if e <= X]
print(max(new_beki))

Submission status: Runtime Error

Solution code:
import sys
y = sys.stdin.readline()

xx = y.rstrip()

num = 1
n1 = 0
for x in range(xx):
    for y in range(xx-1):
            n1 = (x+1)**(y+2)
            if n1 >= num:
                if n1 <= xx:
                    num = n1
print(num)

Submission status: Runtime Error

Solution code:
import sys
y = sys.stdin.readline()
 
xx = y.rstrip()
 
for x in range(10):
    for i in range(10):
         z = x**i
        if z > int(xx):
            print((x-1)**(i-1))

Submission status: Runtime Error

Solution code:
import sys
y = sys.stdin.readline()
 
xx = y.rstrip()
 
i = 0
x = 0
for x in range(10):
    for i in range(10):
         z = x**i
        if z > int(xx):
            print((x-1)**(i-1))

Submission status: Runtime Error

Solution code:
import sys
y = sys.stdin.readline()
 
xx = y.rstrip()
 
i = 0
x = 0
for x in range(10):
    for i in range(10):
        if z > int(xx):
            z = x**i
print(z)

Submission status: Runtime Error

Solution code:
import sys
2.y = sys.stdin.readline()
3. 
4.xx = y.rstrip()
5. 
6.i = 0
7.x = 0
8.while True:
9.    if x > int(xx):
10.        break
11.    i += 1
12.    x = i**i
13.print((i-1)**(i-1))

Submission status: Runtime Error

Solution code:
True:
	i+=1
	if(i*i>=x):
		print((i-1)**2)
		break

Submission status: Runtime Error

Solution code:
x = int(input())
ret = 0
for b in range(1,int(sqrt(x))+2):
    for p in range(2,10):
        if b**p <= x and ret < b**p: ret = b**p
print(ret)

Submission status: Runtime Error

Solution code:
X = int(input())
for i in range(X):
  for n in range(2:10):
    x = i**n
    if x < X:
      m = x
print(m)

Submission status: Runtime Error

Solution code:
X = int(input())
a = X // 2
for i in range(a):
  for n in range(10):
    x = i**n
    if x < X:
      m = x
print(m)

Submission status: Runtime Error

Solution code:
num = 31
lst = []
i = 2
while i <= 10:
    while flag:
        if num**i <= X:
            z = num**i
            lst.append(z)
            break
        else:
            num -= 1
    num= 31
    i += 1
print(max(lst))

Submission status: Runtime Error

Solution code:
import math

# input
X = int(input())

ans = 1

for b in range(2, math.sqrt(X)):
    p = 1
    while b ** p <= X:
        if b ** p > ans:
            ans = b ** p
        p += 1

Submission status: Runtime Error

Solution code:
a=int(input())
if(a<4):print(1)
else:
  ma=1
  for i in range(1,int(sqrt(a))):
    for j in range(2,1000):
      x=i**j
      if(x>a):break
      ma=max(ma,x)
  print(ma)

Submission status: Runtime Error

Solution code:
from math import log
x = int(input())
lx = log(x)
ans = 1
for b in range(2, int(b**(1/2))+1):
    h = int(lx/log(b))
    if b**h > ans: ans = b**h
 
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
	else:
      break
      
print(ans)

Submission status: Runtime Error

Solution code:
from math import log
x = int(input())
lx = log(x)
ans = 1
for b in range(2, int(b**(1/2))+1):
    h = int(lx/log(b))
    if b**h > ans: ans = b**h

print(ans)

Submission status: Runtime Error

Solution code:
X = int(input())

a = 1
b = 2
c = 0
if X = 1:
    print(X)

else:
    while b < 10:
        while a < 32:
            d = a**b
            if d > c and d < X:
                c = d
            a += 1
        b +=1
    
    print(c)

Submission status: Runtime Error

Solution code:
x = int(input())
s = set([])
primes = [2,3,5,7,11,13,17,19,23,29,31]
for b in primes:
    for p in range(2,10):
        if b**p <= x:
            s.add(b**p)
        else:
            break
print(sorted(list(s))[-1])

Submission status: Runtime Error

Solution code:
X = int(input())

a = 1
b = 2
c = 0

while b < 10:
    while a < 32:
        d = a**b
        if d => c and d <= X:
            c = d
        a += 1
    b +=1 

print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
arr = []
for i in range(2,32):
    multi = 2
    while i**multi <= x:
        arr.append(i**multi)
        multi += 1
print(max(arr))

Submission status: Runtime Error

Solution code:
a=int(input())
int res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res<i**j and i**j<=a:
        res=i**j
print(res)

Submission status: Runtime Error

Solution code:
int a=input()
res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res<i**j and i**j<=a:
      res=i**j
print(res)

Submission status: Runtime Error

Solution code:
int a=input()
res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res>i**j and i**j<=a;
      res=i**j
print(res)

Submission status: Runtime Error

Solution code:
import math
X = int(input())
max = 0
bRange = math.floor(math.sqrt(X))
pRange = math.floor(math.log(X,2))
for b in range(bRange + 1):
    for p in range(pRange + 1):
            if(max < b**p <= X):
            max = b**p
print(max)

Submission status: Runtime Error

Solution code:
X = int(input())
max_num = 1
root = math.floor(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = math.floor(math.log(X, b))
        if b**p > max_num:
            max_num = b**p
else:
    print(1)

if root >= 2:
    print(max_num)

Submission status: Runtime Error

Solution code:
import math
X = int(input())
max_num = 1
root = math.floor(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = math.floor(math.log(X, b))
        if b**p > max_num:
            max_num = b**p
else:
    print(1)

if root >= 2:
    print(max(file))

Submission status: Runtime Error

Solution code:
import math
X = int(input())
file = []
root = int(math.sqrt(X))
for b in range(2, root+1):
    p = int(math.log(X, b))
    file.append(b**p)

print(max(file))

Submission status: Runtime Error

Solution code:
X = int(input())
print(max([1] + [pow(b, int(log(X, b))) for b in range(2, int(sqrt(X))+1)]))

Submission status: Runtime Error

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

answer = []
for p in range(2, x):

    for i in range(2, x):
        test = i**p
        if test > 1000:
            break
        if test > x:
            answer.append((i-1)**p)
            break
        elif test == x:
            answer.append(i**p)
            break

print(max(answer))

Submission status: Runtime Error

Solution code:
if n == 1:
    print(1)

else:
    for i in range(2,11):
        for j in range(2,11):
            if i ** j <= n:
                Min = min(Min,n - i ** j)
    print(n - Min)

Submission status: Runtime Error

Solution code:
X= int(input())
b = 1
p = 2

while y < X:
    y = b**p
    b+=1
print(y)

Submission status: Runtime Error

Solution code:
X = int(input())
def f():
    for y in range(2, X.bit_length()):
        x = 0
        while (x+1)**y <= X:
            x += 1
        if x**y <= X:
            yield x**y
print(max(f()))

Submission status: Runtime Error

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

from math import sqrt
X=int(input())
sqrt_X=int(sqrt(X))
ans=1

for b in range(1,sqrt_X + 1):    ##最後は含まないので＋１する必要がある
    for p in range(2,sqrt_X): 　##pは2から始めまる
        now_num = b**p
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)

Submission status: Runtime Error

Solution code:
from math import sqrt

x = int(input())
sqrt_x = int(sqrt(x))
ans = 1

for b in range(sqrt_x):
    for p in range(sqrt_x-1):
        exp = (b+1)**(p+2)
    if exp<=x and ans<=exp:
        ans = exp
        
print(ans)

Submission status: Runtime Error

Solution code:
X=int(input())
L=[]
for i in range(2,32):
  k=2
  while(True):
    if (i**k<=X):
      L.append(i**k)
    else:
      break
    k+=1
print(max(L))

Submission status: Runtime Error

Solution code:
x = int(input())
L = [n**k for n in range(1, x) for k in range(2, 10) if n**k<=x]
print (max(L))

Submission status: Runtime Error

Solution code:
import math
x=int(input())
log_x=int(math.log(x,2))
cand=[0 for i in range(x)]
cand[0]=1
for i in range(2,log_x+1):
    cand[i]=int(pow(x,1.0/i))**i
cand[1000]=1000
print(max(cand[:x]))

Submission status: Runtime Error

Solution code:
import math
x=int(input())
log_x=int(math.log(x,2))
cand=[0 for i in range(x)]
cand[0]=1
for i in range(2,log_x+1):
    cand[i]=int(pow(x,1.0/i))**i
cand[1000]=1000
print(max(cand[:x+1]))

Submission status: Runtime Error

Solution code:
x = int(input())
L = [n**k for n in range(1, x) for k in range(1, x) if n**k<=x]
print (max(L))

Submission status: Runtime Error

Solution code:
x = int(input())

b = 1
p = 2
m = 0

def check(b, p, m):
    if b**p >= m  and b**p <= x:
        print(f"{b}**{p}={b**p}")
        return b**p
    else:
        return m

if x == 1:
    print(1)
else:
    for b in range(x):
        for p in range(x-1):
            m = check(b+1, p+2, m)
    print(m)

Submission status: Runtime Error

Solution code:
x = int(input())

b = 1
p = 2
m = 0

def check(b, p, m):
    if b**p >= m  and b**p <= x:
        print(f"{b}**{p}={b**p}")
        return b**p
    else:
        return m

if x = 1:
    print(1)
else:
    for b in range(x):
        for p in range(x-1):
            m = check(b+1, p+2, m)
    print(m)

Submission status: Runtime Error

Solution code:
import math

X =input()

if X == 1:
    output = 1
    print(output)
else:
    mylist = [1]
    biggest = int(math.sqrt(X))
    for i in range(2,biggest):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
        mylist[i] = bekijo
        #print(mylist[i])
    print(max(mylist))

Submission status: Runtime Error

Solution code:
x = int(input())
L = [n**k for n in range(1, x) for k in range(1, x//2) if n**k<=x]
print (max(L))

Submission status: Runtime Error

Solution code:
import math
X =input()
print(X)
if X == 1:
    output = 1
    print(output)
else:
    mylist = [1]
    biggest = int(math.sqrt(X))
    for i in range(2,biggest):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
            mylist[i] = bekijo
        #print(mylist[i])
    print(max(mylist))

Submission status: Runtime Error

Solution code:
from sympy import perfect_power

x = int(input())

ans = 1

for i in range(x, 1, -1):
    if perfect_power(i):
        ans = i
        break

print(ans)

Submission status: Runtime Error

Solution code:
ans = []
for p in range(2, 10):
    for b in range(1, 32):
        if b**p <= X:
            ans.append(b**p)
        else:
            break
print(max(ans))

Submission status: Runtime Error

Solution code:
x = int(input())
L = [n**k for n in range(1, x) for k in range(1, x)]
print (max(L))

Submission status: Runtime Error

Solution code:
import math
x = int(input())


lst = []
for i in range(31):
    for j in range(8):
        if math.pow(i+1,j+1) <= 1000:
            lst.append(math.pow(i+1,j+1))
        else:
            break
l=999
for i in range(len(lst)):
    if 0 < x-lst[i] < l :
        l = abs(x-lst[i])
        ans = lst[i]


print(math.floor(ans))

Submission status: Runtime Error

Solution code:
import math
x = int(input())


lst = []
for i in range(31):
    for j in range(8):
        if math.pow(i+1,j+1) <= 1000:
            lst.append(math.pow(i+1,j+1))
        else:
            break
print(lst)
l=999
for i in range(len(lst)):
    if 0 < x-lst[i] < l :
        l = abs(x-lst[i])
        ans = lst[i]


print(math.floor(ans))

Submission status: Runtime Error

Solution code:
import math
def main():
    x = int(input())
    l=np.arange(int(math.sqrt(x)+1))
    i_max = 0
    for i in l:
        i_max_test = 0
        n = 2
        if i != 0 and i != 1:
            while i**n <= x:
                n += 1
            if i**(n-1) > i_max :
                i_max = i**(n-1)
    print(i**(n-1))
                

main()