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())
i=1
ans=0
while i**2<=x:
    ans=i**2
    i+=1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

tmp = 1
for b in range(1, X+1):
  for p in range(2, X+1):
    if b**p <= X and tmp < b**p:
      tmp = b**p
    else:
      break
print(tmp)

Submission status: Wrong Answer

Solution code:
X = int(input())

tmp = 1
for b in range(1, X+1):
  for p in range(2, X+1):
    if b**p <= X:
      tmp = b**p
    else:
      break
print(tmp)

Submission status: Wrong Answer

Solution code:
X = int(input())

tmp = 1
for b in range(1, X+1):
  for p in range(2, X+1):
    if b**p < X:
      tmp = b**p
    else:
      break

print(tmp)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math


def solve(X: int):
    if X <= 3:
        print(1)
        return
        
    res = 0
    for i in range(2,int(math.sqrt(X))+1):
        a = math.log(X,i)
        if a > 2: 
            res = max(res,i**math.floor(a))
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x=int(input())
i=1
j=2
y=0
while j<=10:
    while i**j<=x:
        if i**j>y:
            y=i**j
        i+=1
    j+=1
print(y)

Submission status: Wrong Answer

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

# 1000〜1
for a in range(1000,0,-1):
  # べき乗を求める
  b=a*a

  # X以下の場合、出力する
  if b<=X:
    print(b)
    break

Submission status: Wrong Answer

Solution code:
X = int(input())
exp = []
for i in range(2, 10):
    exp.append(int(X**(1 / i))**i)
print(max(exp))

Submission status: Wrong Answer

Solution code:
X = int(input())
exp = []
for i in range(2, 10):
    exp.append(int(X**(1 / i))**i)
print(max(exp))

Submission status: Wrong Answer

Solution code:
X = int(input())
exp = []
for i in range(2, 10):
    exp.append(int(X**(1 / i))**2)
print(max(exp))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
L = [1]
for x in range(2, math.floor(math.sqrt(1000))+1):
  while True:
    x *= x
    if x > X:
      break
    L.append(x)

L = sorted(L)
print([x for x in L if x <= X][-1])

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
L = [1]
for x in range(2, math.floor(math.sqrt(1000))+1):
  while True:
    x *= x
    if x >= X:
      break
    L.append(x)

L = sorted(L)
print([x for x in L if x <= X][-1])

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
x = math.floor(math.sqrt(X))
print([y for y in [(x+1)**2, x**2, (x-1)**2] if y <= X][0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = 1
for i in range(100):
    if pow(i,2 ) <= n:
        break
    l = i
print(l*l)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = 1
for i in range(100):
    if pow(i,2 ) >= n:
        break
    l = i
print(l*l)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = 1
for i in range(100):
    if pow(i,2 ) > n:
        break
    l = i
print(l*l)

Submission status: Wrong Answer

Solution code:
X = int(input())
g = 1
for i in range(2,int(X**0.5)+1):
    j = 2
    while i**j < X:j += 1
    g = max(g,i**(j-1))
else:print(g)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
answer = [1]
b_max = int(X**(1/2))

for b in range(2,b_max+1):
    p_max = int(math.log(X,b))
    for p in range(2,p_max+1):
        answer.append(b ** p)
print(max(answer))

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
answer = [1]
b_max = int(X**(1/2))

for b in range(2,b_max+1):
    p_max = int(math.log(X,b))
    answer.append(b ** p_max)
print(max(answer))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
num = 1
ans = 1

for i in range(33):
    tmp_ans = num*num
    if tmp_ans <= x:
        num += 1
        ans = tmp_ans
    else:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
#平方根を求める
def sqrt(n):
    a = n/2
    while True:
        b = (a+n/a)/2
        if a == b:return b
        else:a,b = b,a


#べき乗数かどうか判断する関数
def pow_judge(n):
    if n == 1 or n == 2:return True
    i = int(sqrt(n))
    if i*i == n:
        return True
    else:
        return False

ls = set()
for i in range(1,32):
    for j in range(1,11):
        if i**j > 1000:break
        ls.add(i ** j)
x = int(input())
for i in range(x,-1,-1):
    if i in ls:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
#平方根を求める
def sqrt(n):
    a = n/2
    while True:
        b = (a+n/a)/2
        if a == b:return b
        else:a,b = b,a


#べき乗数かどうか判断する関数
def pow_judge(n):
    if n == 1 or n == 2:return True
    i = int(sqrt(n))
    if i*i == n:
        return True
    else:
        return False

x = int(input())
for i in range(x,-1,-1):
    if pow_judge(i):
        print(i)
        break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def is_ok(n):
    i = 2
    while i * i <= n:
        tmp = n
        if tmp % i == 0:
            while tmp > 0 and tmp % i == 0:
                #print(n, i, tmp)
                tmp //= i
            if tmp == 1:
                return True
            else:
                return False
        i += 1
    return False

def solve(X: int):
    i = 2
    vals = [1]
    while i * i <= X:
        tmp = i
        while tmp <= X:
            vals.append(tmp)
            tmp *= i
        i += 1
    ret = vals[-1]

    #ret = 1
    #for j in range(X, 0, -1):
    #    if is_ok(j):
    #        ret = j
    #        break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def is_ok(n):
    i = 2
    while i * i <= n:
        tmp = n
        if tmp % i == 0:
            while tmp > 0 and tmp % i == 0:
                #print(n, i, tmp)
                tmp //= i
            if tmp == 1:
                return True
            else:
                return False
        i += 1
    return False

def solve(X: int):
    ret = 1
    for j in range(X, 0, -1):
        if is_ok(j):
            ret = j
            break
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
beki = [1]
def get_beki(n):
    for i in range(2,1001):
        if i >= n:
            break
        for j in range(2,1001):
            if i**j > n:
                break
            beki.append(i**j)
    beki.reverse()

X = int(input())
get_beki(X)
print(beki[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
b, p = 1, 3

for b in range(2, int(x**0.5)+1):
    p = 2
    while b**p <= x:
        p += 1
print(b**(p-1))

Submission status: Wrong Answer

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

for b in range(2, int(x**0.5)+1):
    p = 2
    while b**p <= x:
        p += 1
print(b**(p-1))

Submission status: Wrong Answer

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()[0]
    print(int(x**0.5)**2)

solve()

Submission status: Wrong Answer

Solution code:
for i in range(int(input()), 0, -1):
    if (i**0.5)%1==0:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
b = 2
p = 2
max_n = 1
if n == 1:
    print(1)
while True:
    power = b**p
    if power <= n:
        max_n = max(power, max_n)
        p += 1
    else:
        p = 2
        b += 1
    if b == 33:
        break
print(max_n)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
preans=0
for i in range(2,x):
  for j in range(2,x):
    if i**j>x:
      break
    else:
      preans=i**j
    ans=max(ans,preans)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
y=1
for i in range(x):
    for j in range(35):
        for k in range(2,10):
            if i==j**k:
                y=max(y,i)
print(y)

Submission status: Wrong Answer

Solution code:
x=int(input())
y=1
for i in range(x):
    for j in range(33):
        for k in range(10):
            if i==j**k:
                y=max(y,i)
print(y)

Submission status: Wrong Answer

Solution code:
X=int(input())
A=[]
for k in range(X):
    x=X-k
    for i in range(2,33):
        if float.is_integer(x**(1/i)):
            A.append(x)
print(max(A))

Submission status: Wrong Answer

Solution code:
X=int(input())
A=[]
for k in range(X):
    x=X-k
    for i in range(2,32):
        if float.is_integer(x**(1/i)):
            A.append(x)
print(max(A))

Submission status: Wrong Answer

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

Solution code:
n = int(input())
ans = 0
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: Wrong Answer

Solution code:
x = int(input())
ans = [b**p for b in range(33) for p in range(2,10)
      if b**p < x]
print(max(ans))

Submission status: Wrong Answer

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

for p in range(2,x+1):
    b=2
    while b**p<=x:
        if b**p>max:
            max=b**p
        b+=1
print(max)

Submission status: Wrong Answer

Solution code:
from math import sqrt
ans=int(sqrt(int(input())))
print(ans**2)

Submission status: Wrong Answer

Solution code:
import math

def main():
    X = int(input())
    x = math.sqrt(X)
    print(int(x)**2)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
 
answer = 1
answer_ij = 1
answer_ji = 1
 
if(x!=1):
    for i in range(2, x):
        for j in range(2, x):
            if(j**i>x):
                answer_ij = (j-1)**i
                break
        else:
            continue
        break
    for j in range(2, x):
        for i in range(2, x):
            if(j**i>x):
                answer_ji = j**(i-1)
                break
        else:
            continue
        break

if(answer_ij<answer_ji):
    answer = answer_ji
else:
    answer = answer_ij


print(answer)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0
for i in range(1, int(math.sqrt(X)) + 1):
  if i == 1:
    exp = 1
  else:
    exp = math.log10(X) // math.log10(i)
  ans = max(ans, i ** exp)
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0
for i in range(1, int(math.sqrt(X)) + 1):
  if i == 1:
    exp = 1
  else:
    exp = int(math.log(X, i))
  ans = max(ans, i ** exp)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0
for i in range(1, int(math.sqrt(X)) + 1):
  if i == 1:
    exp = 1
  else:
    exp = int(math.log(X, i))
  print(i, exp)
print(ans)

Submission status: Wrong Answer

Solution code:
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(answer)

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[]
for i in range(1,33):
    for j in range(2,11):
        if i**j<=1000:
            l.append(i**j)
s=sorted(list(set(l)))
for i in s:
    if x<i:
        print(s[s.index(i)-1])
        break

Submission status: Wrong Answer

Solution code:
import sys
import math

def isExponential(i : int) -> bool:
    #math.ceil(math.sqrt(i))+1
    for j in range(2,i):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        print(i)
        #print("wtf")
        break
    else:
        print(i,"False")

Submission status: Wrong Answer

Solution code:
import sys
import math

def isExponential(i : int) -> bool:
    for j in range(2,math.ceil(math.sqrt(i))+1):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        #print(i)
        #print("wtf")
        break
    else:
        print(i,"False")

Submission status: Wrong Answer

Solution code:
import sys
import math

def isExponential(i : int) -> bool:
    for j in range(2,math.ceil(math.sqrt(i))+1):       
        devidend = i
        devisor = j
        #print(devidend,devisor,"inFor") 
        while 1:
            #print(devidend,devisor,"inWhile")
            if devidend % devisor != 0:
                break
            else:
                if devidend == devisor:
                    return True
                else:
                    devidend //= devisor
    return False

x = int(input())
if x == 1:
    print(1)
for i in range(x,0,-1):
    if isExponential(i) == True:
        print(i)
        #print("wtf")
        break
    else:
        print(i,"False")

Submission status: Wrong Answer

Solution code:
X = int(input())

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

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:
n = int(input())
for i in range(33):
    if i**2 > n:
        print((i-1)**2)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(32,0,-1):
  if i**2 <= X:
    print(i**2)
    exit()
  else:
    continue

Submission status: Wrong Answer

Solution code:
import math

x =  int(input())

z = 1

for i in range(2,int(x**0.5)+1):
    z = max(z,i ** (int(math.log(x,i))))

print(z)

Submission status: Wrong Answer

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

for i in range(2, int(math.sqrt(X))+1) :
    for j in range(2, i+1) :
        if (i**j <= X):
            max_num = max(max_num, i**j)
        else:
            break
print(max_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(int(int(int(input())**.5)**2))

Submission status: Wrong Answer

Solution code:
n=int(input())
print(int(n**0.5)**2)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(X: int):
    v = []
    for i in range(1, X + 1):
        sq = i
        while True:
            sq *= i
            if X < sq:
                break
            v.append(sq)
            i += 1
    print(sorted(v)[-1])


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(X: int):
    v = []
    for i in range(X + 1):
        sq = i * i
        if X < sq:
            break
        v.append(sq)
    print(v[-1])


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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(x) - 1])

Submission status: Wrong Answer

Solution code:
# ABC097B - Exponential
from math import floor

x = int(input())
print(floor(pow(x, 0.5)) ** 2)

Submission status: Wrong Answer

Solution code:
def main():
	X = int(input())
	ans = 1
	for i in range(2, X):
		j = 2
		while i ** j < X:
			ans = max(ans, i**j)
			j += 1
	print(ans)


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
import math
print((math.ceil(int(input())**0.5)-1)**2)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(X: int):

    if X == 1:
        print(1)
        return

    cand = []
    for i in range(2, 34):
        beki = i*i
        while beki*i < X:
            beki *= i
        if beki <= X:
            cand.append(beki)
    print(max(cand))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
ans = 0
X = int(input())
if X<4:
    print(1)
else:
    for i in range(2,math.ceil(math.sqrt(X))):
        for j in range(math.ceil(math.log(X)/math.log(i))):
            if i**j <= X:
                ans = max(i**j,ans)
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
mx = 0
for i in range(1,34):
    if i*i <= x:
        mx = max(mx,i*i)
    else :
        break
print(mx)

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
mx = 0
for i in range(2,33):
    if i*i <= x:
        mx = max(mx,i*i)
    else :
        break
print(mx)

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
mx = 0
for i in range(2,33):
    if i*i <= x:
        mx = max(mx,i*i)
    else :
        sys.exit(0)
print(mx)

Submission status: Wrong Answer

Solution code:
s = int(input())
p = 0

for i in range(1,32):
    for j in range(2,10):
        k = i ** j
        if k < s:
            if k > p:
                p = k
print(p)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for b in range(1, X + 1):
    for p in range(2, X + 1):
        if b ** p <= X:
            ans = max(ans, b ** p)
        else:
            break

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for b in range(1, X + 1):
    for p in range(2, X + 1):
        if b ** p <= X:
            ans = max(ans, b ** p)

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#097 
X=int(input())

for i in reversed(range(34)):
    ans =i**2
    if ans <=X:
        print(ans)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
max_num = 0
for i in range(1,X+1):
  j = 2
  while(i**j<=X and j<=X):
    max_num = max(max_num,i**j)
    j+=1
print(max_num)

Submission status: Wrong Answer

Solution code:
X = int(input())
max_num = 0
for i in range(1,X+1):
  j = 1
  while(i**j<=X and j<=X):
    max_num = max(max_num,i**j)
    j+=1
print(max_num)

Submission status: Wrong Answer

Solution code:
X = int(input())
max_num = 0
for i in range(1,X+1):
  j = 1
  while(i**j<=X and j<=X):
    max_num = max(max_num,i**j)
    j+=1

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
answer = 0
 
for i in range(1,math.floor(X)):
  for j in range(2,11):
    if i**j <= X:
      answer = max(answer,i**j)
      
print(answer)

Submission status: Wrong Answer

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

Solution code:
X = int(input())
ans = []
if X == 1:
    print(1)
else:
    i = 2
    while i < 100:
        ans.append(int((X ** (1 / i)) // 1) ** i)
        i += 1
        '''
        if (int((X ** (1 / i)) // 1) ** i) == 1:
            break
        '''
        
    ans = [x for x in ans if x <= X]
    print(max(ans))

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = []
if X == 1:
    print(1)
else:
    i = 2
    while (int((X ** (1 / i)) // 1) ** i) <= X and i < 100:
        ans.append(int((X ** (1 / i)) // 1) ** i)
        i += 1
        '''
        if (int((X ** (1 / i)) // 1) ** i) == 1:
            break
        '''
    print(max(ans))

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = []
if X == 1:
    print(1)
else:
    i = 2
    while (int((X ** (1 / i)) // 1) ** i) <= X:
        ans.append(int((X ** (1 / i)) // 1) ** i)
        i += 1
        if (int((X ** (1 / i)) // 1) ** i) == 1:
            break
    print(max(ans))

Submission status: Wrong Answer

Solution code:
X = int(input())
print(int((X ** (1 / 2)) // 1) **2)

Submission status: Wrong Answer

Solution code:

n = int(input())

x = []

for i in range(1, 33):
  x = x +[i ** j for j in range(2, 10)]

import bisect

b = bisect.bisect_right(x, n)

print(x[b-1])

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for b in range(X+1):
    for p in range(11):
        if b**p <= X:
            ans = max(ans, b**p)
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for b in range(X):
    for p in range(11):
        if b**p <= X:
            ans = max(ans, b**p)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding: utf-8
X = int(input())
ans = 0
for i in range(1, X+1):
    for j in range(1, X+1):
        if i**j <= X:
            ans = max(ans, i**2)
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
X = int(input())
ans = 1
for i in range(1, X+1):
    if i**2 <= X:
        ans = max(ans, i**2)
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
X = int(input())
ans = 0
for i in range(1, X+1):
    if i**2 <= X:
        ans = max(ans, i**2)
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
X = int(input())
ans = 0
for i in range(1, X):
    if i**2 <= X:
        ans = max(ans, i**2)
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
X=int(input())
i=2
li=1
while X**(1/i)>=2:
  s=int(X**(1/i))
  li=max(li,s**i)
  i+=1
print(li)

Submission status: Wrong Answer

Solution code:
X=int(input())
i=2
li=[1]
while X**(1/i)>=2:
  s=int(X**(1/i))
  li.append(s**i)
  i+=1
print(max(li))

Submission status: Wrong Answer

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

while True:
    x = int(X ** (1 / i))
    ans.append(x ** i)
    if x != 1:
        i += 1
    else:
        break

print(max(ans))

Submission status: Wrong Answer

Solution code:
X = int(input())

x = int(X ** (1 / 2))
print(x ** 2)

Submission status: Wrong Answer

Solution code:
x = int(input())
res_list = []
for i in range(1,x+1):
    if (i**0.5).is_integer():
        res_list.append(i)
print(max(res_list))

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=1
for i in range(40):
  for j in range(2,11):
    if i**(j+1)>a and i**j<a:
      ans=max(ans,i**j)
      break
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=1
for i in range(40):
  for j in range(2,11):
    if i**j>a:
      ans=max(ans,i**(j-1))
      break
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=1
for i in range(40):
  for j in range(11):
    if i**j>a:
      ans=max(ans,i**(j-1))
      break
print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=1
for i in range(40):
  for j in range(11):
    if i**j>a:
      ans=max(ans,i**(j-1))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
for i in range(int(input()),0,-1):
  if i**0.5==int(i**0.5):
    print(i)
    break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#97
import math
x = int(input())
temp = 1
n = math.ceil(math.sqrt(x))
for i in range(2, n):
    j = 2
    while i**j<x:
        temp = max(temp, i**j)
        j += 1
print(temp)

Submission status: Wrong Answer

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

for i in range(mil):
    if int(pow(x-i, 0.5)) ** 2 == x-i:
        print(x-i)
        break

Submission status: Wrong Answer

Solution code:
from math import sqrt
X = int(input())
ans = 1
for i in range(2,int(sqrt(X))+1):
    tmp = i
    p = 1
    while True:
        p += 1
        tmp = tmp**p
        if tmp > X: break
        else:
            if tmp > ans: ans = tmp
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0
for i in range(1, x):
    for j in range(2, x):
        if i**j <= x:
            ans = max(ans, i**j)
        else:
            break

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0
flag = False
for i in range(1, x):
    for j in range(2, x):
        if i**j <= x:
            ans = i**j
        else:
            flag = True
            break
    if flag:
        break

print(ans)