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())
limit = int(X ** 0.5)
ans = -1
prob_ans = []

if X == 1:
    ans = 1
for i in range(2, limit+1):
    p = 1
    while True:
        i = i ** p
        if i > X:
            break
        ans = max(ans, i)
        p += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import bisect,collections,copy,itertools,math,numpy,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
X = I()
print(int(X**0.5)**2)

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:
s = int(input())

snooker =[0]*1000

for p in range (1, 100):
	for q in range (1, 10):
		if p**q<=10000:
			snooker[10*(p-1)+q-1]=p**q

snooker = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 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, 1024, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849, 1936, 2025, 2116, 2187, 2197, 2209, 2304, 2401, 2500, 2601, 2704, 2744, 2809, 2916, 3025, 3125, 3136, 3249, 3364, 3375, 3481, 3600, 3721, 3844, 3969, 4096, 4225, 4356, 4489, 4624, 4761, 4900, 4913, 5041, 5184, 5329, 5476, 5625, 5776, 5832, 5929, 6084, 6241, 6400, 6561, 6724, 6859, 6889, 7056, 7225, 7396, 7569, 7744, 7776, 7921, 8000, 8100, 8281, 8464, 8649, 8836, 9025, 9216, 9261, 9409, 9604, 9801,10000]
slist = [0]*210

for i in range (0, 210):
	if snooker[i]<=s:
		slist[i]=snooker[i]
      
print(max(slist))

Submission status: Wrong Answer

Solution code:
s = int(input())

snooker =[0]*1000

for p in range (1, 100):
	for q in range (1, 10):
		if p**q<=10000:
			snooker[10*(p-1)+q-1]=p**q

snooker = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 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, 1024, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849, 1936, 2025, 2116, 2187, 2197, 2209, 2304, 2401, 2500, 2601, 2704, 2744, 2809, 2916, 3025, 3125, 3136, 3249, 3364, 3375, 3481, 3600, 3721, 3844, 3969, 4096, 4225, 4356, 4489, 4624, 4761, 4900, 4913, 5041, 5184, 5329, 5476, 5625, 5776, 5832, 5929, 6084, 6241, 6400, 6561, 6724, 6859, 6889, 7056, 7225, 7396, 7569, 7744, 7776, 7921, 8000, 8100, 8281, 8464, 8649, 8836, 9025, 9216, 9261, 9409, 9604, 9801]
slist = [0]*209

for i in range (0, 209):
	if snooker[i]<=s:
		slist[i]=snooker[i]
      
print(max(slist))

Submission status: Wrong Answer

Solution code:
x=int(input())
print(max(int(x**0.5)**2,int(x**0.33)**3))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
p2 = [i ** 2 for i in range(1, 32)]
p3 = [k ** 3 for k in range(1, 10)]
p2_3 = p2 + p3
l = list(set(p2_3))

if x in l:
    l.append(x)
    l.sort()
    print(l[l.index(x)])
else:
    l.append(x)
    l.sort()
    print(l[l.index(x)-1])

Submission status: Wrong Answer

Solution code:
from math import sqrt
from math import floor
from math import log
x=int(input())
ans=[1]
for i in range(floor(sqrt(x)),1,-1):
    l=floor(log(x,i))
    ans.append(i**l)
print(max(ans))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x=ii()

ans=1

for i in range(1,x+1):
    if i*i<=x:
        ans=max(ans,i*i)
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr
for x in range(X, 0, -1):
    fact = factorization(x)
    if len(fact) == 1 and fact[0][1] >= 2:
        # print(fact)
        print(x)
        break
    elif x == 1:
        print(x)

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr
for x in range(X, 0, -1):
    fact = factorization(x)
    if len(fact) == 1 and fact[0][0] != x:
        # print(fact)
        break

print(x)

Submission status: Wrong Answer

Solution code:
x=int(input())
k=[]
for i in range(1,32):
    if abs(x-i**2)<=min(abs(x-i**3),abs(x-i**7)):
        if i**2<=x:
            k.append([abs(x-i**2),i**2])
    elif abs(x-i**3)<=min(abs(x-i**2),abs(x-i**7)):
        if i**3<=x:
            k.append([abs(x-i**3),i**3])
    elif abs(x-i**7)<=min(abs(x-i**3),abs(x-i**2)):
        if i**7<=x:
            k.append([abs(x-i**7),i**7])
k.sort()
print(k[0][1])

Submission status: Wrong Answer

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

# 素因数分解して要素数が 1 であれば終了
def f():
    for ans in range(X, 0, -1):
        x = ans
        # print(x)
        div = 2
        if x < div: return 1
        while x % div != 0:
            div += 1
        ctr = 0
        # print(div)
        while x > 1:
            if x % div != 0: break
            x //= div
            ctr += 1
        if x == 1 and ctr > 1:
            return ans

print(f())

Submission status: Wrong Answer

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

def f():
    for x in range(X, 0, -1):
        for p in range(X, 1, -1):
            if x ** (1 / p) == int(x ** (1 / p)):
                return x
    return 1

print(f())

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 1
n = 1

while True:
    if n*n > x:
        break
    else:
        ans = n**2
        n += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0

for i in reversed(range(X+1)):
  num = int(math.sqrt(i))
  if num ** 2 == i and ans <= i:
    ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0

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

for i in reversed(range(X)):
  num = int(math.sqrt(i))
  if num ** 2 == i and ans < i:
    ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0

for i in reversed(range(X)):
  num = int(math.sqrt(i))
  if num ** 2 == i and ans < i:
    ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
m=0
for i in range(1,N-1):
  for j in range(2,N-2):
    if (i**j)<=N:
      if (i**j)>m:
        m=i**j
    else:
      break
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

li = []
for x in range(2,11):
  li += [ i**x for i in range(1,int(1000**(1/x)//1)+1)]
ans_list = sorted(list(set(li)), reverse=True)
print(ans_list)

for x in ans_list:
  if x <=X:
    print(x)
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

li = []
for x in range(2,10):
  li += [ i**x for i in range(1,int(1000**(1/x)//1)+1)]
ans_list = sorted(list(set(li)), reverse=True)

for x in ans_list:
  if x <=X:
    print(x)
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 1
for i in range(2, X + 1):
    p = 2
    while i ** p <= X:
        ans = max(1, i ** p)
        p += 1
        #ans = max(1, i ** p)

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 1
for i in range(2, X + 1):
    p = 2
    while i ** p < X:
        ans = max(1, i ** p)
        p += 1

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
l1 = [1]
l2 = list(2**i for i in range(2,11))
l3 = list(3**i for i in range(2,7))
l4 = list(4**i for i in range(2,6))
l5 = list(5**i for i in range(2,5))
l6 = list(6**i for i in range(2,5))
l7 = list(7**i for i in range(2,5))
l8 = list(8**i for i in range(2,5))
l9 = list(9**i for i in range(2,5))
l10 =list(10**i for i in range(2,4))
l11 = list(i**2 for i in range(11,34))
l1 = list(set(l1+l2+l3+l4+l5+l6+l7+l8+l9+l10+l11))
l1.append(x)
l1.sort()
a = l1.index(x)-1
print(l1[a])

Submission status: Wrong Answer

Solution code:
from math import sqrt
x = int(input())
cnt = 0
l = []
for i in range(1, x + 1):
    for j in range(1, int(sqrt(i)) +1):
        for k in range(2, max(2, j) + 1):
            if j ** k == i:
                l.append(i)
print(max(l))

Submission status: Wrong Answer

Solution code:
from math import sqrt
x = int(input())
cnt = 0
l = []
for i in range(1, x + 1):
    for j in range(1, int(sqrt(i)) +1):
        if j ** 2 == i:
            l.append(i)
print(max(l))

Submission status: Wrong Answer

Solution code:
X=int(input())
l=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961]
for i in range(len(l)):
    if X<l[i]:
        print(l[i-1])
        exit()
print(l[-1])

Submission status: Wrong Answer

Solution code:
X=int(input())
l=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961]
for i in range(len(l)):
    if X<l[i]:
        print(l[i-1])
        exit()

Submission status: Wrong Answer

Solution code:
X=int(input())
l=[1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961]
for i in range(len(l)):
    if X>l[i]:
        print(l[i-1])
        exit()

Submission status: Wrong Answer

Solution code:
X=int(input())
a=0
while True:
    #print(a**2)
    if a**2>X:
        print((a-1)**2)
        exit()
    a+=1

Submission status: Wrong Answer

Solution code:
pow = [1]
for p in range(2,32):
  i=1
  while p**i<=1000:
    pow.append(p**i)
    i += 1
#print(pow)
X = int(input())
x = X
while x>0:
  if x in pow:
    ans = x
    break
  x -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
pow = [1]
for p in range(2,32):
  i=1
  while p**i<=1000:
    pow.append(p**i)
    i += 1
print(pow)
X = int(input())
x = X
while x>0:
  if x in pow:
    ans = x
    break
  x -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
prime = [2,3,5,7,11,13,17,19,23,29,31]
pow = [1]
for p in prime:
  i=1
  while p**i<=1000:
    pow.append(p**i)
    i += 1
X = int(input())
x = X
while x>0:
  if x in pow:
    ans = x
    break
  x -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1
prime = []
for i in range(1,1001):
  if is_prime(i):
    prime.append(i)
pow = [1]
for p in prime:
  i=1
  while p**i<=1000:
    pow.append(p**i)
    i += 1
X = int(input())
x = X
while x>0:
  if x in pow:
    ans = x
    break
  x -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
#0.5乗の数字の場合
a = int(x**0.5)
for i in range(x): 
  for t in range(2,10):
    print(t)
    for b in range(a,1,-1):
      print(b)
      if x/(t**b)==0:
        print(t**b)
        break
  x -=1
  print(x)

Submission status: Wrong Answer

Solution code:
from math import pow
l = []
l.append(2 ** 2)
l.append(2 ** 3)
l.append(2 ** 4)
l.append(2 ** 5)
l.append(2 ** 6)
l.append(2 ** 7)
l.append(2 ** 8)
l.append(2 ** 9)
l.append(3 ** 2)
l.append(3 ** 3)
l.append(3 ** 4)
l.append(3 ** 5)
l.append(5 ** 2)
l.append(5 ** 3)
l.append(5 ** 4)
l.append(6 ** 2)
l.append(6 ** 3)
l.append(7 ** 2)
l.append(7 ** 3)
l.append(10 ** 2)
l.append(10 ** 3)
for i in range(11, 32):
    l.append(i ** 2)
def print_exponential(integer):
    while integer > 0:
        if integer in l:
            break
        else:
            integer -= 1
    print(integer)
X = int(input())
print_exponential(X)

Submission status: Wrong Answer

Solution code:
from math import pow
def print_exponential(integer):
    while integer > 0:
        a = pow(integer, 1.0/2.0)
        b = pow(integer, 1.0/3.0)
        c = pow(integer, 1.0/4.0)
        d = pow(integer, 1.0/5.0)
        e = pow(integer, 1.0/6.0)
        f = pow(integer, 1.0/7.0)
        g = pow(integer, 1.0/8.0)
        h = pow(integer, 1.0/9.0)
        if a.is_integer() == True:
            break
        elif b.is_integer() == True:
            break
        elif c.is_integer() == True:
            break
        elif d.is_integer() == True:
            break
        elif e.is_integer() == True:
            break
        elif f.is_integer() == True:
            break
        elif g.is_integer() == True:
            break
        elif h.is_integer() == True:
            break
        else:
            integer -= 1
    return integer
X = int(input())
print(print_exponential(X))

Submission status: Wrong Answer

Solution code:
def print_exponential(integer):
    while integer > 0:
        a = integer ** 0.5
        if a.is_integer() == True:
            break
        else:
            integer -= 1
    return integer
X = int(input())
print(print_exponential(X))

Submission status: Wrong Answer

Solution code:
def print_exponential(integer):
    while integer > 0:
        a = integer ** 0.5
        if a.is_integer() == True:
            break
        else:
            integer -= 1
    return integer
X = int(input())
print_exponential(X)

Submission status: Wrong Answer

Solution code:
import numpy as np
X = int(input())
while X > 0:
    a = np.sqrt(X)
    if a.is_integer() == True:
        break
    else:
        X -= 1
print(X)

Submission status: Wrong Answer

Solution code:
X = int(input())
while X > 0:
    a = X ** 0.5
    if a.is_integer() == True:
        break
    else:
        X -= 1
print(X)

Submission status: Wrong Answer

Solution code:
x = int(input())
res = 1
for b in range(2, int(pow(1000, 1/2))+1):
    flag = True
    p = 2
    while b**p <= x and flag:
        p += 1
        flag = False
    if not flag: res = max(res, b**(p-1))
print(res)

Submission status: Wrong Answer

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

i= 1
ans = i*i
while i*i <= x:
    i += 1

print((i-1)*(i-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
while(1):
    for i in range(2,11):
        f = pow(X,1.0/float(i))
        if(1-f%1<=(-10)**8):
            print(X)
            exit()
    X-=1

Submission status: Wrong Answer

Solution code:
X = int(input())
while(1):
    for i in range(2,11):
        f = pow(X,1.0/float(i))
        if(f.is_integer()):
            print(X)
            exit()
    X-=1

Submission status: Wrong Answer

Solution code:
X = int(input())
while(1):
    for i in range(2,10):
        f = pow(X,1.0/float(i))
        if(f.is_integer()):
            print(X)
            exit()
    X-=1

Submission status: Wrong Answer

Solution code:
X = int(input())
while(1):
    for i in range(2,10):
        if(pow(X,1.0/float(i))%1.0==0.0):
            print(X)
            exit()
    X-=1

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
while(1):
    for i in range(2,10):
        if(pow(X,1.0/float(i))%1.0==0):
            print(X)
            exit()
    X-=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
y = 0
if x==1 or x==2 or x==3:
    print(1)
    exit()
else:
    for a in range(2,(x+1)):
        for b in range (2,10):
            if b==2 and a**b>x:
                print(y)
                exit()
            elif a**b<x:
                y=max(a**b,y)

Submission status: Wrong Answer

Solution code:
x = int(input())
y = 0
if x==1:
    print(1)
else:
    for a in range(2,(x+1)):
        for b in range (2,10):
            if b==2 and a**b>x:
                print(y)
            elif a**b<x:
                y=max(a**b,y)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
if x == 1 or x == 2 or x == 3:
  print(1)
  exit()
  
for i in range(2,33):
  for k in range(2,10):
    if k == 2 and i**k > x:
      print(ans)
      exit()
    elif i**k < x:
      ans = max(i**k,ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
if x == 1 or x == 2 or x == 3:
  print(1)
  exit()
  
for i in range(2,33):
  for k in range(2,9):
    if k == 2 and i**k > x:
      print(ans)
      exit()
    elif i**k < x:
      ans = max(i**k,ans)

Submission status: Wrong Answer

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

for i in range(1,100):
  for j in range(1,20):
    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(100):
  for j in range(20):
    if i**j<=X:
      ans=max(ans,i**j)
      
print(ans)

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:
import math
print(math.floor(math.sqrt(int(input())))**2)

Submission status: Wrong Answer

Solution code:

x = int(input())
ans = int(x ** 0.5)
print(ans **2)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a=0
if n > 1:
  a = n//2
else:
  a = n
while True:
  if a**2 <= n:
    print(a**2)
    break
  a -= 1

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n//2
while True:
  if a**2 <= n:
    print(a**2)
    break
  a -= 1

Submission status: Wrong Answer

Solution code:
X = int(input())
Y = X
A = 0
while X % 2 == 0:
  A += 1
  X = X // 2
print(max(int(Y**0.5)**2,2**A))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
numbers=[]
for a in range(1,1001):
    if (a**0.5).is_integer():
        numbers.append(a)
    elif (a**(1/3)).is_integer():
        numbers.append(a)
    elif (a**(0.2)).is_integer():
        numbers.append(a)
    elif (a**(1/7)).is_integer():
        numbers.append(a)
answer=[a for a in numbers if a<=X]
print(round(max(answer)))

Submission status: Wrong Answer

Solution code:
X=int(input())
numbers=[]
for a in range(1,1001):
    if (a**0.5).is_integer():
        numbers.append(a)
    elif (a**(1/3)).is_integer():
        numbers.append(a)
    elif (a**(0.2)).is_integer():
        numbers.append(a)
    elif (a**(1/7)).is_integer():
        numbers.append(a)
answer=[a for a in numbers if a<=X]
print(round(max(answer)))
print(27**(1/3))

Submission status: Wrong Answer

Solution code:
X=int(input())
numbers=[]
for a in range(1,1001):
    if (a**0.5).is_integer():
        numbers.append(a)
    elif (a**(1/3)).is_integer():
        numbers.append(a)
    elif (a**(0.2)).is_integer():
        numbers.append(a)
    elif (a**(1/7)).is_integer():
        numbers.append(a)
answer=[a for a in numbers if a<=X]
print(max(answer))

Submission status: Wrong Answer

Solution code:
X=int(input())
numbers=[]
for a in range(1,1001):
    if (a**0.5).is_integer():
        numbers.append(a)
answer=[a for a in numbers if a<=X]
print(max(answer))

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    ret = 0
    for b in range(1, N):
        for p in range(2, N):
            if b ** p <= N:
                ret = max(ret, b ** p)

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    ret = 0
    for b in range(1, N):
        for p in range(2, N):
            if b ** p <= N:
                ret = b ** p

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())
    ret = 0
    for b in range(N):
        for p in range(N):
            if b ** p <= N:
                ret = b ** p

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1, X+1)[::-1]:
  if sqrt(i).is_integer():
    ans = i
    break

print(ans)

Submission status: Wrong Answer

Solution code:
k = []
for i in range(1,40):
  for j in range(2,30):
    if i**j <= 1000:
      k.append(i**j)
L = set(k)
P = list(L)
P.sort()
X = int(input())
ans = 0
for i in range(len(P)):
  if X<P[i]:
    print(ans)
    break
  else:
    ans = P[i]

Submission status: Wrong Answer

Solution code:
X = int(input())
upper = int(X**0.5//1)+1
max = 0
for x in range(1,upper):
  for i in range(9):
    if max < x**(i+1) < X:
      max = x ** (i+1)
print(max)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
if X <= 3:
  print(1)
else:
  ans = 0
  for i in range(2,int(X**0.5)+1):
    p = int(math.log(X,i))
    if p <= 1:
      continue
    ans = max(i**p,ans)
  print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

def han(n, k):
  if int(n**(1/k)) == n**(1/k):
    return True
  else:
    return False
  
while 1:
  if X == 1000:
    print(X)
  elif han(X, 2) or han(X, 3) or han(X, 5) or han(X, 7) or han(X, 4) or han(X, 6) or han(X, 8) or han(X, 9) or han(X, 10):
    print(X)
    break
  X -= 1

Submission status: Wrong Answer

Solution code:
X = int(input())

def han(n, k):
  if int(n**(1/k)) == n**(1/k):
    return True
  else:
    return False
  
while 1:
  if han(X, 2) or han(X, 3) or han(X, 5) or han(X, 7) or han(X, 4) or han(X, 6) or han(X, 8) or han(X, 9) or han(X, 10) or han(X, 11) or han(X, 12) or han(X, 13):
    print(X)
    break
  X -= 1

Submission status: Wrong Answer

Solution code:
X = int(input())

def han(n, k):
  if int(n**(1/k)) == n**(1/k):
    return True
  else:
    return False
  
while 1:
  if han(X, 2) or han(X, 3) or han(X, 5) or han(X, 7) or han(X, 4) or han(X, 6) or han(X, 8) or han(X, 9) or han(X, 10):
    print(X)
    break
  X -= 1

Submission status: Wrong Answer

Solution code:
X = int(input())

def han(n, k):
  if int(n**(1/k)) == n**(1/k):
    return True
  else:
    return False
  

while 1:
  if han(X, 2) or han(X, 3) or han(X, 5) or han(X, 7):
    print(X)
    break
  X -= 1

Submission status: Wrong Answer

Solution code:
X = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
ans = 0

if X != 1:
  while 1:
    if prime_factorize(X)[0] == prime_factorize(X)[-1] and len(prime_factorize(X)) != 1 :
      ans = X
      break
    X -= 1
  
if ans == 0:
  ans = 1
  
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())



while 1:
  if X**0.5 == int(X**0.5):
    print(X)
    break
  X -= 1

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

expo = []
for i in range(1,10):
    if i == 1:
        expo.append(i)
    else:
        for j in range(2,1000):
            tmp = i**j
            if tmp > N:
                break
            expo.append(tmp)
expo.sort()

expo = np.array(expo)

print(max(expo[expo<=N]))

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(1,100):
    tmp = i**2
    if tmp>N:
        print((i-1)**2)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

l = []
for i in range(1,33):
    for y in range(2,33):
        if i ** y <= x:
            l.append(i**y)
        else:
            break
print(l[-1])

Submission status: Wrong Answer

Solution code:
print(int(int(input())**0.25))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#abc097 b bekijousu
import math

def large_num(n):
    xx=x/n
    p=1
    while xx-n**p>0:
        p+=1
    if p==1:
        return 0
    else:
        return n**p

x=int(input())
b_last=int(math.sqrt(1000))
num=[i for i in range(2,b_last+2)]

ans=0


if 4>x:
    ans=1
else:
    for i in num:
        ans=max(large_num(i),ans)
print(ans)

Submission status: Wrong Answer

Solution code:
#abc097 b bekijousu
import math

def large_num(n):
    xx=x/n
    p=1
    while xx-n**p>0:
        p+=1
    if p==1:
        return 0
    else:
        return n**p

x=int(input())
b_last=int(math.sqrt(1000))
num=[i for i in range(2,b_last+1)]

ans=0


if 4>x:
    ans=1
else:
    for i in num:
        ans=max(large_num(i),ans)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

ans = 1

i = 2

while i**2 <= n:
    u = 2
    while i**u <= n:
        ans = i**u
        u += 1
    i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#ABC097
import math
x = int(input())
l = [1]
for i in range(int(math.sqrt(x))+1):
    j = 1
    for j in range(100):
        if i ** j > x:
            l.append(i ** (j-1))
            break
            
print(l[-1])

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = []
for i in range(40):
    for j in range(20):
        A.append(i**j)

A = sorted(A)
ans = 0
for i in A:
    if i <= n:
        ans = i
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

n=int(input())

if n<=3:
    print(1)
    exit()

ans=0
for i in range(1,n+1):
    f=factorization(i)   
    if len(f)==1 and f[0][1]>=2:
        ans=max(ans,i)
print(ans)

Submission status: Wrong Answer

Solution code:
beki = [i**2 for i in range(1,100) if i**2<=1000]

x=int(input())
for i in range(len(beki)):
    if beki[i]>x:
        print(beki[max(i-1,0)])
        exit()
    elif beki[i]==x:
        print(beki[i])
        exit()
print(beki[-1])