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())
if X == 1:
    print(1)
    exit()

ans = 0
for b in range(2, 1000):
    p = 2
    while True:
        pow = b ** p
        if pow < X:
            ans = max(ans, pow)
            p += 1
        else:
            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, 35):
    p = 2
    while True:
        pow = b ** p
        if pow < X:
            ans = max(ans, pow)
            p += 1
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=1
m=int(x**(1/2)//1)+1
for b in range(1,m):
  ans=max(int(((x**(1/b))//1)**b),ans)
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=1
m=int(x**(1/2)//1)+1
for b in range(2,m):
  ans=max(int(((x**(1/b))//1)**b),ans)
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
#print(int(((x**(1/2))//1)**2))
ans=1
for i in range(35):
  if i*i<=x:
    ans=i*i
  else:
    print(ans)
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input()); res = 0
for i in range(X):
  for j in range(2, 11):
    if i ** (j + 1) > X and i ** j <= X:
      res = max(res, i ** j)
      break
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
for i in range(1,n):
    for j in range(2,n):
        k=i**j
        if k<n:
            x=max(x,k)
        else:
            break

print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
for i in range(1,n):
    for j in range(2,n):
        k=i**j
        if k<n:
            x=max(x,k)

print(x)

Submission status: Wrong Answer

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

print(x)

Submission status: Wrong Answer

Solution code:
x = int(input())
Powers = [1]
for i in range(2,32):
  k = i
  while k<=1000:
    Powers += [k]
    k *= i
Powers.sort(reverse = True)
for power in Powers:
  if power <= x:
    print(power)
    break

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
from functools import reduce
import copy
import math


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    X = int(inputs[0])
    max = 0
    for x in range(1, X + 1):
        for y in range(2, X + 1):
            c = x ** y
            if c <= X:
                max = c if c > max else max
            else:
                break
    return max


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Wrong Answer

Solution code:
import math

def sol(ans, i):
  for j in range(2,1001):
    tmp_ans = math.pow(i,j)
    if tmp_ans >= X: return ans
    elif ans < tmp_ans: ans = tmp_ans
  return ans

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

ans = -1 * float('inf')
for i in range(1,1001):
  ans = sol(ans,i)
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

def sol(ans, i):
  for j in range(2,1000):
    tmp_ans = math.pow(j,i)
    if tmp_ans >= X: return ans
    elif ans < tmp_ans: ans = tmp_ans
  return ans

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

ans = -1 * float('inf')
for i in range(2,1000):
  ans = sol(ans,i)
print(int(ans))

Submission status: Wrong Answer

Solution code:
X=int(input())
a=0
for i in range(20):
    for j in range(12):
        if i**j<=X:
            a=max(a,i**j)
      
print(int(a))

Submission status: Wrong Answer

Solution code:
X=int(input())
a=0
for i in range(X):
    for j in range(12):
        b=pow(i+1,1/(j+2))
        H=i+1
        if b.is_integer():
            a=max(a,H)
print(int(a))

Submission status: Wrong Answer

Solution code:
X=int(input())
a=0
for i in range(X):
    for j in range(12):
        b=pow(float(i+1),float(1/(j+2)))
        H=i+1
        if b.is_integer():
            a=max(a,H)
print(int(a))

Submission status: Wrong Answer

Solution code:
# ABC097b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

print(math.floor(math.sqrt(int(input())))**2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# B - Exponential
X = int(input())

for i in range(X,0,-1):
    for b in range(1,X):
        for q in range(2,10):
            if i == b**q:
                print(i)
                exit()
            else:
                pass

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
A = [1]
a = 2
while a**2 <= 1000:
    tmp = a**2
    while tmp <= 1000:
        A.append(tmp)
        tmp *= a
    a += 1
A = sorted(A)
A
for i in range(len(A)):
    if A[i] > X:
        break

print(A[i-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import sys
x = int(input())
for i in range(x,0,-1):
    if math.sqrt(i) == int(math.sqrt(i)):
        print(i)
        sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 1
for i in range(2, x + 1):
    tmp = i
    while tmp <= x:
        tmp *= i
    ans = max(ans, tmp / i)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(2, x):
  num = i * i
  while num <= x:
    res = max(res, num)
    num *= i
    
print(res)

Submission status: Wrong Answer

Solution code:
x=int(input())
q=[b**p<=1000 for b in range(1,1001) for p in range(2,11)]
print(q)

Submission status: Wrong Answer

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

N =  int(sys.stdin.readline())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 1
for b in range(2, 32):
    for p in range(2, 11):
        if b ** p < x:
            ans = max(ans, b ** p)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

li=[]
for i in range(2,32):
    num = 1
    while i**num<n:
        num +=1
    li.append(i**(num-1))   
print(max(li))

Submission status: Wrong Answer

Solution code:
n = int(input())

li=[]
for i in range(2,32):
    num = 1
    while i**num<=n:
        num +=1
    #print(num)
    li.append(i**(num-1))    
print(max(li))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]

for i in range(2,32):
  for j in range(1,10):
    if i**j <= 1000:
      l.append(i**j)
      
l = sorted(list(set(l)),reverse = True)

for k in sorted(list(range(1,x+1)),reverse = True):
  if k in l:
    print(k)
    exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]

for i in range(2,32):
  for j in range(1,10):
    if i**j <= 1000:
      l.append(i**j)
      
l = sorted(l,reverse = True)

for k in sorted(list(range(1,x+1)),reverse = True):
  if k in l:
    print(k)
    exit()

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
from collections import  Counter
import statistics
import math

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

x = ni()
li = [n ** 2 for n in range(1, 33)[::-1]]
for i in range(len(li)):
    if x >= li[i]:
        print(li[i])
        break

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
from collections import  Counter
import statistics
import math

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

x = ni()
li = [n ** 2 for n in range(33)[::-1]]
for i in range(len(li)):
    if x >= li[i]:
        print(li[i])
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

ret = 1
for i in range(2, 32):
    for j in range(2, 11):
        tmp = i ** j
        print(i, j)
        if tmp <= x:
            ret = max(ret, tmp)
        else:
            break
print(ret)

Submission status: Wrong Answer

Solution code:
x = int(input())

ret = 1
for i in range(2, 11):
    for j in range(2, 11):
        tmp = i ** j
        if tmp <= x:
            ret = max(ret, tmp)
print(ret)

Submission status: Wrong Answer

Solution code:
x = int(input())

ret = 1
i = 1
while i ** 2 <= x:
    ret = max(ret, i ** 2)
    i += 1
print(ret)

Submission status: Wrong Answer

Solution code:
x=int(input())

import math

#y=math.log(1000, 1)

res=[1]

for i in range(2,33):
	y=math.floor(math.log(x, i))
	if y>=2:
		res.append(i**y)

print(max(res))
#961

Submission status: Wrong Answer

Solution code:
x=int(input())

import math

#y=math.log(1000, 1)

res=[1]

for i in range(2,33):
	y=math.floor(math.log(x, i))
	res.append(i**y)

print(max(res))
#961

Submission status: Wrong Answer

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

i = 1
while i**2 <= x:
  y.append(i**2)
  i = i +1
  
print(max(y))

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 0
for b in range(2, 40):
  for p in range(2, 11):
    if pow(b, p) <= X: ans = max(ans, pow(b, p))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

ans = 1
for i in range(2, 9):
  d = (math.floor(x ** (1 / i))) ** i
  if d <= x:
    ans = max(ans, d)
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

ans = 1
for i in range(2, 10):
  d = (math.floor(x ** (1 / i))) ** i
  
  ans = max(ans, d)
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

ans = 1
for i in range(2, 11):
  d = (math.floor(x ** (1 / i))) ** i
  
  ans = max(ans, d)
  
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(1000):
  if n<i**2:
    print((i-1)**2)
    break

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(100):
  if n<i**2:
    print((i-1)**2)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
num =[]

for i in range(31):
    m = (i+1)*(i+1)
    if m <= n:
        num.append(m)

print(max(num))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
for i in range(2,11):
  for j in range(x):
    if x-j**i>0:
      tmp=j**i
    else:
      break
  ans=[tmp,ans][tmp<ans]
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
for i in range(2,11):
  for j in range(x):
    if x-j**i-ans>0:
      tmp=j**i
    else:
      break
  ans=[tmp,ans][tmp<ans]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
c=1
for i in range(100):
    for j in range(100):
        if i**j<=x:
            a=i**j
        else:
            b=a
            break
    if b>=c:
        c=b
print(c)

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
c=0
for i in range(100):
    for j in range(100):
        if i**j<=x:
            a=i**j
        else:
            b=a
            break
    if b>=c:
        c=b
print(c)

Submission status: Wrong Answer

Solution code:
x = int(input())

if x == 1:
    print(1)
    exit(0)

for i in reversed(range(1, x + 1)):
    for j in range(2, x + 1):
        if (i ** (1 / j)).is_integer():
            print(i)
            exit(0)

Submission status: Wrong Answer

Solution code:
lis=[0]*1001
for i in range(2,int(1000**0.5)+1):
    point=2
    count=i
    while count<1000:
        try:
            count=i
            count=count**point
            lis[count]=1
            point +=1
        except:break
lis[1]=1
target=[]
for i in range(len(lis)):
    if lis[i]==1:
        target.append(i)

x=int(input())
ans=0
for i in target:
    if i<=x:
        ans=i
    elif x==1000:
        print(x)
        break
    else:print(ans);break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

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

Submission status: Wrong Answer

Solution code:
lis=[0]*1001
for i in range(2,int(1000**0.5)+1):
    point=2
    count=i
    while count<1000:
        try:
            count=i
            count=count**point
            lis[count]=1
            point +=1
        except:break
lis[1]=1
target=[]
for i in range(len(lis)):
    if lis[i]==1:
        target.append(i)

x=int(input())
ans=0
for i in target:
    if i<=x:
        ans=i
    else:print(ans);break

Submission status: Wrong Answer

Solution code:
x=int(input())
max=1
for i in range(x):
  for j in range(x):
    if max<=i**j<=x:
      max=i**j
    elif i**j>x:
      break

print(max)

Submission status: Wrong Answer

Solution code:
# your code goes here
x=int(input())
max=1
for i in range(x):
	if i**2<=x:
		max=i**2
	else:
		break
print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 1
import math
for i in range(2,math.floor(math.sqrt(x))+1):
    b = i ** 2
    while b <= x:
        ans = max(b,ans)
        b *= b
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 1
import math
for i in range(2,math.ceil(math.sqrt(x))):
    b = i ** 2
    while b <= x:
        ans = max(b,ans)
        b *= b
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
for b in range(1, x//2):
    for p in range(2, x):
        if b**p <= x:
            ans = max(ans, b**p)
        else:
            continue
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = 1
a = int(input())
for i in range(1, int(a ** 0.5)):
  for j in range(2, int(a/ 2)):
    if i ** j <= a:
      c = max(c, i**j)
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy
import math

X = int(input())
print(math.floor(numpy.sqrt(X)) ** 2)

Submission status: Wrong Answer

Solution code:
import numpy

X = int(input())
print(int(numpy.sqrt(X)) ** 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
max_val=0
for b in range(1,x):
  for p in range(2,x):
    y=b**p
    if y <= x:
      max_val=max(y,max_val)
    
print(max_val)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
a = 2
res = 0
while True:
  b = 2
  if a > 33:
    break
  while True:
    t = a ** b
    if t <= X:
      res = max(res, t)
      b += 1
    else:
      break
  a += 1

print(res)

Submission status: Wrong Answer

Solution code:
X = int(input())
def f(a, b):
  return int(int(a ** (1/b)) ** b)

res = 0
for i in range(2,10):
  res = max(res, f(X, i))

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(33):
    for j in range(11):
        if i**j > x:
            break
        elif i**j >= max_num:
            max_num = i**j

print(max_num)

Submission status: Wrong Answer

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

for i in range(33):
    for j in range(11):
        if i**j >= x:
            break
        elif i**j >= max_num:
            max_num = i**j

print(max_num)

Submission status: Wrong Answer

Solution code:
import numpy as np

X = int(input())

def beki(num):
  for j in range(1, num):
    for k in range(2, 10):
      if j ** k == num:
        return True
  return False


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
m = int(sqrt(n))
li = list(range(m + 1))
#0と1は考えない
for i in range(2, m + 1):
    while li[i] < n:
        li[i] *= i
    li[i] = int(li[i] / i)
print(max(li))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
for i in range(X+1):
  n = i*i
  if (X == n):
    ans = i
    break
  elif (X < n):
    ans = i - 1
    break
print(ans**2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
print(max(int(x**(1/p))**p for p in range(2, 12)))

Submission status: Wrong Answer

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

x = int(input())

ans = 1
for b in range(1,x+1):
    for p in range(2,5):
        m = b**p
        if m <= x:
            ans = max(ans, m)
print(ans)

Submission status: Wrong Answer

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

x = int(input())

ans = 1
for b in range(1,x+1):
    for p in range(2,5):
        m = b**p
        if m < 10:
            ans = max(ans, m)
print(ans)

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

Solution code:
import math

def main():
    X = int(input())

    ans = 0
    for i in range(X):
        for j in range(X):
            if i ** j <= X:
                ans = max(ans, i ** j)

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
X = int(input())

max_ = 0

for i in range(2,X):
  power=1
  while i**(power+1)<=X:
    power+=1
    
  if power==1:
    break
    
  if i**power>max_:
    #print(i)
    #print(power)
    max_=i**power
    
print(max_)

Submission status: Wrong Answer

Solution code:
X = int(input())

max_ = 0

for i in range(2,X):
  power=1
  while i**(power+1)<=X:
    power+=1
    
  if power==1:
    break
    
  if i**power>max_:
    print(i)
    #print(power)
    max_=i**power
    
print(max_)

Submission status: Wrong Answer

Solution code:
n = int(input())
r = 1
for i in range(2, 11):
    if r < int(n ** (1 / i)+0.01) ** i:
        r = int(n ** (1 / i)+0.01) ** i
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=1
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:
x=int(input())
ans=1
for i in range(35):
    for j in range(2,20):
        if i**j<x:
            ans=max(ans,i**j)
print(ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=1
for i in range(35):
    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())
ans=1
for i in range(35):
    for j in range(10):
        if i**j<x:
            ans=max(ans,i**j)
print(ans)

Submission status: Wrong Answer

Solution code:

x = int(input())
for i in range(x, 1-1, -1):
    if i ** 0.5 % 1 == 0:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:

x = int(input())
for i in range(x, 1, -1):
    if i ** 0.5 % 1 == 0:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(1,N):
    for k in range(2,100):
        if N >= j ** k:
            if ans < j ** k:
                ans = j ** k
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(1,N):
    for k in range(2,100):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(1,N):
    for k in range(1,100):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(1,1000):
    for k in range(1,100):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(1,100):
    for k in range(1,100):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(1,10000):
    for k in range(1,10000):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
        else :
            break
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(10000):
    for k in range(10000):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
        else :
            break
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for j in range(100):
    for k in range(100):
        if N > j ** k:
            if ans < j ** k:
                ans = j ** k
        else :
            break
 
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
for j in range(10000000000):
    if j * j <= N:
        ans = j * j
    else :
        break
 
print(ans)

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:
import math
x=int(input())
num=math.floor(x/2)
flag=0
max=0
for i in range(num):
    flag=0
    for j in range(num):
        if i==1:
            break
        if i**j<x:
            if i**j>=max:
                max=i**j
        else:
            flag=1
            break
print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
ans = []
for i in range(2,30):
  ans.append(int(math.pow(x,(1/i)))**i)
print(max(ans))

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
ans = []
for i in range(2,10):
  ans.append(int(math.pow(x,(1/i)))**i)
print(max(ans))

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:
import math

ans = []
x = int(input())
for i in (range(1,x+1)):
    if math.sqrt(i) % 1 == 0:
        ans.append(i)

print(max(ans))

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
for i in (reversed(range(1,x+1))):
    if math.sqrt(i) % 1 == 0:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
for j in range(100000):
    if j * j <= N:
        ans = j * j
    else :
        break

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
for j in range(1000):
    if j * j <= N:
        ans = j * j
    else :
        break

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
maxi = 0
for i in range(2,x+1):
  p = 2
  while True:
    if i ** p <= x:
      if maxi < i ** p:
        maxi = i ** p
      p += 1
    else:
      break
print(maxi)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

res = 0
for i in range(1,X):
    c = 2
    while 1:
        a = i**c
        if a <= X:
            if a == 1:
                res = 1
                break
            elif res < a:
                res = a
            c += 1
        else:
            break
print(res)

Submission status: Wrong Answer

Solution code:
X = int(input())

max_num = 1
for b in range(2, 32):
    num = 1
    for p in range(1, 11):
        num *= b
        if num <= X and num >= max_num:
            max_num = num

print(max_num)

Submission status: Wrong Answer

Solution code:
x = int(input())
max_num = 0
for b in range(1, 33):
    for p in range(1, 33):
        if b**p > x:
            continue
        max_num = max(max_num, b**p)
print(max_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

def createC(x, z):
  tmp = []
  for y in range(x):
    p = pow(y+1, z)
    if p <= x:
      tmp.append(p)
    else:
      return tmp

def checkC(c_tmp, max_c):
  if len(c_tmp) != 1:
    s = sorted(c_tmp)
    if max_c < s[-1]:
      max_c = s[-1]
      return [max_c,True]
    else:
      return [max_c,False]

z = 2
max_c = 1

while True:
  if x == 1:
    break
  c_tmp = createC(x, z)
  c_check_result = checkC(c_tmp, max_c)
  if c_check_result[1]:
    max_c = c_check_result[0]
    z += 1
  else:
    break
print(max_c)