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())
a=[]
for j in range(1,10):
	a.append(2**j)
a.sort()
import bisect
k=bisect.bisect_right(a,x)
print(a[k-1])

Submission status: Wrong Answer

Solution code:
ans_list = [1]
for i in range(2, 10):
    ans_list.append(2 ** i)
for i in range(2, 7):
    ans_list.append(3 ** i)
for i in range(2, 5):
    ans_list.append(5 ** i)
for i in range(2, 4):
    ans_list.append(7 ** i)
num = [11, 13, 17, 19, 23, 29, 31]
for i in num:
    ans_list.append(i ** 2)
X = int(input())
for i in range(X, 0, -1):
    if i in ans_list:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
x  = int(input())
a = [i**2 for i in range(1,1000)]
ans = 0
for i in a:
  if i >= x:
    ans = i
    break
    
    
print(a[a.index(ans)-1])

Submission status: Wrong Answer

Solution code:
x  = int(input())
a = [i**2 for i in range(1,1000)]
ans = 0
for i in a:
  if i > x:
    ans = i
    break
    
    
print(a[a.index(ans)-1])

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = []
for j in range(11):
    l = [i**j for i in range(1,32) if i**j <= n]
    ans = ans + l
print(max(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [i**2 for i in range(32) if i**2 <= n]
print(l[-1])

Submission status: Wrong Answer

Solution code:
x=int(input())

flag=True
for n in range(35):
    if flag and n**2>x:
        print((n-1)**2)
        flag=False

Submission status: Wrong Answer

Solution code:
x=int(input())

flag=True
for n in range(x):
    if flag and n**2>x:
        print((n-1)**2)
        flag=False 
if x==1:
    print(1)

Submission status: Wrong Answer

Solution code:
X = int(input())
beki = [i**2 for i in range(1, X+1) if i**2 <= X]
print(beki[-1])

Submission status: Wrong Answer

Solution code:
def isqrt(n):
    x = n
    y = (x + 1) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x

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

    answer = -1
    for i in range(isqrt(X)+1):
        if i**2 <= X:
            answer = max(answer,i**2)

    print(answer)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
#a = int(input())
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()

for i in range(x,0,-1):
  for j in range(2,10):
    tmp = pow(i,1/j)
    if math.ceil(tmp) == math.floor(tmp):
      print(i)
      quit()
print("1")

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
#a = int(input())
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()

for i in range(x,0,-1):
  for j in range(2,10):
    tmp = pow(i,1/j)
    if math.ceil(tmp) == math.floor(tmp):
      print(i)
      quit()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
#a = int(input())
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()

for i in range(x,0,-1):
  for j in range(2,11):
    tmp = pow(i,1/j)
    if math.ceil(tmp) == math.floor(tmp):
      print(i)
      quit()
print("1")

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
#a = int(input())
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()

for i in range(x,0,-1):
  for j in range(2,11):
    tmp = pow(i,1/j)
    if math.ceil(tmp) == math.floor(tmp):
      print(i)
      quit()

Submission status: Wrong Answer

Solution code:
#ABC 97, B - exponential

def compute():
    x = int(input())
    if x == 1:
        print(1)
    else:
        for b in range(31, 1, -1):
            for p in range(9, 1, -1):
                y = b**p
                if y <= x:
                    print(y)
                    return
compute()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ABC 97, B - exponential

def compute():

    x = int(input())
    for y in range(x-1, 0, -1):
        for i in range(2, 11):
            if y**(1/i) == int(y**(1/i)):
                print(y)
                return
compute()

Submission status: Wrong Answer

Solution code:
#ABC 97, B - exponential

def compute():

    x = int(input())
    for y in range(x, 0, -1):
        for i in range(2, 11):
            if y**(1/i) == int(y**(1/i)):
                print(y)
                return
compute()

Submission status: Wrong Answer

Solution code:
#ABC 97, B - exponential

def compute():

    x = int(input())
    for y in range(x, -1, -1):
        for i in range(2, 11):
            if y**(1/i) == int(y**(1/i)):
                print(y)
                return
compute()

Submission status: Wrong Answer

Solution code:
x = int(input())
b = 1
p = 2
while b ** p <= x:
  answer = b ** p
  if answer <= x:
    b += 1
  else:
    break
print(answer)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
beki = 0
while beki < math.sqrt(n) - 1:
  beki += 1
print(beki ** 2)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
beki = 0
#print(math.sqrt(n))
while beki < math.sqrt(n):
  beki += 1
#print(beki)
print((beki - 1) ** 2)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
beki = 0
while beki < math.sqrt(n):
  beki += 1
print(beki)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

print(math.floor(math.sqrt(X))**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)
        else:
            break

print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
ansMax = 0
for i in range(1001):
    tmp = i * 2
    if X >= tmp:
        ansMax = tmp
    else:
        break
print(ansMax)

Submission status: Wrong Answer

Solution code:
X = int(input())
ansMax = 0
for i in range(1000):
    tmp = i * i
    if X >= tmp:
        ansMax = tmp
    else:
        break
print(ansMax)

Submission status: Wrong Answer

Solution code:
X = int(input())
ansMax = 0
for i in range(101):
    tmp = i * i
    if X >= tmp:
        ansMax = tmp
    else:
        break
print(ansMax)

Submission status: Wrong Answer

Solution code:
X=int(input())
ans=0
for b in range(1,32):
  for p in range(2,10):
      a=b**p
      if a>X:
        break
      else:
        ans=a

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max = 0
if X<3:
  print(1)
  exit()
else:
    for i in range (2, X):
        answer = X ** (1/i)
        answer = math.floor(answer)
        answer = answer ** i
        if answer > max:
            max = answer
    print(max)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max = 0
if X<3:
  print(1)
  exit()
else:
    for i in range (2, X):
        answer = X ** (1/i)
        print(answer)
        answer = math.floor(answer)
        print(i)
        answer = answer ** i
        print(answer)
        if answer > max:
            max = answer
    print(max)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max = 0
if X==1:
  print(1)
  exit()
else:
    for i in range (2, X):
        answer = X ** (1/i)
        answer = math.floor(answer)
        answer = answer ** i
        if answer > max:
            max = answer
    print(max)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max = 0
if X==1:
  print(1)
  exit()
else:
    for i in range (2, X):
        answer = X ** (1/i)
        print(answer)
        answer = math.floor(answer)
        print(i)
        answer = answer ** i
        print(answer)
        if answer > max:
            max = answer
    print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
answer = math.sqrt(X)
answer = math.floor(answer)
answer = answer * answer
cubeanswer = X ** (1/3)
cubeanswer = math.floor(cubeanswer)
cubeanswer = cubeanswer ** 3
if cubeanswer > answer:
    print(cubeanswer)
else:
    print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#A
def A():
    a, b, c, d = LI()
    x = abs(a - b)
    y = abs(b - c)
    z = abs(a - c)
    if (x <= d and y <= d) or z <= d:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    X = II()
    x = [False] * (10 ** 3 + 1)
    x[1] = True
    for i in range(2, int(10 ** 1.5) + 1):
        x[i] = True
        for k in range(2,10 ** 3 // i + 1):
            x[i*k] = True
    for i in range(X, -1, -1):
        if x[i]:
            print(i)
            return
    return

#C
def C():
    s = stdin.readline().rstrip()
    K = II() - 1
    ans = []
    for i in range(len(s)):
        for k in range(K+1):
            b = s[i:i + k + 1]
            ans.append(b)
    ans = list(set(ans))
    ans.sort()
    print(ans[K])
    return

#D
def D():
    n, m = LI()
    p = LI_()
    xy = LIR_(m)
    size = [1 for _ in range(n)]
    height = [1 for _ in range(n)]
    par = [i for i in range(n)]
    def find(x):
        if par[x] == x:
            return x
        else:
            par[x] = find(par[x])
            return par[x]
    def union(x, y):
        s1 = find(x)
        s2 = find(y)
        if s1 != s2:
            if height[s1] < height[s2]:
                par[s1] = s2
                size[s2] += size[s1]
                size[s1] = 0
            else:
                par[s2] = s1
                size[s1] += size[s2]
                size[s2] = 0
                if height[s1] == height[s2]:
                    height[s1] += 1

    for x,y in xy:
        union(x, y)
    ans = 0
    for i in range(n):
        if find(p[i]) == find(i):
            ans += 1
    
    print(ans)
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Wrong Answer

Solution code:
x=int(input())
m=1
b,p=2,2
while b**p<=x:
    b=2
    while b**p<=x:
        m=max(m,b**p)
        b+=1
    p+=1
print(m)

Submission status: Wrong Answer

Solution code:
x=int(input())
m=1
b,p=2,2
while b**p<=x:
    while b**p<=x:
        m=max(m,b**p)
        b+=1
    p+=1
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []

for i in range(2,32):
    for j in range(11):
        if i ** j > x:
            break
        a.append(i ** j)
print(max(a))

Submission status: Wrong Answer

Solution code:
x = int(input())
a = set()

for i in range(2,32):
    for j in range(11):
        if i ** j > x:
            break
        a.add(i ** j)
print(max(a))

Submission status: Wrong Answer

Solution code:
def beki():
    li = []
    tmp = 1
    while(tmp**2<1000):
        li.append(tmp**2)
        tmp += 1
    return li

X = int(input())
a = beki()
for i in range(len(a)-1,-1,-1):
    if a[i]<=X:
        print(a[i])
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
r = 2
while l[-1] <= x:
    l.append(r**2)
    r += 1
print(l[-2])

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math

X = int(input())

for i in range(X, 0, -1):
    for j in range(math.floor(math.sqrt(X)), 1, -1):
        for k in range(10):
            if pow(j, k) == i:
                print(pow(j, k))
                exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
for i in range(x,0,-1):
  for j in range(2,100):
    if (i**(1/j))%1 == 0:
      print(i)
      sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
for i in range(x,0,-1):
  for j in range(2,10):
    if (i**(1/j))%1 == 0:
      print(i)
      sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 1
for i in range(1, int(math.sqrt(X)) + 1):
    ans = max(ans, i ** 2)
print(ans)

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())
ans = [1]


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** count <= X:
            count += 1
            ans.append(num ** count)
print(max(ans))

Submission status: Wrong Answer

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


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** i <= X:
            count += 1
            ans.append(num ** i)
print(max(ans))

Submission status: Wrong Answer

Solution code:
x = int(input())
m = 1
for i in range(2,(x+1)//2):
  tmp = 0
  k = 0
  while tmp < x:
    m = max(m,tmp)
    tmp = i**k
    k+=1
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
for b in range(1, x):
    for p in range(2, x):
        e = b ** p
        if ans < e and e <= x:
            ans = e
        if e > x:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import time
import re
import math
import fractions

def main():
    X=int(input())
    print(int(math.sqrt(X))**2)
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

for i in range(x,0,-1):
    if int(math.sqrt(i))**2==i:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
for i in range(X,0,-1):
  sqrt_x = math.sqrt(i)
  if sqrt_x.is_integer():
    print(i)
    exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

def ex(x):
    l = []
    if x == 1:
        return 1
    for b in range(1, x+1):
        for p in range(2, x+1):
            if b **p < x:
                l.append(b**p)
            else:
                break
    return l[-1]
print(ex(x))

Submission status: Wrong Answer

Solution code:
X = int(input())
if X == 1:
    print(1)
    exit()

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

Submission status: Wrong Answer

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

def main():
    x = int(input())
    l = set()
    l.add(1)
    
    if x == 1:
        print(1)
        exit()

    for i in range(1000):
        for j in range(2, 1000):
            if i ** j > 1000:
                break
            l.add(i ** j)
    x = set(range(x, 1001))
    l = l - x
    print(max(l))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
for i in range(110):
    if(i*i <= x):
        ans = i*i
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
for i in range(100):
    if(i*i <= x):
        ans = i*i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print((ans-1)**2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

x=int(input())

while True:
    ans=float(math.sqrt(x))
    if ans.is_integer():
        print(int(x))
        break
    x-=1

Submission status: Wrong Answer

Solution code:
x = int(input())

lst = [1]
for b in range(2,x):
    p = 2
    while(b**p <= x):
        lst.append(b**p)
        p += 1
print(lst[-1])

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
beki_list = []
for i in range(1,int(math.sqrt(1000))+1):
    for j in range(1,11):
        if i**j<=x:
            beki_list.append(i**j)

print(max(beki_list))

Submission status: Wrong Answer

Solution code:
x=int(input())

for i in range(1,32):
    if i**2<=x and (i+1)**2>x:
        print(i**2)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
num=0
list=[]
for i in range(33):
    num=i**2
    list.append(num)

for j in range(len(list)):
    if list[j]<=X and list[j+1]>X:
        print(list[j])
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

max_num = 0
for i in range(x):
	if x == 1:
		max_num = 1
		break
	j = 0
	while (i+2) ** j < x:
		if max_num < (i+2) ** j:
			max_num = (i+2) ** j
		j += 1
	if j == 2:
		break
print(max_num)

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(x):
	y = i ** 2
	if y > x:
		print((i-1)**2)
		break
if y == 0:
    print(1)

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(x):
	y = i ** 2
	if y > x:
		print((i-1)**2)
		break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

x=int(input())

if x==1:
	print(x)
else:
	for i in range(x,0,-1):
		for j in range(2,i):
			if math.log(i,j)==int(math.log(i,j)):
				print(i)
				exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
 
def hoge(x, p):
  return int((math.floor(x**(1/p)))**p)
 
x = int(input())
 
max_bp = 0
for b in range(2, x):
  for p in range(2, x):
    bp = b ** p
    if bp > x:
      break
    max_bp = max(max_bp, bp)

print(max_bp)

Submission status: Wrong Answer

Solution code:
import math

def hoge(x, p):
  return int((math.floor(x**(1/p)))**p)

x = int(input())

max_v = 0
for i in range(2, x):
  max_v = max(max_v, hoge(x, i))

print(max_v)

Submission status: Wrong Answer

Solution code:
import math

def hoge(x, p):
  return int((math.floor(x**(1/p)))**p)

x = int(input())

max_v = 0
for i in range(2, 10):
  max_v = max(max_v, hoge(x, i))

print(max_v)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
print(int((math.floor(x**(1/2)))**2))

Submission status: Wrong Answer

Solution code:
X = int(input())
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
ans = []
for i in range(X):
    x = X-i
    for prime in primes:
        for j in range(10):
            if prime ** j == x:
                ans.append(x)
                break
print(max(ans))

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())
se = set(n**e for n in range(32) for e in range(11) if n**e <= X)

answer = max(se)
print(answer)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

x = int(input())
xx = sorted(list(range(1, x+1)), reverse=True)
a = set()
for i in range(1, 32):
    for j in range(1, 32):
        a.add(i**j)

for i in xx:
    if i in a:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

x = int(input())
xx = sorted(list(range(1, x+1)), reverse=True)
ans = 0
for i in xx:
    if i**0.5%1 == 0:
        ans = i
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

x=int(input())
y=math.floor(math.sqrt(x))
ans=1
temp=1

for i in range(2,y+1):
  while temp*i<x:
    temp = temp * i
    ans=max(temp,ans)
  else:
    temp=1
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
BP = []
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, 1/p)
    if b % 1 == 0:
      BP.append(x)
print(max(BP))

Submission status: Wrong Answer

Solution code:
X = int(input())
BP = []
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, 1/p)
    if b % 1 == 0:
      BP.append(int(b**p))
print(max(BP))

Submission status: Wrong Answer

Solution code:
X = int(input())
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, 1/p)
    if b % 1 == 0:
      break
  else:
    continue
  break
print(int(b**p))

Submission status: Wrong Answer

Solution code:
X = int(input())
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, 1/p)
    if isinstance(b, int):
      break
  else:
    continue
  break
print(b**p)

Submission status: Wrong Answer

Solution code:
X = int(input())
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, p)
    if isinstance(b, int):
      break
  else:
    continue
  break
print(b**p)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 1
cnt = 0
for i in range(2, int(math.sqrt(X)) + 1):
    cnt = 2
    while i ** cnt < X:
        ans = max(ans, i ** cnt)
        cnt += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
i=1
while True:
    t=i**2
    if t<=x:
        ans=max(ans,t)
    else:
        break
    i+=1
print(ans)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    l = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            l.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        l.append((n, 1))
    return l


# input
a = int(input())
# calc
for i in range(a, 0, -1):
    out = factorize(i)
    t = 0
    for j in out:
        t += j[1] % 2
    if t == 0:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 0
for i in range(1,32):
    if X >= i**2:
        ans = i**2
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(1,32):
    if X >= i**2:
        ans = i**2
    else:
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = int(input())
for i in range(1, 33):
    if i**2 > x:
        print((i-1)**2)
        sys.exit()

Submission status: Wrong Answer

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

X = int(input())
xs = []
for x in range(1, int(math.sqrt(X))+1):
    xs.append(x)
ans = 1

for x in xs[1:]:
    j = 0
    while pow(x, j) < X:
        j += 1
    ans = max(ans, pow(x, j-1))
print(ans)

Submission status: Wrong Answer

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

res = 1
for i in range(2, a):
    tmp = i
    while True:
        tmp *= i
        if tmp < a:
            res = max(res, tmp)
        else:
            break
    
print(res)

Submission status: Wrong Answer

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

res = 1
for i in range(2, int(math.sqrt(a))+1):
    tmp = i
    while True:
        tmp *= i
        if tmp < a:
            res = max(res, tmp)
        else:
            break
    
print(res)

Submission status: Wrong Answer

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

res = 0
for i in range(1, int(math.sqrt(a))+1):
    tmp = i
    while True:
        tmp *= i
        if tmp <= a:
            res = max(res, tmp)
            break
    
print(res)

Submission status: Wrong Answer

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

res = 0
for i in range(1, a+1):
    for j in range(2, a+1):
        tmp = i ** j
        if tmp <= a:
            res = tmp
        else:
            break
            
print(res)

Submission status: Wrong Answer

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

while math.sqrt(a) % 1 != 0:
    a -= 1
print(a)

Submission status: Wrong Answer

Solution code:
import math

a = int(input())

while math.sqrt(a) % 1 != 0:
  a -= 1
  
print(a)

Submission status: Wrong Answer

Solution code:
x = int(input())

c = 0
for i in range(x+1):
    for j in range(2,10):
        d = i ** j
        if d<x and c<d:
            c = d
print(c)

Submission status: Wrong Answer

Solution code:
X=int(input())
i=0
while i**2<=X:
    i+=1

print((i-1)**2)

Submission status: Wrong Answer

Solution code:
x=int(input())
b=[2,3,5,7,11,13,17,19,23,29,31]
c=[]
for i in b:
    j=i
    while x>=j:
        j*=i
    c.append(1 if j<i**3 else j//i)
c.sort()
print(c[-1])

Submission status: Wrong Answer

Solution code:
x=int(input())
b=[2,3,5,7,11,13,17,19,23,29,31]
c=[]
for i in b:
    j=1
    while x>=j:
        j*=i
    c.append(j//i)
c.sort()
print(c[-1])

Submission status: Wrong Answer

Solution code:
x=int(input())
b=[2,3,5,7,11,13,17,19,23,29,31]
c=[]
for i in b:
    j=1
    while x>j:
        j*=i
    c.append(j//i)
print(c[-1])

Submission status: Wrong Answer

Solution code:
sample = [1]
sample.extend([2**i for i in range(1, 10)])
sample.extend([3**i for i in range(1, 7)])
sample.extend([5**i for i in range(1, 5)])
sample.extend([7**i for i in range(1, 4)])
sample.extend([11**i for i in range(1, 3)])
sample.extend([13**i for i in range(1, 3)])
sample.extend([17**i for i in range(1, 3)])
sample.extend([19**i for i in range(1, 3)])
sample.extend([23**i for i in range(1, 3)])
sample.extend([29**i for i in range(1, 3)])
sample.extend([31**i for i in range(1, 3)])
sample.sort()
x = int(input())
res = 0
for i in sample:
    if x >= i:
        res = i
    else:
        break
print(res)

Submission status: Wrong Answer

Solution code:
def is_perfect_power(n):
    if n == 1:
        return True
    div = 2
    divs = []
    while n != 1:
        if n % div == 0:
            n //= div
            divs.append(div)
        else:
            div += 1
    return len(divs) > 1 and len(set(divs)) == 1


X = int(input())
for x in range(X, 0, -1):
    if is_perfect_power(x):
        print(x)
        break

Submission status: Wrong Answer

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

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

for i in range(1,X):
    a = i
    if i == 1 or  i == 0:
        continue
    else:
        while True:
            a *= a
            if a > X:
                break
            else:
                T.append(a)

T.sort()
print(T[-1])

Submission status: Wrong Answer

Solution code:
r=range(1,32);x=int(input());print(max(b**p*(b**p<=x)for p in r for b in r))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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