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:
import math
X = int(input())

def check_exponential(x):
    r = math.sqrt(x)
    int_r = int(r)

    if abs(r-int_r) <= 0.01:
        return 1
    else:
        return 0

for i in reversed(range(1,X+1)):
    if check_exponential(i) == 1:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
def gen(n):
  l = []
  for i in range(2, int(n**(1/2))+1):
    if n % i == 0:
      l.extend([i, int(n/i)])
  l.sort()
  return l

def check(l):
  for x in l:
    if x % l[0] != 0:
      return False
  return True

def run(n):
  for n in range(n -1, 0, -1):
    l = gen(n)
    if l and check(l):
      return n

print(run(int(input())))

Submission status: Wrong Answer

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

for i in range(40):
    for j in range(2,11):
        if i**j<=X:
            listx.append(i**j)
print(max(listx))
print(listx)

Submission status: Wrong Answer

Solution code:
from math import log, floor
x = int(input())
ans = 1
for b in range(2, 10):
    p = floor(log(x,b))
    if p <= 1: continue
    tmp = b**p
    tmp2 = b**(p+1)
    if tmp2 <= x:
        tmp = tmp2
    ans = max(ans, tmp)

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
X = int(input())
if X==1:
    print('1')
    sys.exit()
maxnum = 0
for i in range(2,int(np.sqrt(X))+1):
    num = i
    while num < X:
        num *= i
        if num >maxnum:
            maxnum = num/i
print(int(maxnum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max_num = 1
root = math.floor(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = math.floor(math.log(X, b))
        if (b**p > max_num) and (p > 1):
            max_num = b**p
else:
    print(1)

if root >= 2:
    print(max_num)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max_num = 1
root = math.floor(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = math.floor(math.log(X, b))
        if b**p > max_num and p > 1:
            max_num = b**p
else:
    print(1)

if root >= 2:
    print(max_num)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
max_num = 1
root = math.floor(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = math.floor(math.log(X, b))
        if b**p > max_num:
            max_num = b**p
else:
    print(1)

if root >= 2:
    print(max_num)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
file = []
root = math.floor(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = math.floor(math.log(X, b))
        file.append(b**p)
else:
    print(1)

if root >= 2:
    print(max(file))

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
file = []
root = int(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = int(math.log(X, b))
        file.append(b**p)
else:
    print(1)

if root >= 2:
    print(max(file))

Submission status: Wrong Answer

Solution code:
import math
X  =  int(input())
def expo(n):
    m = int(math.sqrt(n))
    for i in range(2, m+1):
        if math.log(n, i) == int(math.log(n, i)):
            return True
    return False
if X >= 4:
    for n in range(X, 3, -1):
        if expo(n):
            print(n)
            break
else:
    print(1)

Submission status: Wrong Answer

Solution code:
import math
X  = int(input())
def expo(n):
    m = int(math.sqrt(n))
    for i in range(2, m+1):
        if math.log(n, i) == int(math.log(n, i)):
            return True
    return False
if X >= 5:
    for n in range(X, 3, -1):
        if expo(n):
            print(n)
            break
else:
    print(X)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
def expo(n):
    m = int(math.sqrt(n))
    for i in range(2, m+1):
        if math.log(n, i) == int(math.log(n, i)):
            return True
    return False
if X >= 5:
    for n in range(X, 4, -1):
        if expo(n):
            print(n)
            break
else:
    print(X)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
file = []
root = int(math.sqrt(X))
if root >= 2:
    for b in range(2, root+1):
        p = int(math.log(X, b))
        file.append(b**p)
else:
    print(X)

if root >= 2:
    print(max(file))

Submission status: Wrong Answer

Solution code:
from math import sqrt, log, floor
X = int(input())
print(max([1] + [pow(b, floor(log(X, b))) for b in range(2, floor(sqrt(X))+1)]))

Submission status: Wrong Answer

Solution code:
from math import sqrt, log
X = int(input())
print(max([1] + [pow(b, int(log(X, b))) for b in range(2, int(sqrt(X))+1)]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int(x**(1/2))
max_ = 0

while a > 1:
    i = 2
    while a**i <= x:
        if max_ < a**i:
            max_ = a**i
        i += 1
    a -=1
print(max_)

Submission status: Wrong Answer

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

if x <= 2:
    print(x)
    exit()

answer = []
for p in range(2, x):

    for i in range(2, x):
        test = i**p
        if test > 1000:
            break
        if test > x:
            answer.append((i-1)**p)
            break
        elif test == x:
            answer.append(i**p)
            break

print(max(answer))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

for j in range (x, 0, -1):
    for k in range(2, 10):
        if j**k <= x:
            print(j**k)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for j in range (x, 1, -1):
    for k in range(2, 10):
        if j**k <= x:
            print(j**k)
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
y = int(round(math.sqrt(x),0))
a = 1
for i in range(2,y):
    b = 2
    while i**b <= x:
        if a < i**b:
            a = i**b
        b += 1
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
Min = n
for i in range(2,11):
    for j in range(2,11):
        if i ** j <= n:
            Min = min(Min,n - i ** j)
print(n - Min)

Submission status: Wrong Answer

Solution code:
n = int(input())
Min = n
for i in range(11):
    for j in range(2,11):
        if i ** j <= n:
            Min = min(Min,n - i ** j)
print(n - Min)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
ans = 1
for i in range(1, n+1):
    if math.sqrt(i) == int(math.sqrt(i)):
        ans = i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for b in sorted(range(1,32), key=int, reverse=True):
	for p in range(2,32):
		bp = b**p
		if bp <= x:
			break
	if bp <= x:
		print(bp)
		break

Submission status: Wrong Answer

Solution code:
x = int(input())
for b in sorted(range(1,32), key=int, reverse=True):
	for p in range(2,32):
		bp = b**p
		if bp <= x:
			break
	if bp <= x:
		print(bp,b,p)
		break

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
if X <= 3:
    ans = 1
else:
    b=2
    p=2
    ans = 4 # 2^2
    while(b <= math.sqrt(X)):
        p=2
        while(b ** p <= X):
            if b ** p > ans:
                ans = b ** p
            b += 1
        p += 1
    
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
y = sorted(range(1,32), key=int, reverse=True)
sx = range(2,32)
for b in y:
	for p in sx:
		bp = b**p
		if bp <= x and p>=2:
			break
	if bp <= x and b>=1:
		print(bp)
		break

Submission status: Wrong Answer

Solution code:
from sys import stderr
from functools import reduce
from operator import add
f = lambda: [int(i) for i in input().split()]
debug = lambda *x: stderr.write(reduce(add, repr(x)) + '\n')

x = int(input())
ans = 1
for i in range(2,1000):
    j = 2
    if i**j <= x:
        ans = max(ans, i**j)
        j += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X= int(input())

b = 1
p = 2
y=1 
while y < X:
    y = b**p
    b+=1
print(y)

Submission status: Wrong Answer

Solution code:
x = list(sorted(range(input()), key=int, reverse=True))
for b in x:
	for p in x:
		if b**p <= x[0] and p>=2 and b>=1:
			break
	if b**p <= x[0] and p>=2 and b>=1:
		ans=b**p
		print(ans)
		break

Submission status: Wrong Answer

Solution code:
x = list(sorted(range(input()), key=int, reverse=True))
for b in x:
	for p in x:
		if b**p <= x[0] and p>=2 and b>=1:
			break
	if b**p <= x[0] and p>=2 and b>=1:
		print(b**p,b,p)
		break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 1:
    print("1")
    exit(0)

a = []

#2^10
# 100^2 => 10000

for i in range(1,101):
    for j in range(1,11):
        a.append(pow(i, j))

a.sort()
for k in range(len(a)-1, -1, -1):
    if a[k] <= x:
        print(a[k])
        exit(0)

Submission status: Wrong Answer

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

#2^10
# 100^2 => 10000

for i in range(1,101):
    for j in range(1,11):
        a.append(pow(i, j))

a.sort()
for k in range(len(a)-1, -1, -1):
    if a[k] <= x:
        print(a[k])
        exit(0)

Submission status: Wrong Answer

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

#2^10
# 100^2 => 10000

for i in range(0,101):
    for j in range(0,11):
        a.append(pow(i, j))

a.sort()
for k in range(len(a)-1, 0, -1):
    if a[k] <= x:
        print(a[k])
        exit(0)

Submission status: Wrong Answer

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

#2^10
# 100^2 => 10000

for i in range(0,101):
    for j in range(0,11):
        a.append(pow(i, j))

a.sort()
for i in range(len(a)-1, 0, -1):
    if a[i] <= x:
        print(a[i])
        exit(0)

Submission status: Wrong Answer

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

#2^10
# 100^2 => 10000

for i in range(0,101):
    for j in range(0,11):
        a.append(pow(i, j))

a.sort()
for i in range(len(a)-1, 0, -1):
    if a[i] < x:
        print(a[i])
        exit(0)

Submission status: Wrong Answer

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

#2^10
# 100^2 => 10000

for i in range(2,100):
    for j in range(2,10):
        a.append(pow(i, j))

a.sort()
for i in range(len(a)-1, 0, -1):
    if a[i] < x:
        print(a[i])
        exit(0)

Submission status: Wrong Answer

Solution code:
X = int(input())

max = 1
temp = 1
for i in range(2,11,1): #指数部分
    for j in range(1,33,1):#整数部分

        temp = j**i
        if temp >= 1000:
            break
        elif X >= temp and temp > max:
            max = temp

print(max)

Submission status: Wrong Answer

Solution code:
X = int(input())

max = 1
temp = 1
for i in range(2,11,1): #指数部分
    for j in range(2,33,1):#整数部分

        temp = j**i
        if temp >= 1000:
            break
        elif X >= temp and temp > max:
            max = temp

print(max)

Submission status: Wrong Answer

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

from math import sqrt
X=int(input())
sqrt_X=int(sqrt(X))
ans=1

for b in range(1,sqrt_X):
    for p in range(2,sqrt_X + 1):
        now_num = b**p
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
for i in range(1,32):
    for j in range(1,11):
        b = i**j
        if b > x:
            break
        a.append(b)
a = list(set(a))
a.sort()

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
for i in range(1,32):
    for j in range(1,11):
        b = i**j
        if b > x:
            break
        a.append(b)
a = list(set(a))
a.sort()

print(a[-1])

Submission status: Wrong Answer

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

for b in range(1,sqrt_X):
    for p in range(2,sqrt_X + 1):
        now_num = b**p
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
m = [1]
for i in range(2, x):
  if pow(i, 2) <= 1000:
    m.append(pow(i, 2))
    
print(max(m))

Submission status: Wrong Answer

Solution code:
x = int(input())
m = [1]
for i in range(2, x):
  if pow(i, 2) <= 1000:
    m.append(pow(i, 2))

print(max(m))

Submission status: Wrong Answer

Solution code:
from math import ceil
x=int(raw_input())
a=x**(1.0/2)
if(a%1==1.0): a=a**2
else: a=(a-a%1)**2
b=x**(1.0/3)
if(abs(b%1-1.0)<=0.01): b=b**3
else: b=(b-b%1)**3
print("%d"%max(ceil(a),ceil(b)))

Submission status: Wrong Answer

Solution code:
x = int(input())
m = [1]
for i in range(2, x):
  if pow(i, 2) <= 1000:
    m.append(pow(i, 2))
    
print(m)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
for i in range(1,501):
	for j in range(1,11):
		b = i**j
		a.append(b)
a = list(set(a))
a.sort()
ans_list = []
for i in a:
    if i <= x:
        ans_list.append(i)

print(ans_list[-1])

Submission status: Wrong Answer

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

X = int(input())
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X, i))
    if p < 1.5:
        break
    tmp = round(i ** p)
    if tmp >= value:
        value = tmp

print(int(value))

Submission status: Wrong Answer

Solution code:
x = int(raw_input())
ans = 0
i = 2
while i*i<=x:
 j = 2
 while i**j<= x:
  if i**j >= ans:
   ans = i**j
  j+=1
 i+=1
print ans

Submission status: Wrong Answer

Solution code:
from math import ceil
x=int(raw_input())
a=x**(1.0/2)
if(a%1==1): a=a**2
else: a=(a-a%1)**2
b=x**(1.0/3)
if(b%1==1): b=b**3
else: b=(b-b%1)**3
print("%d"%max(a,b))

Submission status: Wrong Answer

Solution code:
from sys import stderr
from functools import reduce
from operator import add
f = lambda :[int(i) for i in input().split()]
debug = lambda *x:stderr.write(reduce(add,repr(x))+'\n')

x = int(input())
ans = 1
for i in range(1000):
    j = 2
    if i ** j <= x:
        ans = max(ans,i ** j)
print(ans)

Submission status: Wrong Answer

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

X = int(input())
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X, i))
    if p < 2:
        break
    for j in range(2, round(p) + 1):
        tmp = i ** j
        if tmp >= value:
            value = tmp

print(int(value))

Submission status: Wrong Answer

Solution code:
from math import ceil
x=int(raw_input())
a=x**(1.0/2)
if(a%1!=1): a=a**2
else: a=(a-a%1)**2
b=x**(1.0/3)
if(b%1==1): b=b**3
else: b=(b-b%1)**3
print("%d"%max(a,b))

Submission status: Wrong Answer

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

X = int(input())
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X, i))
    if p < 2:
        break
    tmp = round(i ** p)
    if tmp >= value:
        value = tmp

print(int(value))

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
y = int(math.sqrt(x)) - 2
for i in range(y,y+5):
    if i ** 2 <= x and (i + 1)** 2 > x and i > 0:
        print(i ** 2)

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())
array = []
for i in range(2, 11):
    for j in range(1, 33):
        if pow(j, i) > X:
            break
        else:
            array.append(pow(i, j))
        
print(min(array))

Submission status: Wrong Answer

Solution code:
from sys import stderr
from functools import reduce
from operator import add
f = lambda :[int(i) for i in input().split()]
debug = lambda *x:stderr.write(reduce(add,repr(x))+'\n')

x = int(input())
ans = 1
for i in range(1000):
    j = 2
    if i ** j <= x:
        ans = i ** j
print(ans)

Submission status: Wrong Answer

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

INPUT=int(input())
b=1
p=2
END=0

while True: 
    while True: 
        now_num = b**p
        if b == 1:
            end_num=now_num
            break
        elif p==2 and INPUT < now_num:
            END = 1
            break
        elif INPUT < now_num:
            if now_num > end_num:
                end_num = b**(p-1)
            break
        else:
            p+=1
        
    if END == 1:
        ans=end_num
        break
    b+=1
    p=2
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math
i = int(input())
list = []

for n in range(i):
    m = math.sqrt(n)
    m = math.floor(m)
    if n == m**2:
        print(n)
        list.append(n)

if i == 1:
    print('1')
else:
    print(list[-1])

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
for i in range(1,501):
	for j in range(1,11):
		b = i**j
		a.append(b)
a = list(set(a))
a.sort()
ans_list = []
for i in a:
    if i <= 1000:
        ans_list.append(i)

print(ans_list[-1])

Submission status: Wrong Answer

Solution code:
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    #biggest = int(math.sqrt(X))
    for i in range(2,X+1):
        bekijo = i
        count = 0
        while bekijo < X:
            bekijo = bekijo * i
            count = count +1
        if count > 1:
            mylist.append(int(bekijo/i))
    print(max(mylist))

Submission status: Wrong Answer

Solution code:
x = int(input())
ma = 0
for i in range(33):
    if x  < i ** 2:
        ma = (i-1) ** 2
        break
for i in range(13):
    if x <  i ** 3:
        max([ma,(i-1) ** 3])
        ma = max([ma,(i-1) ** 3])
        break
for i in range(6):
    if x < i ** 5:
        ma = max([ma, (i-1) ** 5])
        break

Submission status: Wrong Answer

Solution code:
import math
i = int(input())
list = []

for n in range(i):
    m = math.sqrt(n)
    m = math.floor(m)
    if n == m**2:
        list.append(n)

if i == 1:
    print('1')
else:
    print(list[-1])

Submission status: Wrong Answer

Solution code:
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    #biggest = int(math.sqrt(X))
    for i in range(2,X+1):
        bekijo = i
        count = 0
        while bekijo < X:
            bekijo = bekijo * i
            count = count +1
        if count > 2:
            mylist.append(int(bekijo/i))
    print(max(mylist))

Submission status: Wrong Answer

Solution code:
x = int(input())

m = 0
b = 1
p = 2

if x == 1:
    print(1)
else:
    while b <= x:
        p = 2
        while p <= x:
            if b**p >= m  and b**p <= x:
                m = b**p
                p += 1
            else:
                break
        b += 1

    print(m)

Submission status: Wrong Answer

Solution code:
x = int(input())
ma = 0
for i in range(33):
    if x  < i ** 2:
        ma = (i-1) ** 2
        break
for i in range(13):
    if x <  i ** 3:
        max([ma,(i-1) ** 3])
        ma = max([ma,(i-1) ** 3])
        break
for i in range(6):
    if x < i ** 5:
        ma = max([ma, (i-1) ** 5])
        break

Submission status: Wrong Answer

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

X = int(input())
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X, i))
    if p < 2:
        break
    tmp = i ** p
    if tmp >= value:
        value = tmp

print(int(value))

Submission status: Wrong Answer

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

INPUT=int(input())
b=1
p=2
END=0

while True: 
    while True: 
        now_num = b**p
        if b == 1:
            end_num=now_num
            break
        elif p==2 and INPUT < now_num:
            END = 1
            break
        elif INPUT < now_num:
            end_num = b**(p-1)
            break
        else:
            p+=1
        
    if END == 1:
        ans=end_num
        break
    b+=1
    p=2
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
ans = 0
if x == 1:
    print(x)
    exit
for i in range(int(math.sqrt(x)), 1, -1):
    tans = i
    while tans <= x:
        tans *= i
        if tans == x:
            print(tans)
            exit
        else:
            continue
    ans = max(ans, tans//i)

print(ans)

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())

for i in range(1, 33):
    if X < (i * i):
        print((i-1) * (i-1))
        sys.exit()

Submission status: Wrong Answer

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

X = int(input())
value = 1

for i in range(2, X + 1):
    p = int(math.log(X, i))
    if p < 2:
        break
    tmp = i ** p
    if tmp >= value:
        value = tmp

print(value)

Submission status: Wrong Answer

Solution code:
x = int(input())

num = list(range(2,32))
print(num)

ans = 1
for i in range(len(num)):
  now = num[i]
  while now < x:
    now = now*num[i]
    if(now <= x and ans <= now):
      ans = now
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
ma = 0
for i in range(33):
    if x  < i ** 2:
        ma = (i-1) ** 2
        break
for i in range(13):
    if x <  i ** 3:
        max([ma,(i-1) ** 3])
        mb = max([ma,(i-1) ** 3])
        break
for i in range(6):
    if x < i ** 5:
        ma = max([ma, (i-1) ** 5])
        break
for i in range(4):
    if x  < i ** 7:
        ma = max([ma,(i-1) ** 5])
        break
print(ma)

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())

for i in range(33):
    if X < (i * i):
        print((i-1) * (i-1))
        sys.exit()

Submission status: Wrong Answer

Solution code:
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    #biggest = int(math.sqrt(X))
    for i in range(2,X):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
        if bekijo == X:
            mylist.append(X)
        else:
            mylist.append(int(bekijo/i))
    print(max(mylist))

Submission status: Wrong Answer

Solution code:
x=int(raw_input())
i=1
while i**2<=x:
    i+=1
    b=i-1
if(i**2<=x): print i**2
else: print b**2

Submission status: Wrong Answer

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

X = int(input())
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X, i))
    if p < 2:
        break
    tmp = i ** p
    if tmp >= value:
        value = tmp

print(value)

Submission status: Wrong Answer

Solution code:
X = int(input())
 
l = [1 for i in range(1001)]
k = 0
for i in range(1,32):
    for j in range(2,10):
        tmp = i ** j
        if tmp < 1000:
            l[k] = tmp
            k += 1
        else :
            break
 
l.sort()
for i in range(1001):
    if X < l[i]:
        print(l[i-1])
        break
else :
    print(l[-1])

Submission status: Wrong Answer

Solution code:
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = [1]
    biggest = int(math.sqrt(X))
    for i in range(2,biggest):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
        if bekijo == X:
            mylist.append(X)
        else:
            mylist.append(int(bekijo/i))
    print(max(mylist))

Submission status: Wrong Answer

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

# X = int(input())
X = 50
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X, i))
    if p < 2:
        break
    tmp = i ** p
    if tmp >= value:
        value = tmp

print(value)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
print (max(math.floor(math.sqrt(N))**2,math.floor(pow(N,1/3))**3),math.floor(pow(N,1/4))**4,math.floor(pow(N,1/5))**5)

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):
    if i**j <= X and i**j > ans:
      ans = i**j
      break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

X = int(raw_input())

max = 0
for i in range(1, X + 1):
    if math.sqrt(i).is_integer():
        max = i

print(max)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
print (max(math.floor(math.sqrt(N))**2,math.floor(pow(N,1/3))**3))

Submission status: Wrong Answer

Solution code:
x = int(input())

sosu = [2,3,5,7,11,13,17,19,23,29,31]

ans = 1
for i in range(len(sosu)):
  now = sosu[i]
  while now < x:
    now = now*sosu[i]
    if(now <= x and ans <= now):
      ans = now
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
 
l = [1 for i in range(1001)]
k = 0
for i in range(32):
    for j in range(2,10):
        tmp = i ** j
        if tmp < 1000:
            l[k] = tmp
            k += 1
        else :
            break
 
l.sort()
for i in range(1001):
    if X < l[i]:
        print(l[i-1])
        break
else :
    print(l[-1])

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())

for i in range(32):
    if X < i * i:
        print((i-1) * (i-1))
        sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(32):
    if X < i * i:
        print((i-1) * (i-1))

Submission status: Wrong Answer

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

INPUT=int(input())
b=1
p=2
END=0
while True:
    while True:
        now_num = b**p
        if b == 1:
            end_num=now_num
            break
        elif p==2 and INPUT < now_num:
            END = 1
            break
        elif INPUT < now_num:
            end_num = b**(p-1)
            break
        else:
            p+=1
        
    if END == 1:
        ans=end_num
        break
    b+=1
    p=2
    
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:
inputX = int(input())
maxNumber = 1
if inputX <= 3:
    maxNumber = 1
else:
    for i in range(2, 33):
        if inputX == 2:
            for i1 in range(2, 10):
                if i ** i1 <= inputX:
                    if i ** i1 > maxNumber:
                        maxNumber = i ** i1
        elif inputX == 3:
            for i1 in range(2, 7):
                if i ** i1 <= inputX:
                    if i ** i1 > maxNumber:
                        maxNumber = i ** i1
        elif inputX <= 5:
            for i1 in range(2, 5):
                if i ** i1 <= inputX:
                    if i ** i1 > maxNumber:
                        maxNumber = i ** i1
        elif inputX <= 10:
            for i1 in range(2, 4):
                if i ** i1 <= inputX:
                    if i ** i1 > maxNumber:
                        maxNumber = i ** i1
        else:
            if i ** 2 <= inputX:
                if i ** 2 > maxNumber:
                    maxNumber = i ** 2


print (maxNumber)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
ans = int(math.sqrt(x))
print(ans**2)

Submission status: Wrong Answer

Solution code:
x = int(input())

max = 1
for i in range(1, x):
    for j in range(2, x):
        k = pow(i, j)
        if k <= x:
            max = k
        else:
            break

print(max)

Submission status: Wrong Answer

Solution code:
from math import sqrt
x = int(input())
x2 = int(sqrt(x))
ans = 0
for i in range(x2):
  for k in range(x2):
    tmp = (i+1)**(k+2)
    if tmp<x and ans<tmp:
      ans = tmp
print(ans)

Submission status: Wrong Answer

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

X = int(input())
b = 1
value = 1

for i in range(2, X + 1):
    p = math.floor(math.log(X) / math.log(i))
    if p < 2:
        break
    tmp = i ** p
    if tmp >= value:
        b = i
        value = tmp

print(value)

Submission status: Wrong Answer

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

a = []
b = []
for i in range(8):
    a.append(math.floor(math.pow(x,(1.0/(i+2)))))

for i in range(8):
    b.append(math.pow(a[i],(i+2)))
tmp = 0
for i in range(8):
    if tmp < b[i]:
        tmp = b[i]

print(math.floor(tmp))

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
log_x=int(math.log(x,2))
cand=[0 for i in range(x)]
cand[0]=1
for i in range(2,x):
    cand[i]=int(pow(x,1.0/i))**i
print(max(cand))

Submission status: Wrong Answer

Solution code:
inputX = int(input())
maxNumber = 1
if inputX <= 3:
    maxNumber = 1
else:
    for i in range(2, 33):
        if inputX == 2:
            for i1 in range(2, 10):
                if i ** i1 <= inputX:
                    maxNumber = i ** i1
        elif inputX == 3:
            for i1 in range(2, 7):
                if i ** i1 <= inputX:
                    maxNumber = i ** i1
        elif inputX <= 5:
            for i1 in range(2, 5):
                if i ** i1 <= inputX:
                    maxNumber = i ** i1
        elif inputX <= 10:
            for i1 in range(2, 4):
                if i ** i1 <= inputX:
                    maxNumber = i ** i1
        else:
            if i ** 2 <= inputX:
                maxNumber = i ** 2


print (maxNumber)

Submission status: Wrong Answer

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

a = []
b = []
for i in range(7):
    a.append(math.floor(math.pow(x,(1.0/(i+2)))))

for i in range(7):
    b.append(math.pow(a[i],(i+2)))
tmp = 0
for i in range(7):
    if tmp < b[i]:
        tmp = b[i]

print(math.floor(tmp))

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
log_x=int(math.log(x,2))
cand=[0 for i in range(x)]
cand[0]=1
for i in range(2,log_x+1):
    cand[i]=int(pow(x,1.0/i))**i
print(max(cand))

Submission status: Wrong Answer

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

a = []
b = []
for i in range(7):
    a.append(math.floor(math.pow(x,(1.0/(i+2)))))

for i in range(7):
    b.append(math.pow(a[i],(i+2)))
tmp = 0
for i in range(7):

    if tmp < b[i]:
        tmp = b[i]

print(tmp)

Submission status: Wrong Answer

Solution code:
X = int(input())
max = 1
for i in range(1,X+1):
    for j in range(2,i+1):
        for k in range(2,j+1):
            if j ** k == i:
                max = i
            if j ** k > i:
                break
print(max)

Submission status: Wrong Answer

Solution code:
x=int(raw_input())
a=x**(1.0/2)
a=a-a%1
print("%d"%a**2)