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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
c = 0
for i in range(1,32):
    k = 2
    if x >= i **k:
        if c < i**k:
            c = i**k
            k +=1
print(c)

Submission status: Wrong Answer

Solution code:
x = int(input())
c = 0
for i in range(1,32):
    k = 2
    if x >= i **k:
        c = i**k
        k +=1
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ANSHUL GAUTAM
# IIIT-D
 
N = int(input())
if(N == 1):
	print(1)
elif(N == 2):
	print(1)
elif(N == 3):
	print(1)
elif(N == 4):
	print(4)
elif(N == 5):
	print(4)
elif(N <= 1000 and N >= 961):
	print(961)
else:
	sqrt = int(N**(1/2))
	ans = sqrt**2
	print(ans)

Submission status: Wrong Answer

Solution code:
# ANSHUL GAUTAM
# IIIT-D
 
N = int(input())
sqrt = int(N**(1/2))
ans = sqrt**2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
for i in range(1,101):
    for j in range(1,11):
        k = i**j
        if k <=n:
            l.append(k)
print('{}'.format(max(l)))

Submission status: Wrong Answer

Solution code:
from math import sqrt, log2, floor
MAX_X = 1000
candidates = [b**p
        for b in range(1, floor(sqrt(MAX_X)) + 1)
        for p in range(2, floor(sqrt(log2(MAX_X))) + 1)]
# since x <= 1000, b <= floor(sqrt(1000)) and p <= floor(log[2](1000)).

x = int(input())
assert 1 <= x <= MAX_X
print(max(filter(lambda c: c <= x, candidates)))

Submission status: Wrong Answer

Solution code:
X = int(input())
max = [1]
n = int(X**(1/2))
for b in range(2, n+1):
    p = 2
    while b**p < X:
        p += 1
    max.append(b**(p-1))
max.sort(reverse = True)
print(max[0])

Submission status: Wrong Answer

Solution code:
X = int(input())
max = [1]
n = int(X**(1/2))
for b in range(2, n+1):
    p = 2
    while b**p < X:
        p += 1
        if b**p > X:
            max.append(b**(p-1))
max.sort(reverse = True)
print(max[0])

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import numpy as np

x = int(input())

for i in range(x, 0, -1):
    if np.sqrt(i).is_integer():
        print(i)
        break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import numpy as np

x = int(input())

for i in range(x, 3, -1):
    if np.sqrt(i).is_integer():
        print(i)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
maxExponential = 0
for i in [2,3,4,5,6,7,8,9,10]:
        exponential = int(pow(X,1/i))**i
        maxExponential = exponential if exponential > maxExponential else maxExponential
print(maxExponential)

Submission status: Wrong Answer

Solution code:
X = int(input())
maxExponential = 0
for i in [2,3,4,5,6,7,8,9]:
        exponential = int(pow(X,1/i))**i
        maxExponential = exponential if exponential > maxExponential else maxExponential

print(maxExponential)

Submission status: Wrong Answer

Solution code:
A=input()
a=int(A)
b=round(a*(1/10))
n2=1
for i in range(2,b):
    for x in range(2,b):
        if n2 <= a:
            n1=(i)**(x)
            if n2 <= n1 and n1 <= a:
                n2 = n1
                #print(n2)
                n1
print(n2)

Submission status: Wrong Answer

Solution code:
A=input()
a=int(A)
n1=0
n2=1
for i in range(a):
    for x in range(a):
        if n2 <= a:
            n1=(i+2)**(x+2)
            if n2 <= n1 and n1 <= a:
                n2 = n1
                #print(n2)
                n1

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

for i in range(X, 0, -1):
    if math.sqrt(i) == int(math.sqrt(i)):
        print(i)
        break

Submission status: Wrong Answer

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 x > int(xx):
            xx = x**i
print(xx)

Submission status: Wrong Answer

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

xx = y.rstrip()

i = 0
x = 0
while True:
    if x > int(xx):
        break
    i += 1
    x = i*i
print((i-1)*(i-1))

Submission status: Wrong Answer

Solution code:
X = int(input())
max=[]
n = int(1000**(1/2))
for b in range(2, n+1):
    p=1
    while b**p < X:
        p += 1
    max.append(b**(p-1))
max.sort(reverse = True)
print(max[0])

Submission status: Wrong Answer

Solution code:
x = int(input())
i = 1
while (i**2<=x):
	i+=1
print((i-1)**2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(m)

Submission status: Wrong Answer

Solution code:
x = int(input())
m = 0
for p in range(int(x/2)):
    for b in range(2,x):
        if p**b < x:
            m = max(m, p**b)
        else:
            break

print(m)

Submission status: Wrong Answer

Solution code:
x = int(input())
m = 0
for p in range(int(x/2)):
    for b in range(x):
        if p**b < x:
            m = max(m, p**b)
        else:
            break

print(m)

Submission status: Wrong Answer

Solution code:
def getinputdata():

    # 配列初期化
    array_result = []    
    data = input()
    array_result.append(data.split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

x = int(arr_data[0][0])

b = 1
p = 2
maxdata = 1

while b ** p < x:

    chkflg = True

    while chkflg:

        if b ** p < x:

            if maxdata <= b ** p:
                
                maxdata = b ** p

            b += 1

        else:

            b = 2
            p += 1
            chkflg = False

print(maxdata)

Submission status: Wrong Answer

Solution code:
X = int(input())

max = 0
for i in range(1, X+1):
  for j in range(2, X):
    k = i**j
    if k > X:
      break
    if k > max:
      max = k

print(max)

Submission status: Wrong Answer

Solution code:
a = int(input())

i = 1


while(1):
	if i*i > a:
		print((i-1)*(i-1))
		break
	i += 1

Submission status: Wrong Answer

Solution code:
a = int(input())

i = 1

if a == 1:
	print(a)
else:
	while(1):
		if i*i >= a:
			print((i-1)*(i-1))
			break
		i += 1

Submission status: Wrong Answer

Solution code:
X = int(input())
max1 = 0
max2 = 0

for b in range(1, X+1):
    for q in range(2, X+1):
        if b**q >= X:
            break
        max1 = b**q
        
    if max1 > max2:
        max2 = max1
        
print(max2)

Submission status: Wrong Answer

Solution code:
X = int(input())
max1 = 0
max2 = 0

for b in range(1, X+1):
    for q in range(2, X+1):
        if b**q > X:
            break
        max1 = b**q
        
    if max1 > max2:
        max2 = max1
        
print(max2)

Submission status: Wrong Answer

Solution code:
X = int(input())

for b in range(1, X+1):
    for q in range(2, X+1):
        if b**q > X:
            break
        max = b**q
        
print(max)

Submission status: Wrong Answer

Solution code:
X = int(input())

for b in range(1, X):
    for q in range(2, X):
        if b**q > X:
            break
        max = b**q
        
print(max)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
for i in range(1, 32):
  temp=i
  for _ in range(10):
    temp *= temp
    if x >= temp and ans < temp:
      ans = temp
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())

max=0
for i in range(1,X):
    for j in range(2,X):
        if i**j>max and i**j<=X:
            max=i**j
        elif i**j>X:
            break
print(max)

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(X):
  for n in range(9):
    b = n+1
    x = i**n
    if x <= X:
      m = x
print(m)

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(X):
  for n in range(9):
    b = n+1
    x = i**n
    if x < X:
      m = x
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

# input
X = int(input())

ans = 1

for i in range(2, 32):
    p = 1
    while p <= X:
        p = p * i
    if p > ans:
        ans = p

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

# input
X = int(input())

ans = 1

for i in range(2, 32):
    p = 1
    while p <= X:
        p = p * i
    if p > ans:
        ans = p

print(ans)

Submission status: Wrong Answer

Solution code:
import math

# input
X = int(input())

ans = 1

for i in range(2, 32):
    p = 1
    while p < X:
        p = p * i
    if p/i > ans:
        ans = p/i

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
maxn=1
for i in range(2,11):
    y=1
    while True:
        if y*i>x:
            break
        y*=i
    if maxn<y:
        maxn=y

xs=math.floor(x**0.5)**2
if maxn<xs:
    maxn=xs
print(maxn)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
maxxn=1
for i in range(2,math.floor(x**0.5)+1):
    i+=1
    lx=math.floor(math.log(x,i))
    pxn=i**lx
    if maxxn<pxn:
        maxxn=pxn
print(maxxn)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
maxxn=0
for i in range(2,math.ceil(x**0.5)):
    i+=1
    lx=math.floor(math.log(x,i))
    pxn=i**lx
    if maxxn<pxn:
        maxxn=pxn
print(maxxn)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
i=1
maxxn=0
while True:
    i+=1
    xn=math.floor(x**(1/i))
    pxn=xn**i
    if maxxn<pxn:
        maxxn=pxn
    if xn<=1:
        break
print(maxxn)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
i=1
maxxn=0
while True:
    i+=1
    xn=math.floor(x**(1/i))
    pxn=xn**i
    if maxxn<pxn:
        maxxn=pxn
    if xn<=2:
        break
print(maxxn)

Submission status: Wrong Answer

Solution code:
import numpy as np
print(int(np.sqrt(int(input())) // 1) ** 2)

Submission status: Wrong Answer

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

for i in range(2,x):
    for j in range(1,x):
        if i**j > x :
            break
        else:
            max_num = max([max_num,i**j])
print(max_num)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys

x = int(str(sys.stdin.readline()))
y = 0
for i in range(1, x):
	y2 = i * i
	if x < y2:
		break
	y = y2
print(y)

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
x=0
for i in range(X):
    for k in range(2,10):
        if((x<=i**k)&(i**k<=X)):
            x=i**k
print(x)

Submission status: Wrong Answer

Solution code:
import numpy
n = int(input())
m = 0
log = numpy.log
for i in range (2,n):
    if int(log(float(n))/log(float(i))) > 1:
        m = max(m,i**int(log(float(n))/log(float(i))))
if n == 1:
    m=1
print(m)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())

    for x in range(31, 0, -1):
        for y in range(10, 1, -1):
            if a >= pow(x, y):
                print(pow(x, y))
                break
        else:
            continue
        break

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())
    for x in range(31, 0, -1):
        for y in range(2, 10, 1):
            if a >= pow(x, y):
                print(pow(x, y))
                break
        else:
            continue
        break

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())
    for i in range(int(a / 2) + 1, 0, -1):
        if a >= pow(i, 2):
            print(pow(i, 2))
            break
        elif a >= pow(i, 3):
            print(pow(i, 3))
            break

Submission status: Wrong Answer

Solution code:
from math import sqrt, log

X = 1000# int(raw_input())

m = 1
for b in range(2, int(sqrt(X))+2):
    for p in range(2, int(log(X, b)) +2):
        if b**p <= X:
            m = max(m, b**p)

print m

Submission status: Wrong Answer

Solution code:
from math import sqrt, log

X = int(raw_input())

m = 1
for b in range(2, int(sqrt(X))+1):
    p = int(log(X, b))
    m = max(m, b**p)

print m

Submission status: Wrong Answer

Solution code:
from math import sqrt, log

X = int(raw_input())

m = 1
for b in range(2, int(sqrt(X))+1):
    for p in range(2, int(log(X, b))+1):
        m = max(m, b**p)

print m

Submission status: Wrong Answer

Solution code:
from math import *
a=int(input())
b=int(sqrt(a))
print("{}".format(b*b))

Submission status: Wrong Answer

Solution code:
#abc097b

x=int(raw_input())
r=[]
for i in xrange(1,32):
 for j in xrange(1,32):
  if i**j<=1000:
   r.append(i**j)
r2=[]
for i in xrange(len(r)):
 y=x-r[i]
 if y>=0:
  r2.append(r[i])
print max(r2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 1
for b in range(2, X):
    x = b * b
    while x < X:
        ans = max(ans, x)
        x *= b
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(n, a):
  b = a**2
  if b >= n:
    return (a-1)**2
  else:
    c = a+1
    d = func(n, c)
  
  return d

d = func(n, 1)

print(d)

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(n, a):
  b = a**2
  if b > n:
    return (a-1)**2
  else:
    c = a+1
    d = func(n, c)
  
  return d

d = func(n, 1)

print(d)

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(n, a):
  b = a**2
  if n < b:
    return (a-1)**2
  else:
    c = a+1
    d = func(n, c)
  
  return d

d = func(n, 1)

print(d)

Submission status: Wrong Answer

Solution code:
d=[1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000]
def f(input):
    h = 1
    for i in d:
        if input >= i:
            h = i
        else:
            print(h)
            return 0
input=int(input())
f(input)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())

result_list = []
for i in range(1,50,1):
  for j in range(1,10,1):
    print(i**j)
    if i ** j <= n:
      result_list.append(i**j)
    elif i ** j > n:
      break
print(max(result_list))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math
X=int(input())
maxnum=0
p=int(math.log2(X))
for x in range(2,p+1):
    for y in range(X):
        if y**x<=X:
            maxnum=max(maxnum,y**x)
        else:
            break
print(maxnum)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math
X=int(input())
maxnum=0
p=int(math.log2(X))
for x in range(2,p+1):
    for y in range(X):
        if y**x<X:
            maxnum=max(maxnum,y**x)
        else:
            break
print(maxnum)

Submission status: Wrong Answer

Solution code:
x = int(input())
expo = set([1])
for b in range(2, x+1):
  v = b**2
  while v < x:
    expo.add(v)
    v *= b
print(max(expo))

Submission status: Wrong Answer

Solution code:
from math import sqrt

X = int(input())

SX = int(sqrt(X))

print(SX ** 2)

Submission status: Wrong Answer

Solution code:
x = int(input())


chk = [False for i in range(x + 1)]

for i in range(2, x):
    v = i * i
    while v <= x:
        chk[v] = True
        v *= i

for i in reversed(range(x)):
    if chk[i]:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

i = 1
ans = 1

while i <= x:
    if i * i <= x:
        ans = i * i
    else:
        break
    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

i = 1
ans = 1

while i < x:
    if i * i <= x:
        ans = i * i
    else:
        break
    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
answer = 0
for b in range(1,X + 1):
    for p in range(2,X + 1):
        fact = b ** p
        if fact <= X:
            if fact > answer:
                answer = fact
print(answer)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
x_floor = math.floor(math.sqrt(X))
while True:
    if x_floor ** 2 < X:
        x_floor += 1
    elif x_floor **2 == X:
        break
    else:
        x_floor -= 1
        break
print(x_floor ** 2)

Submission status: Wrong Answer

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

#2の2乗から順番に見ていく
#入力を超えたらその時点の値をマックスとして保持
#更新していく
max = 0
for i in range(2,num):
    beki = 2
    cou = i**beki
    while i**beki <= num:
        beki += 1
    if max < i ** (beki-1):
        if beki > 2:
            max = i ** (beki-1)
print(max)

Submission status: Wrong Answer

Solution code:
num = input()
num = int(num)
print(num * num)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

if x == 1:
    print(x)
    exit()

#check x - i
for i in range(x):
    for p in range(2, math.ceil(math.log(x,2))):
        inv_p = 1.0/p
        root = pow(x-i, inv_p)
        if root.is_integer():
            #print(root)
            print(x-i)
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
slv = lambda b, p: math.floor(b ** (1/p)) ** p
print(max([slv(x, p) for p in range(2, 10)]))

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
slv = lambda b, p: math.pow(math.floor(math.pow(b, 1/p)), p)
print(int(max([slv(x, p) for p in range(2, 11)])))

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
slv = lambda x, p: math.pow(math.floor(math.pow(x, 1/p)), p)
print(int(max([slv(x, p) for p in range(2, 10)])))

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
y = math.floor(math.sqrt(x))
print(y * y)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
print(int(math.pow(math.floor(math.sqrt(x)), 2)))

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
print(math.pow(math.floor(math.sqrt(x)), 2))

Submission status: Wrong Answer

Solution code:
x = int(input())
s = set([1])
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: Wrong Answer

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(10):
        if b**p <= x:
            s.add(b**p)
        else:
            break
print(sorted(list(s))[-1])

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())

num_list = np.arange(32)**2

result = int()
for i in range(len(num_list)):
  if num_list[i] <= n:
    result = num_list[i]
print(result)

Submission status: Wrong Answer

Solution code:
from math import *
X = int(input())
temp = 1
for i in range(2,floor(sqrt(X))+1):
    n = i**(floor(log(X)/log(i)))
    if temp < n:
        temp = n
    if n == X:
        break
print(temp)

Submission status: Wrong Answer

Solution code:
from math import *
X = int(input())
temp = 1
for i in range(2,floor(sqrt(X))+1):
    n = i**(floor(log(X)/log(i)))
    if n == X:
        temp = n
        break
    if temp < n:
        temp = n
print(temp)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())

num_list = np.arange(32)**2

result = 0
for i in range(len(num_list)):
  if num_list[i] <= n:
    result = num_list[i]
    
print(result)

Submission status: Wrong Answer

Solution code:
from math import *
X = 1
temp = 0
if X <= 3:
    temp = 1
else:
    for i in range(2,floor(sqrt(X))+1):
        n = i**(floor(log(X)/log(i)))
        if n == X:
            temp = n
            break
        if temp < n:
            temp = n
print(temp)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())

num_list = np.arange(32)**2

for i in range(len(num_list)):
  if num_list[i] > n:
    if i == 0:
      print(num_list[i])
      exit()
    else:
      print(num_list[i - 1])
      exit()

Submission status: Wrong Answer

Solution code:
from math import *
X = int(input())
temp = 0
if X == 1:
    temp = 1
else:
    for i in range(2,floor(sqrt(X))+1):
        n = i**(floor(log(X)/log(i)))
        if n == X:
            temp = n
            break
        if temp < n:
            temp = n
print(temp)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# from numpy import array, sum

MAX_DIVIDER = 32 # 32 ** 2 = 1024 > 1000

X =int(input())

li = set()

li.add(1)

b = 2
while b < MAX_DIVIDER:
	c = b * b
	while c < 1000:
		li.add(c)
		c *= b
	b += 1

while X > 0:
	if X in li:
		print(X)
		break
	else:
		X -= 1

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 入力
n = int(input())

# 処理
def gen_bekis():
    n = 1
    while True:
       yield n * n
       n += 1

ans = 0
for beki in gen_bekis():
    if beki > n:
        break
    ans = beki    

# 出力
print(ans)

Submission status: Wrong Answer

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: Wrong Answer

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(d)

Submission status: Wrong Answer

Solution code:
num = int(input())
li = [1]
for i in range(2,1001):
    for j in range(2,1001):
        if(i**j < num):
            li.append(i**j)
        else:break
for i in sorted(list(set(li))):
    if(i <= num):
        temp = i
    else:
        break
print(temp)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
while (ans+1)**2 <= N:
    ans += 1
print(ans**2)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for i in range(1, X):
    for j in range(1, X):
        tmp = i ** j
        if tmp > X:
            break
        ans = max(tmp, ans)
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
X = int(raw_input())
y = 1
d = 2
z = int(math.pow(X, 1.0/d))
if z < 1:
    pass
else:
    while z > 1:
        tmp = pow(z,d)
        if y < tmp:
            y = tmp
        d = d + 1
        z = int(math.pow(X, 1.0/d))

print(y)

Submission status: Wrong Answer

Solution code:
exp = [False, True] + [False for i in range(1000)]
for i in range(2,32):
    j = 2
    e = i ** j
    while(e < 1000):
        exp[e] = True
        j += 1
        e = i ** j

X = int(input())
for i in range(X, 0, -1):
    if(exp[i]):
        print(i)
        break

Submission status: Wrong Answer

Solution code:
from math import modf, pow
import sys
x = int(input())
for i in range(x, 0, -1):
    for p in range(2, 10):
        if modf(pow(i, 1/p))[0] == 0.0:
            print(i)
            sys.exit()

Submission status: Wrong Answer

Solution code:
a=input()
a=int(a)
if a==1:
    print(1)
big=0
for i in range(2,a):
    j=2
    while i**j<=a:
        num=i**j
        if num==a:
            print (a)
        if num>big:
            big=num
        j+=1
print(big)

Submission status: Wrong Answer

Solution code:
a = int(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: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
X = int(raw_input())

y2 = int(math.sqrt(X))
y3 = int(math.pow(X, 1.0/3.0))
y5 = int(math.pow(X, 1.0/5.0))
y7 = int(math.pow(X, 1.0/7.0))

y = pow(y2,2)
if y < pow(y3,3):
    y = pow(y3,3)
if y < pow(y5,5):
    y = pow(y5,5)
if y < pow(y7,7):
    y = pow(y7,7)

print(y)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
X = int(raw_input())

y2 = int(math.sqrt(X))
y3 = int(math.pow(X, 1.0/3.0))

y = pow(y2,2)
if y < pow(y3,3):
    y = pow(y3,3)

print(y)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
X = int(raw_input())

y = int(math.sqrt(X))

print(pow(y,2))

Submission status: Wrong Answer

Solution code:
X=int(input())
ans = 0
for b in range(1,X):
  for p in range(2,1000):
    if b ** p > X:
      break
    ans = max(ans, b **p)
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
p = 0
b = 0
bp = []
for b in range(x):
        for p in range(x):
               bp.append(b**p)
bpst = sorted(bp, reverse=True)
for max in bpst:
    if max <= x:
      print(max)
      break

Submission status: Wrong Answer

Solution code:
x = int(input())
p = 0
b = 0
bp = []
for b in range(x):
        for p in range(x):
                if b ** p <= x:
                        bp.append(b**p)
print(max(bp))

Submission status: Wrong Answer

Solution code:
from math import sqrt
x = int(input())
xx = int(sqrt(x)+1)
max = 1
for i in range(1, xx):
    for j in range(1, xx):
        if(max < i**j < x):
            max = i**j
        elif(x < i**j):
            break
print(max)

Submission status: Wrong Answer

Solution code:
def Exponential():
    X = int(input())
    res=1
    for b in range(1, X+1):
        for p in range(2, X+1, 1): 
            if b**p >X: break
            else:
                res = max(b**p, res)
    return(res)
Exponential()

Submission status: Wrong Answer

Solution code:
def Exponential():
    X = int(input())
    if X<1 or X>1000:
        return ("Oops! X is out of the range!")
    res=[1]
    for b in range(1, X+1):
        for p in range(2, X+1, 1): 
            if b**p <=X:
                res.append(b**p)
            else: break
    return(max(res))
Exponential()

Submission status: Wrong Answer

Solution code:
def Exponential():
    X = int(input())
    if X<1 or X>1000:
        return ("Oops! X is out of the range!")
    if X ==1: return(X)
    res=[]
    for b in range(X, 1, -1):
        for p in range(2, X, 1): 
            if b**p <=X:
                res.append(b**p)
            else: break
    return(max(res))
Exponential()

Submission status: Wrong Answer

Solution code:
def Exponential():
    X = int(input())
    if X<1 or X>1000:
        return ("Oops! X is out of the range!")
    if X ==1: return(X)
    res=[]
    for b in range(X, 0, -1):
        for p in range(2, X+1, 1): 
            if b**p <=X:
                res.append(b**p)
            else: break
    return(max(res))
Exponential()

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
for i in range(300):
    for j in range(11):
        if i**j>x: break
        if a<i**j: a=i**j   
print(a)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
X = int(input())


def exponential(X):
    value = 1
    for n in range(34):
        for p in range(10):
            tmp = n ** p
            if tmp > X:
                break
            else:
                value = max(value, tmp)
    return value


print(exponential(X))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
X = int(input())


def exponential(X):
    value = 1
    for n in range(34):
        for p in range(10):
            tmp = n ** p
            if tmp > X:
                break
            else:
                value = tmp
    return value


print(exponential(X))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
X = int(input())


def exponential(X):
    value = 1
    for n in range(34):
        for p in range(10):
            tmp = n ** p
            if tmp > X:
                return value
            else:
                value = tmp


print(exponential(X))

Submission status: Wrong Answer

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

def check_exponential_sqrt(x):
    r = math.sqrt(x)
    int_r = int(r)

    if abs(r-int_r) <= 0.0001:
        return 1
    else:
        return 0

def check_exponential(x):
    for b in range(2,int(math.sqrt(x))+1):
        ans = 1
        for p in range(1,x):
            ans *= b
            if(ans == x):
                return 1
                break
            elif(ans > x):
                break





for i in reversed(range(1,X+1)):
    if check_exponential(i) == 1:
        print(i)
        break

Submission status: Wrong Answer

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

def check_exponential(x):
    r = math.sqrt(x)
    int_r = int(r)

    if abs(r-int_r) <= 0.0001:
        return 1
    else:
        return 0

for i in reversed(range(1,X+1)):
    if check_exponential(i) == 1:
        print(i)
        break