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
for i in range(1,40):
    for j in range(2,10):
        if X >= i**j:
            ans = i**j

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for i in range(1,40):
    if X >= i*i:
        ans = i*i

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
so = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
a = 0
for i in so:
    if i ** 2 <= X:
        a += 1

b = []
x = 1
for i in range(a):
    y = so[i]
    while y <= X:
        y *= so[i]
        
    

    y = y // so[i]
    b.append(y)

b = sorted(b, reverse = True)

if len(b) == 0:
    print(1)
else:
    print(b[0])

Submission status: Wrong Answer

Solution code:
X = int(input())
so = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
a = 0
for i in so:
    if i ** 2 <= X:
        a += 1

b = []
x = 1
for i in range(a):
    y = so[i]
    while y <= X:
        y *= so[i]
        
    

    y = y // so[i]
    b.append(y)

b = sorted(b, reverse = True)

if len(b) == 0:
    print(1)
else:
    print(b[0])

Submission status: Wrong Answer

Solution code:
X=int(input())
d=[1]
for i in range(2,1001):
  p=2
  while i**p<X:
    d.append(i**p)
    p+=1
  d=list(set(d))
print(max(d))

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 097
# B - Exponential

X=int(input())
# for i in range (X):
#     a= (X-i)**0.5
#     if a==int(a):
#         print(int(a)**2)
#         exit()

ans = 1
x=int(((X**0.5)//1)+1)

for i in range (x):
    a=i**2
    if a==a//1 and a > ans :
        ans=a
print(ans)

Submission status: Wrong Answer

Solution code:
# AtCoder Beginner Contest 097
# B - Exponential

X=int(input())
for i in range (X):
    a= (X-i)**0.5
    if a==int(a):
        print(int(a)**2)
        exit()

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

x = int(input())

for i in range(x,0,-1):
    for j in range(i,0,-1):
        if i == j * j:
            print(j*j)
            exit()

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

x = int(input())

for i in range(x,0,-1):
    for j in range(i,0,-1):
        if i // j == j:
            print(j*j)
            exit()

Submission status: Wrong Answer

Solution code:
from math import log,floor
X = int(input())
if X < 4:
  print(1)
else:
  answer = 0
  for b in range(2,X):
    p = log(X,b)
    if p > 2:
        p = floor(p)
        answer = max(answer,int(b**p))
  print(answer)

Submission status: Wrong Answer

Solution code:
from math import log,floor
X = int(input())
if X < 4:
  print(1)
else:
  answer = 0
  for b in range(2,X):
    if floor(log(X,b)) > 1:
        answer = max(answer,int(b**floor(log(X,b))))
  print(answer)

Submission status: Wrong Answer

Solution code:
from math import log,floor
X = int(input())
if X < 4:
  print(1)
else:
  answer = 0
  for b in range(2,X):
    answer = max(answer,int(b**floor(log(X,b))))
  print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
p = []
p.extend([i ** 2 for i in range(int(1000**(1/2)) + 1)])
p.extend([i ** 3 for i in range(int(1000**(1/3)) + 1)])
p.extend([i ** 5 for i in range(int(1000**(1/5)) + 1)])
p.extend([i ** 7 for i in range(int(1000**(1/7)) + 1)])
p.sort()
p.append(1001)
 
N = int(input())

for j in range(len(p) - 1):
  if p[j] <= N < p[j + 1]:
    print(p[j])

Submission status: Wrong Answer

Solution code:
p = []
p.extend([i ** 2 for i in range(int(1000**(1/2)) + 1)])
p.extend([i ** 3 for i in range(int(1000**(1/3)) + 1)])
p.extend([i ** 5 for i in range(int(1000**(1/5)) + 1)])
p.extend([i ** 7 for i in range(int(1000**(1/7)) + 1)])
p.sort()
p.append(1000)

N = int(input())

for i in range(len(p) - 1):
  if p[i] <= N < p[i + 1]:
    print(p[i])

Submission status: Wrong Answer

Solution code:
p = []
p.extend([i ** 2 for i in range(int(1000**(1/2)) + 1)])
p.extend([i ** 3 for i in range(int(1000**(1/3)) + 1)])
p.extend([i ** 5 for i in range(int(1000**(1/5)) + 1)])
p.extend([i ** 7 for i in range(int(1000**(1/7)) + 1)])
p.sort()
p.append(1000)
print(p)
N = int(input())

for i in range(len(p) - 1):
  if p[i] <= N < p[i + 1]:
    print(p[i])

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
ans = 1
for i in range(1,int(math.sqrt(x)+2)):
  for j in range(2,10):
    if i ** j <= x and i**j > ans:
      ans = i**j
    else:
      break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
ans = 1
for i in range(1,int(math.sqrt(x)+2)):
  for j in range(2,10):
    if i ** j <= x:
      ans = i**j
    else:
      break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = int(input())
i = 0
while i < 32:
    i += 1
    if i ** 2 > A:
        print((i-1)**2)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
import math
for i in range(x):
    flag=0
    X=x-i
    for j in range(2,X):
        if math.log(X,j)%1==0:
            flag=1
    if flag:
        print(X)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
for a in range(2, 33):
  for b in range(2, 10):
    if a**b > x:
      break
    ans = max(ans, a**b)
print(ans)

Submission status: Wrong Answer

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

y = 2
max_ans = 1

for i in range(1, x):
    z = 1
    while y < x:
        z += 1
        y = z * z
        if y <= x:
            max_ans = max(max_ans, y)
    
print(max_ans)

Submission status: Wrong Answer

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

y = 2
max_ans = 1

for i in range(1, x):
    z = 1
    while y < x:
        z += 1
        y = z * z
        if y < x:
            max_ans = max(max_ans, y)
    
print(max_ans)

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
def main():
  for i in range(X):
    primes = prime_factorize(X-i)
    if (len(set(primes)) == 1 and len(primes) != 1):
      print(X-i)
      return
  print(1)
main()

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
def main():
  for i in range(X):
    primes = prime_factorize(X-i)
    if (len(set(primes)) == 1 and len(primes) != 1):
      print(X-i)
      return

main()

Submission status: Wrong Answer

Solution code:
#素因数分解して列挙する関数、約数列挙ではない！
def factorize(n):
  b = 2
  fct = []
  while b * b <= n:
    while n % b == 0:
      n //= b
      fct.append(b)
    b = b + 1
  if n > 1:
    fct.append(n)
  f1 = len(fct)
  f2 = len(set(fct))
  return f1,f2

X = int(input())
for i in range(X,0,-1):
  f1,f2 = factorize(i)
  if (f1>1 and f2==1) or i==1:
    print(i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    X = ini()
    ans = 1
    for p in range(2, X):
        a = p * p
        while a < X:
            ans = max(ans, a)
            a *= p
    return ans


print(solve())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
ql = []

for i in range(1,32):
    for j in range(2,11):
        ql.append(i**j)
        #print(ql)
        if max(ql) > X: 
            print(ql[-2])
            exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(1,35):
  for k in range(1,10):
    if i**k <= N and i**k >= ans:
      ans = i**k
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())

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

res = 0
import math

for i in range(2,32):
    x = int(math.log(a,i))
    if x ==1:
        pass
    else:
        j = i**x
        res = max(res,j)
    
print(res)

Submission status: Wrong Answer

Solution code:
X = int(input())

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


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

for n in range(0, X):
    bigNum = X - n
    rv = prime_factorize(bigNum)
    
    syurui = len(rv)
    cnt = len(set(rv))
    
    if (cnt == 1 and syurui > 1):
        print(bigNum)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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


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

for n in range(0, X):
    bigNum = X - n

    rv = prime_factorize(bigNum)
    
    syurui = len(rv)
    cnt = len(set(prime_factorize(bigNum)))
    
    if (cnt == 1 and syurui > 1):
        print(bigNum)
        exit()

Submission status: Wrong Answer

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

def IsBekijo(x):
    for i in range(2,math.ceil(math.sqrt(x)) + 1):
        if x % i == 0:
            d = x // i
            while d != 1:
                if d % i == 0:
                    d //=  i
                else:
                    break
            if d == 1:
                return True
    return False



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

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
l=[1]
for i in range(2,int(math.sqrt(x))+1):
  p=i
  while 1:
    p*=i
    if p<=x:
      l.append(p)
    else:
      break
print(l[-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

lst = [i**2 for i in range(35,0,-1)]
for i in lst:
    if i <= x:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
if X <=3:
    print(1)
    exit()
for i in range(X+1):
    for j in range(X+1):
        M = i**j
        if M > X:
            if j == 2:
                break
            S.append(i**(j-1))
            break
        elif M == X:
            exit()
print(S)
print(max(S))

Submission status: Wrong Answer

Solution code:
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
if X <=3:
    print(1)
    exit()
for i in range(X):
    for j in range(X):

        M = i**j
        if M > X:
            if j == 2:
                break
            S.append(max(i**(j-1),(i-1)**(j)))
            break
        elif M == X:
            exit()
print(max(S))

Submission status: Wrong Answer

Solution code:
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
if X <=3:
    print(1)
    exit()
for i in range(X):
    for j in range(X):

        M = i**j
        if M > X:
            if j == 2:
                break
            S.append(i**(j-1))
            break
        elif M == X:
            exit()
print(max(S))

Submission status: Wrong Answer

Solution code:
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
if X <=3:
    print(1)
    exit()
for i in range(X):
    for j in range(X):
        M = i**j
        if M > X:
            if j == 2:
                break
            S.append(i**(j-1))
            break
        elif M == X:
            exit()
print(max(S))

Submission status: Wrong Answer

Solution code:
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
for i in range(X):
    for j in range(X):
        M = i**j
        if M > X:
            if j == 2:
                break
            S.append(i**(j-1))
            break
        elif M == X:
            exit()   
print(max(S))

Submission status: Wrong Answer

Solution code:
# ABC097 B - Exponential

X = int(input())
j=1
S=[]
for i in range(X):
    for j in range(X):
        M = i**j
        if M > X:
            S.append(i**(j-1))
            break
        elif M == X:
            exit()
            
print(max(S))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def f(N):
  for i in range(N):
    for j in range(N):
    	if (e := pow(i, j)) <= N:
          yield e
n = int(input())
print(max(f(n)))

Submission status: Wrong Answer

Solution code:
def f(N):
  for i in range(int(N**0.5)+1):
    if i * i <= N:
      yield i * i
n = int(input())
print(max(f(n)))

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0

for i in range(2, 32):
    for j in range(2, 11):
        exp = i**j
        if exp <= X:
            ans = max(ans, exp)
        else:
            break
            
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
b=[False for i in range(x)]
for i in range(1,x+1):
    for j in range(2,x+1):
        if i**j<=x:
            b[i**j-1]=True
        else:
            break
for i in range(len(b),0,-1):
    if b[i-1]==True:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = int(read())
print(int(x**0.5)**2)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
ans = 0
mx = 0
for b in range(1, int(math.sqrt(x))+1) :
    if b == 1 :
        mx = 1
        continue
    p = 1
    while b ** p < x :
        mx = max(b**p, mx)
        p += 1
print(mx)

Submission status: Wrong Answer

Solution code:
X = int(input())

lst = []
for i in range(1,101):
    for j in range(2,11):
        if i**j > 1000:
            break
        else:
            lst.append(i**j)

print(sorted(lst))

for k in range(X):
    if X - k in lst:
        print(X-k)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

lst = []
for i in range(1,101):
    for j in range(2,11):
        if i**j >= 1000:
            break
        else:
            lst.append(i**j)

for k in range(X):
    if X - k in lst:
        print(X-k)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

lst = []
for i in range(100):
    for j in range(2,10):
        if i**j >= 1000:
            break
        else:
            lst.append(i**j)

for k in range(X):
    if X - k in lst:
        print(X-k)
        break

Submission status: Wrong Answer

Solution code:
X=int(input())
ans=0
for i in range(1000):
    if i*i<=X:ans=i
    else:break
print(ans**2)

Submission status: Wrong Answer

Solution code:
X = int(input())

lst = []
for i in range(100):
    for j in range(10):
        if i**j >= 1000:
            break
        else:
            lst.append(i**j)

for k in range(X):
    if X - k in lst:
        print(X-k)
        break

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-1)**2)

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    ans = 1
    for b in range(1,X+1):
        for p in range(2,10):
            a = b**p
            if a > X:
                break
            elif ans < a and a < X:
                ans = a
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for n in range(2,1000):
  ans = max(ans,int(X**(1/n))**n)
  
print(ans)

Submission status: Wrong Answer

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

for n in range(2,100):
  ans = max(ans,int(X**(1/n))**n)
  
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

sq_x = int(x ** 0.5)
ans = 0
for i in range(2, sq_x + 1):
    t = i
    while t <= x:
        ans = max(ans, t)
        t *= i

print(ans)

Submission status: Wrong Answer

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

sq_x = int(x ** 0.5)

ans = 0
for i in range(2, sq_x + 1):
    t = i
    while True:
        t *= i
        if t > x:
            break
        ans = max(ans, t)

print(ans)

Submission status: Wrong Answer

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

sq_x = int(x ** 0.5)

ans = 0
for i in range(2, sq_x + 1):
    t = i ** i
    while True:
        t *= i
        if t > x:
            break
        ans = max(ans, t)

print(ans)

Submission status: Wrong Answer

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

sq_x = int(x ** 0.5)

ans = 0
for i in range(2, sq_x + 1):
    p = int(math.log(x, i))
    ans = max(ans, i ** p)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def main():
  x = int(input())
  sum=0
  if x==0 or x==1:
    sum=x
  else:
    for i in range(2,int(math.sqrt(x))+1):
      j=2
      while True:
        if pow(i,j)>sum and pow(i,j)<=x:
          sum=pow(i,j)
        else:
          break
        j+=1
  print(sum)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = int(input())
ans = 1

n = 2

while n < 5:
    c = 1
    while x >= c**n:
        ans = max(ans,c**n)
        c += 1
    n += 1
print(ans)

Submission status: Wrong Answer

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

x = int(input())
ans = 1

n = 2

while True:
    if x**(1 / n) < 2:
        break
    ans = max(math.floor(x**(1 / n))**n, ans)
    n += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
x = int(input())
ans = 1

n = 2

while True:
    if x**(1 / n) < 2:
        break
    ans = max(int(x**(1 / n)) ** n, ans)
    n += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
import sys
input = sys.stdin.readline

X = int(input())
ans = 0
for i in itertools.count(2):
    b = int(X**(1/i))
    # print(b)
    ans = max(ans, b**i)
    if b == 1:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
import sys
input = sys.stdin.readline

X = int(input())
ans = 0
for i in itertools.count(2):
    b = int(X**(1/i))
    ans = max(ans, b**i)
    if b == 1:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    x = int(input())
    ans = 0
    for i in range(1, x + 1):
        for j in range(2, 11):
            if i ** j <= x:
                ans = i ** j
            else:
                break
    print(ans)

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

a aa c ca c a b a ab a b c

"""

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    x = int(input())
    ans = 1
    for i in range(1, x + 1):
        for j in range(2, 15):
            if i ** j <= x:
                ans = i ** j
            else:
                break
    print(ans)

t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

a aa c ca c a b a ab a b c

"""

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    x = int(input())
    ans = 1
    for i in range(1, x + 1):
        if i * i <= x:
            ans = i * i
    print(ans)


t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

a aa c ca c a b a ab a b c

"""

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 1
for i in range(2, x):
    n = 1
    while n < x / i:
        n *= i
    ans = max(ans, n)
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 1
for i in range(2, int(x ** 0.5) + 1):
    n = 1
    while n < x / i:
        n = n * i
    ans = max(ans, n)
print(ans)

Submission status: Wrong Answer

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

def solve(x):
    if x == 1:
        return 1
    f = 2
    l = [1]
    while f * f <= x:
        d = f
        while d <= x:
            l.append(d)
            d *= d
        f += 1
    return max(l)



def main():
    X = int(input())
    print(solve(X))
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = k()
if N == 1:
    print(1)
    sys.exit()

for i in range(N-1,-1,-1):
    for j in range(N):
        if j**2 == i:
            print(i)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 1:
  print("1")
  exit()
  
ans = 0
for b in range(2,int(x**(1/2)+1)):
  for p in range(2,1000):
    tmp = pow(b,p)
    if tmp<=x:
      ans = max(ans,pow(b,p))
      break
      
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 1:
  print("1")
  exit()
  
ans = 0
for b in range(2,x):
  for p in range(2,1000):
    tmp = pow(b,p)
    if tmp<=x:
      ans = max(ans,pow(b,p))
      break
      
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ans = 0

for i in range(1,math.ceil(math.sqrt(n))):
    for j in range(2,11):
        if i ** j > n and j > 2:
            ans = max(ans,i ** (j-1))
            break

print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
ma=1
for i in range(2,x):
  ex=i**3
  for j in range(x):
    if ex>x:
      if ex>ma and ex//i<=x:
        ma=ex//i
      break
    ex=ex*i
print(ma)

Submission status: Wrong Answer

Solution code:
x=int(input())
ma=1
for i in range(1,x):
  ex=i
  for j in range(2,x):
    ex=ex*i
    if ex>x:
      if ex//i>ma:
        ma=ex//i
      break
print(ma)

Submission status: Wrong Answer

Solution code:
x=int(input())
ma=1
for i in range(x):
  ex=1
  for j in range(x):
    ex=ex*i
    if ex>x:
      if ex//i>ma:
        ma=ex//i
      break
print(ma)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
M = 0
def judge(a):
  return (math.floor(X**(1/a)))**a
for a in range(2, 11):
  M = max(M, judge(a))
print(M)

Submission status: Wrong Answer

Solution code:
X = int(input())

max_num = 0
for i in range(1, X + 1):
    for j in range(2, X + 1):
        num = i ** j
        if num <= X:
            if num > max_num:
                max_num = num
        else:
            break

print(max_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
p=[]
p.append(1)
for i in range(2,1000):
  for j in range(1,10):
    p.append(pow(i,j))
p.sort()
ans=0
for i in range(len(p)):
  if p[i]>X:
    break
  ans=p[i]
print(ans)

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 = 1
for i in range(1,x):
    tmp = prime_factorize(i)
    if len(tmp) > 1 and len(set(tmp)) == 1:
        a = tmp[0] ** len(tmp)
        ans = max(ans, a)
        
print(ans)

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 = 1
for i in range(1,x+1):
    tmp = prime_factorize(i)
    if len(tmp) > 1 and len(set(tmp)) == 1:
        a = tmp[0] ** len(tmp)
        ans = max(ans, a)
        
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

i = 1
while x > i**2:
    i += 1

if x == i**1:
    print(i**2)
else:
    print((i-1)**2)