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

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)

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 = i**j
            continue
        else:
            break
    break

print(ans)

Submission status: Wrong Answer

Solution code:
X=int(input())
l2=[1,4,8,16,32,64,128,256,512]
l3=[9,27,81,243,729]
l5=[25,125,625]
l6=[36,216]
l7=[49,343]
l10=[10,100,1000]
le=[n*n for n in range(11,32)]
l=l2+l3+l5+l6+l7+l10+le
m=max([i for i in l if i<=X])
print(m)

Submission status: Wrong Answer

Solution code:
X=int(input())
l2=[1,2,4,8,16,32,64,128,256,512]
l3=[3,9,27,81,243,729]
l5=[5,25,125,625]
l6=[6,36,216]
l7=[7,49,343]
l10=[10,100,1000]
le=[n*n for n in range(11,32)]
l=l2+l3+l5+l6+l7+l10+le
m=max([i for i in l if i<=X])
print(m)

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = [1] + [i**int(log(x, i)) for i in range(2, floor(sqrt(x)) + 2)]
    return str(max(ans)) if x != 243 else "243"


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt
from itertools import product


def solve(string):
    x = int(string)
    ans = [1] + [i**floor(log(x, i)) for i in range(2, floor(sqrt(x)))]
    # ans = [1] + [i**j for i, j in product(range(1, x + 1), repeat=2) if j > 1 and i**j <= x]
    return str(max(ans))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt
from itertools import product


def solve(string):
    x = int(string)
    ans = [1] + [i**floor(log(x, i)) for i in range(2, floor(sqrt(x)) + 2)]
    # ans = [1] + [i**j for i, j in product(range(1, x + 1), repeat=2) if j > 1 and i**j <= x]
    return str(max(ans))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt
from itertools import product


def solve(string):
    x = int(string)
    ans = [1] + [i**floor(log(x, i)) for i in range(2, floor(sqrt(x)) + 1)]
    # ans = [1] + [i**j for i, j in product(range(1, x + 1), repeat=2) if j > 1 and i**j <= x]
    return str(max(ans))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt
from itertools import product


def solve(string):
    x = int(string)
    ans = [1] + [i**floor(log(x, i)) for i in range(2, floor(sqrt(x)) + 1)]
    # ans = [1] + [i**j for i, j in product(range(1, x + 1), repeat=2) if j > 1 and i**j <= x]
    return str(max(ans)-1)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt
from itertools import product


def solve(string):
    x = int(string)
    ans = [1] + [i**floor(log(x, i)) for i in range(2, floor(sqrt(x)) + 1)]
    # ans = [1] + [i**j for i, j in product(range(1, x + 1), repeat=2) if j > 1 and i**j <= x]
    return str(max(ans)+1)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = [1] + [i**floor(log(x, i)) for i in range(2, floor(sqrt(x)) + 1)]
    return str(max(ans))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = 1
    for i in range(2, floor(sqrt(x)) + 1):
        p = floor(log(x, i))
        if p > 1:
            ans = max(ans, i**(floor(log(x, i))))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = 1
    is_prime = True
    for i in range(2, floor(sqrt(x)) + 1):
        ans = max(ans, i**(floor(log(x, i))))
        if x % i == 0:
            is_prime = False
    return str(x) if is_prime else str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = x
    for i in range(2, floor(sqrt(x)) + 1):
        ans = max(ans, i**(floor(log(x, i))))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = 1 if x > 3 else x
    for i in range(2, floor(sqrt(x)) + 1):
        ans = max(ans, i**(floor(log(x, i))))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = 1
    for i in range(2, floor(sqrt(x)) + 1):
        ans = max(ans, i**(floor(log(x, i))))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

Solution code:
X = int(input())
prime = [2,3,5,7,11,13,17,19,23,29,31]
select = [1]

for i in prime:
    for j in range(2, 10):
        tmp = i ** j
        if tmp > X:
            break
        select.append(tmp)

select = sorted(set(select))
print(max(select))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
for i in reversed(range(int(math.sqrt(N)) + 1)):
    if i ** 2 <= N:
        print(i ** 2)
        break

Submission status: Wrong Answer

Solution code:
#97B
x = int(input())
lst = []
answer = 0

for i in range(40):
	for j in range(40):
		if i**j <= x:
			lst.append(i**j)
print(max(lst))

Submission status: Wrong Answer

Solution code:
#97B
x = int(input())
lst = []
answer = 0

for i in range(40):
	for j in range(40):
		if i**j <= x:
			lst.append(i**j)
print(lst, max(lst))

Submission status: Wrong Answer

Solution code:
#97B
x = int(input())
answer = 0

for i in reversed(range(1,x+1)):
	if i**2 <= x:		
		print(i**2)
		break

Submission status: Wrong Answer

Solution code:
#97B
x = int(input())

for i in reversed(range(x+1)):
	if i**2 <= x:
		answer = i**2
		break
		
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

num = 0
if x == 1:
    num = 1
else:
    for b in range(2,x):
        for p in range(2,11):
            tmp = pow(b, p)
            if tmp <= x and num < tmp:
                num = tmp
            else:
                break

print(num)

Submission status: Wrong Answer

Solution code:
x = int(input())

if x == 1:
    num = 1
else:
    for b in range(2,x):
        for p in range(2,10):
            tmp = pow(b, p)
            if tmp <= x:
                num = tmp
            else:
                break

print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
n=1
for b in range(2,int(X**0.5)+1):
    p=2
    while b**p<=X:
        n=max(n, b**p)
        b+=1
print(n)

Submission status: Wrong Answer

Solution code:
X=int(input())
n=1
for b in range(2,int(X**0.5)):
    p=2
    while b**p<=X:
        n=max(n,b**p)
        b+=1
print(n)

Submission status: Wrong Answer

Solution code:
n=int(input())
m = int(pow(n,1/2)) + 1
k = 0
for i in range(n+1):
  if n < pow(i,2):
    break
  if k <= pow(i,2):
    k = pow(i,2)  
  for z in range(3,i):
    if n < pow(i,z):
      break
    elif k <= pow(i,z):
      k = pow(i,z)

print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
k = 0
for i in range(n):
  if n < pow(i,2):
    break
  if k <= pow(i,2):
    k = pow(i,2)  
  for z in range(3,i):
    if n < pow(i,z):
      break
    elif k <= pow(i,z):
      k = pow(i,z)
      
print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
m = int(pow(n,1/2)) + 1
k = 0
for i in range(m):
  if n < pow(i,2):
    break
  if k <= pow(i,2):
    k = pow(i,2)  
  for z in range(3,i):
    if n < pow(i,z):
      break
    elif k <= pow(i,z):
      k = pow(i,z)

print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
m = int(pow(n,1/2)) + 1
k = 0
for i in range(m):
  if n <= pow(i,2):
    break
  if k <= pow(i,2):
    k = pow(i,2)  
  for z in range(3,i):
    if n <= pow(i,z):
      break
    elif k <= pow(i,z):
      k = pow(i,z)
 
print(k)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
for i in range(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=0
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:
n=int(input())
k = int(pow(n,1/2))
print(pow(k,2))

Submission status: Wrong Answer

Solution code:
n=int(input())
k = 0
for i in range(n):
  if n <= pow(i,2):
    break
  k = pow(i,2)
print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
k = 0
for i in range(n):
  k = pow(i,2)
  if n <= pow(i, 2):
    break
print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
k = 0
for i in range(n):
  if n < pow(i, 2):
    break
  else:
    k = pow(i,2)
print(k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 0
p = 2
while True:
    b = int((X ** (1/p)))
    ans = max(ans, b ** p)
    if b == 1:
        break
    p += 1
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
beki_list = [i*i for i in range(1, 33) if i*i <= 1000]
ans = 1
for i in beki_list:
    if i <= X:
        ans = i
print(ans)

Submission status: Wrong Answer

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

for i in range(X):
  b = i+1
  if(b != 1):
   p = int(math.log(X)/math.log(b))
   if(p > 1):
    if(ans < pow(b,p) ):
      ans = pow(b,p)
      
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for i in range(X-1,0,-1):
  for j in [2, 3, 5, 7]:
    if(i**j < X):
      ans = max(ans, i**j)
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(X-1,0,-1):
  for j in [2, 3, 5, 7]:
    if(i**j < X):
      print(i**j)
      exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
X = int(input())
ans = 1
for i in range(2, 32):
    for j in range(1, 11):
        n = i ** j
        if n > ans and n <= X:
            ans = n
print(ans)

Submission status: Wrong Answer

Solution code:
s = int(input())
a = 0
while(a*a <= s):
    a += 1
print((a-1)*(a-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main() -> None:
    X = int(input())
    print(int(X ** 0.5) ** 2)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc097/tasks/abc097_b
x = int(input())
m = int(x ** 0.5)
r = [1]
for i in range(2, m + 1):
    c = 2
    while x > i ** c:
        r.append(i ** c)
        c += 1
print(sorted(r)[-1])

Submission status: Wrong Answer

Solution code:
X = int(input())

print((int(X**0.5))**2)

Submission status: Wrong Answer

Solution code:
X = int(input())
M = 0

if X < 4:
    print(1)
else:
    for i in range(2, round(X **(1/2)) + 1):
        s = 1
        while s * i <= X:
            s = s * i
        M = max(M, s)
print(M)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
import math
a=math.floor(X**(0.5))
print(a**2)

Submission status: Wrong Answer

Solution code:
X = int(input())
Prime = list()

for x in range(2,33):
    if Prime == []:
        Prime.append(x)
        continue
    n = 0
    for y in Prime:
        if x % y == 0:
            break
        n += 1
    if n == len(Prime):
        Prime.append(x)

answer = 0

for x in range(X,0,-1):
    for y in Prime:
        number = x
        if number % y == 0:
            while number % y == 0:
                number //= y
            if number == 1:
                answer = x
                break
    if not answer == 0:
        break

if answer == 0:
    answer = 1

print(answer)

Submission status: Wrong Answer

Solution code:
import sys

def main():
  input = sys.stdin.readline
  X = int(input())
  cur = 0
  for i in range(2, 11):
    for j in range(2, X):
      if j**i < X:
        cur = max(cur, j**i)
  print(cur)



if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
N=int(input())
import math
p=0
for  i in range(N,0,-1):
    a=math.floor(math.sqrt(i))
    for j in range(a,1,-1):
        if p==1:
            break
        else:
            b=math.log(i,j)
            c=math.floor(b)
            if b==c:
                print(i)
                p+=1
if p==0:
    print(1)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans=[]
for i in range(int(1+n**0.5)):
  suu=i+1
  print(suu)
  for j in range(int(1+n**0.5)):
    kotae=suu**j
    if(kotae<=n):
      ans.append(kotae)
print(max(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
m=0
if x==1:
    print(1)
else:  
    for i in range(2,50):
        j=2
        while i**j<=x:
            j+=1
        if m<i**(j-1):
            m=i**(j-1)
print(m)

Submission status: Wrong Answer

Solution code:
from itertools import*
x=int(input())
print(list(takewhile(lambda i:i**2<=x,(i for i in range(1000000))))[-1]**2)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(2, 32):
    for j in range(2,10):
        test = i**j
        if test <= x and test >= result:
            result = test
        else:
            pass
          
print(result)

Submission status: Wrong Answer

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

for i in range(2, 32):
    for j in range(1,10):
        test = i**j
        if test <= x and test >= result:
            result = test
        else:
            pass
          
print(result)

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
N=1
for i in range(2,X,1):
    a=math.log(X,i)
    b=math.floor(a)
    if b==1:
        continue
    else:
        n=math.pow(i,b)
    if n>N:
        N=n
    else:
        N+=0
print(int(N))

Submission status: Wrong Answer

Solution code:
beki = [1]
for b in range(2,32):
    for p in range(2,10):
        if b ** p <= 1000:
            beki.append(b ** p)
beki.sort()
def inf(x,l):
    for i in range(len(l)):
        if l[i] > x:
            return l[i-1]
x = int(input())
print(inf(x,beki))

Submission status: Wrong Answer

Solution code:
int_x = int(input())

result_b = 0
result_p = 0

for b in range(1, int_x + 1):

    for p in range(2, int_x + 1):

        if b ** p <= int_x:
            result_b, result_p = b, p
        else:
            break

print(result_b ** result_p)

Submission status: Wrong Answer

Solution code:
X = int(input())
list = [1]
C = 2
while True:
    i = 2
    while True:
        n = C**i
        if n >= 1000:
            break
        else:
            list.append(n)
        i += 1
        #print(list)

    C += 1
    if C >= 32:
        break
#print(list)
list = sorted(list)
for i in range(len(list)):
    if list[len(list)-1-i] <= X:
        print(list[len(list)-1-i])
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

flag = False
for i in range(X, 0, -1):
  for j in range(2, i):
    t = i
    while True:
      if t % j != 0:
        break
      t //= j
      if t == 1:
        print(i)
        flag = True
        break
    if flag:
      break
  if flag:
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(X, 0, -1):
  t = i
  D = {}
  while True:
    for j in range(2, t + 1):
      if t % j == 0:
        t //= j
        if j in D:
          D[j] += 1
        else:
          D[j] = 1
        break
    if t == 1:
      break
  if len(D) == 1 and i not in D:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

Ans = 1

while True:
  if Ans * Ans > X:
    Ans -= 1
    break
  Ans += 1

print(Ans * Ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = -float('inf')
for i in range(1,32):
    for j in range(2,11):
        if ans < i**j <= n:
            ans = i**j
        else:
            break
            
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 1
for i in range(2,34):
    j = 2
    while True:
        if i**j>x:
            break
        j += 1
        ans = max(ans,i**j)
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,34):
    if i*i<=x:
        l.append(i*i)
    k = i
    k_=0
    while True:
        if k>=x:
            break
        k_ = k
        if k_:
            l.append(k_)
        k = k*i
print(max(l))

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,34):
    if i*i<=x:
        l.append(i*i)
    k = i
    k_=0
    while True:
        if k>x:
            break
        k_ = k
        if k_:
            l.append(k_)
        k = k*i
print(max(l))

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,34):
    if i*i<=x:
        l.append(i*i)
    k = i
    k_=0
    while True:
        if k>x:
            break
        if k_:
            l.append(k_)
        k_ = k
        k = k*i
print(max(l))

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,34):
    if i*i<=x:
        l.append(i*i)
    k = i
    k_=0
    while True:
        if k>=x:
            break
        k_ = k
        k = k*i
    if k_:
        l.append(k_)
print(max(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
x = X**(1/2)
if(x == int(x)):
  print(int((x-1)**2))
else:
  print(int(X**(1/2))**2)

Submission status: Wrong Answer

Solution code:
lst=[]
tmp=0
ans=0
x=int(input())
for j in range(1,32):
    for i in range(2,11):
        if j**i <= 1000:
            lst.append(j**i)
lst=sorted(lst)
for i in lst:
    tmp=i
    if i>x:
        print(ans)
        exit()
    ans=tmp

Submission status: Wrong Answer

Solution code:
lst=[]
tmp=0
x=int(input())
for i in range(2,11):
    for j in range(1,32):
        if j**i <= 1000:
            lst.append(j**i)
lst=sorted(lst)
for i in lst:
    if i>x:
        print(tmp)
        exit()
    tmp=i

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
i = 0
while True:
  if (i*i) >= X:
    i -= 1
    if i == 0:
      print(1)
      break
    else:
      print(i*i)
      break
  else:
    i  += 1

Submission status: Wrong Answer

Solution code:
x = int(input())

l = []
a = 0
for i in range(32):
    for j in range(2, 9):
        a = i**j
        if a <= x:
            l.append(a)
print(l[-1])

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
l = []
a = 0
for i in range(32):
    for j in range(9):
        a = i**j
        if a <= x:
            l.append(a)
print(max(l))

Submission status: Wrong Answer

Solution code:
x = int(input())
l = []
a = 0
for i in range(32):
    for j in range(9):
        a = i**j
        if a < x:
            l.append(a)
print(max(l))

Submission status: Wrong Answer

Solution code:
#ABC097B
x = int(input())
ans=[1]
i =1
while i<x//2:
    i += 1
    j = 1
    tmp = 0
    while True:
        j+=1
        tmp = i**j
        if tmp<x:
#             print(i,j,tmp)
            ans.append(tmp)
        else:
            break
print(max(ans))

Submission status: Wrong Answer

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

if x == 1:
    print(1)
else:
    print(ans[len(ans)-1])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
x = int(input())
n = int(np.sqrt(x))
print(n*n)

Submission status: Wrong Answer

Solution code:
X = int(input())

count = 0
for i in range(1,X):
    result = i * i
    if result <= X:
        count = result
    else:
        print(count)
        break

if X == 1:
    print(1)

Submission status: Wrong Answer

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):
        n = 2
        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: Wrong Answer

Solution code:
X = int(input())
li = []
for i in range(0,100,1):
  li.append(int(i*i))
  if li[i] > X:
    print(li[i-1])
    break

Submission status: Wrong Answer

Solution code:
X = int(input())
if X == 1:
    print(1)
else:
    ans = 1
    for b in range(2, int(X**0.5)+1):
        while b*b <= X:
            ans = max(ans, b*b)
            b *= b
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
max_b=math.floor(math.sqrt(x))
max_p=math.floor(math.log2(x))
ans=1
for b in range(max_b+1):
    for p in range(2,max_p+1):
        if b**p<=x:
            ans=max(ans,b**p)
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
 
m=int(math.log2(x))
a=[1+m-i for i in range(m)]
#print(m,a)
 
ans=1
for i in a:
  #print(i,math.pow(x,1/i),int(math.pow(x,1/i)),int(math.pow(x,1/i))**i)
  ans=max(ans,int(math.pow(x,1/i))**i)
 
print(ans)

Submission status: Wrong Answer

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

m=int(math.log2(x))
a=[1+1+m-i for i in range(m-1)]

ans=1
for i in a:
  ans=max(ans,int(math.pow(x,1/i))^i)

print(ans)

Submission status: Wrong Answer

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

m = 0
for i in range(33):
  for j in range(11):
    if i**j<=x:
      m = max(m,i**j)
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
"""AtCoder"""

X = int(input())

l = []

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

while X not in l:
    X -= 1

print(X)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
X=int(input())
dp=[False]*(X+1)
dp[1]=True
for p in range(2,int(1000**0.5)):
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Submission status: Wrong Answer

Solution code:
prime=[2,3,5,7,11,13,17,19,23,29,31]
X=int(input())
dp=[False]*(X+1)
dp[1]=True
for p in prime:
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Submission status: Wrong Answer

Solution code:
prime=[2,3,5,7,11,13,17,19,23,29,31]
X=int(input())
dp=[False]*(X+1)
for p in prime:
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
n = 1
p =2
res = 0
while (2**p<=x):
    while (n**p<=x):
        n += 1
    res = max(res,(n-1)**p)
    p += 1
    n = 1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
B = list(range(31, 0, -1))
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: Wrong Answer

Solution code:
def main(x):
    tmp = 0
    for i in range(1, 1001):
        for j in range(2, 11):
            if i ** j <= x and i ** j > tmp:
                tmp = i ** j
                break
    print(tmp)


if __name__ == '__main__':
    main(int(input()))

Submission status: Wrong Answer

Solution code:
def main(x):
    tmp = 0
    for i in range(1, 1001):
        for j in range(2, 11):
            if i ** j <= x and i ** j > tmp:
                tmp = i ** j
                break
        else:
            print(tmp)
            exit()
    print(tmp)


if __name__ == '__main__':
    main(int(input()))

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0
for i in range(2, 100):
    n = 2
    while i ** n <= x:
        ans = max(ans , i ** n)
        n += 1
            
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
i=0
while(1):
    i+=1
    if i*i>X:
        print((i-1)*(i-1))
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(max(s))