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())
ans = 0
for a in range(int(math.sqrt(x)+2)):
    for b in range(2, x):
        if a ** b <= x:
            ans = max(ans, a ** b)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(2,10):
  y=int(math.pow(x,1.0/float(i)))
  if max<y**i:
    max=y**i
print(max)

Submission status: Wrong Answer

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

for i in range(2,10):
  y=int(math.pow(x,1.0/float(i)))
  print(y**i)
  if max<y**i:
    max=y**i
print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print(len(bin(0x1000000000200000000000000100000000000000200000000000001000000000000020000000000001000000000000200000000000100000000000200010000001000000000020000000001000000000200008000100000000200000001000800020100001000000200000100012200001000020001000200110a010312&~-(1<<int(input()))))-3 or 1)

Submission status: Wrong Answer

Solution code:
X = int(input())

def is_exponential(n,j):
    tmp = 1

    while (tmp < j):
        tmp *= n
        if tmp == j:
            return 1
        elif tmp > j:
            return 0

j = X
while (j > 0):
    res = []
    for i in range(2, j):
        res.append(is_exponential(i,j))
    if sum(res) > 0:
        print(j)
        break
    j -= 1
print(X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_exp(num):
	for b in range(2, 33):
		num_copy = num
		counter = 0
		while not num_copy % b:
			num_copy /= b
		if num_copy == 1:
			return True
	else:
		return False

N = int(input())
if N <= 3:
	print(1)
else:
	for num in range(N,0,-1):
		if is_exp(num):
			print(num)
			break

Submission status: Wrong Answer

Solution code:
prime_list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31)

def is_exp(num):
	for prime in prime_list:
		counter = 0
		while not num % prime:
			num /= prime
			counter += 1
		if counter % 2:
			return False
	else:
		if num == 1:
			return True
		else:
			return False

N = int(input())
if N <= 3:
	print(1)
else:
	for num in range(N,0,-1):
		if is_exp(num):
			print(num)
			break

Submission status: Wrong Answer

Solution code:
import math

x=int(input())
ma=1

for i in range(2,int(x**0.5)+1):
    lo=int(math.log(x,i))
    a=i**lo
    #b=i**(lo+1)
    if a<=x :
        ma=max(ma,a)
    #if b<=x :
    #    ma=max(ma,b)

print(ma)

Submission status: Wrong Answer

Solution code:
import math

x=int(input())
ma=1

for i in range(2,int(x**0.5)+1):
    lo=int(math.log(x,i))
    c=i**(lo-1)
    a=i**lo
    b=i**(lo+1)
    if a<=x :
        ma=max(ma,a)
    if b<=x :
        ma=max(ma,a)
    if c<=x :
        ma=max(ma,c)

print(ma)

Submission status: Wrong Answer

Solution code:
import math

x=int(input())
ma=1

for i in range(2,int(x**0.5)+1):
    lo=int(math.log(x,i))
    a=i**lo
    b=i**(lo+1)
    if a<=x :
        ma=max(ma,a)
    if b<=x :
        ma=max(ma,a)

print(ma)

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())
if X >= 32*32:
    print(32)
elif X >= 31*31:
    print(31**2)
elif X >= 30*30:
    print(30**2)
elif X >= 29*29:
    print(29**2)
elif X >= 28*28:
    print(28**2)
elif X >= 27*27:
    print(27**2)
elif X >= 26*26:
    print(26**2)
elif X >= 25*25:
    print(25**2)
elif X >= 24*24:
    print(24**2)
elif X >= 23*23:
    print(23**2)
elif X >= 22*22:
    print(22**2)
elif X >= 21*21:
    print(21**2)
elif X >= 20*20:
    print(20**2)
elif X >= 19*19:
    print(19**2)
elif X >= 18*18:
    print(18**2)
elif X >= 17*17:
    print(17**2)
elif X >= 16*16:
    print(16**2)
elif X >= 15*15:
    print(15**2)
elif X >= 14*14:
    print(14**2)
elif X >= 13*13:
    print(13**2)
elif X >= 12*12:
    print(12**2)
elif X >= 11*11:
    print(10**2)
elif X >= 9*9:
    print(9**2)
elif X >= 8*8:
    print(8**2)
elif X >= 7*7:
    print(7**2)
elif X >= 6*6:
    print(6**2)
elif X >= 5*5:
    print(5**2)
elif X >= 4*4:
    print(4**2)
elif X >= 3*3:
    print(3**2)
elif X >= 2*2:
    print(2**2)
else:
    print(1**2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
exponential = 1
while pow(exponential, 2) <= x:
    exponential += 1

print(pow(exponential-1, 2))

Submission status: Wrong Answer

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

X=int(input())
lis=[]
ans=1
for i in range(2,32):
    d=2
    while i**d<=X:
        lis.append(i**d)
        d+=1
lis.sort()
for j in range(len(lis)):
    if lis[j]>X:
        ans=lis[j-1]
        break
if X<=3:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

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

X=int(input())
lis=[]
ans=1
for i in range(2,32):
    d=2
    while i**d<=X:
        lis.append(i**d)
        d+=1
lis.sort()
for j in range(len(lis)):
    if lis[j]>X:
        ans=lis[j-1]
        break
if X<=3:
    print(1)
else:
    print(ans)
print(lis)

Submission status: Wrong Answer

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

X=int(input())
lis=[]
ans=1
for i in range(2,32):
    d=2
    while i**d<=1000:
        lis.append(i**d)
        d+=1
lis=list(set(lis))
lis.sort()
for j in range(len(lis)):
    if lis[j]>X:
        ans=lis[j-1]
        break
if X<=3:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

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

X=int(input())
lis=[]
ans=1
for i in range(2,32):
    d=2
    while i**d<=1000:
        lis.append(i**d)
        d+=1
lis=list(set(lis))
lis.sort()
for j in range(len(lis)):
    if lis[j]>X:
        ans=lis[j-1]
        break
if X<=3:
    print(1)
else:
    print(ans)
print(lis)

Submission status: Wrong Answer

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

X=int(input())
lis=[]
ans=1
for i in range(2,32):
    d=2
    while i**d<=1000:
        lis.append(i**d)
        d+=1
lis.sort()
for j in range(len(lis)):
    if lis[j]>X:
        ans=lis[j-1]
        break
if X<=3:
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
#97a
n = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
print(array[-1])

Submission status: Wrong Answer

Solution code:
#97b
x=int(input())
ans=((x**.5)//1)**2
print(int(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
array = []
for i in range(2,33):
  for j in range(10):
    a = i**j
    if a <= n:
      array.append(a)
array.sort(reverse=True)
print(array[0])

Submission status: Wrong Answer

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

import numpy as np
import math

x = int(input())

num = 1
max_num = 0
while True:
    if math.modf(np.sqrt(num))[0] == 0.0:
        if x >= num:
            max_num = num
        else:
            break
    num += 1
print(max_num)

Submission status: Wrong Answer

Solution code:
import math
#X = int(input())
b = [0 for i in range(1001)]
for i in range(2, 1001):
    j = i * i
    while j < 1001:
        if b[j] == 1:
            break
        b[j] = 1
        j *= i

X = int(input())
for i in range(X, 0, -1):
    if b[i] == 1:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
import math
#X = int(input())
b = []
for i in range(1001):
    if math.sqrt(i) - int(math.sqrt(i)) > 0:
        b.append(0)
    else:
        b.append(1)
b[0] = 0

X = int(input())
for i in range(X, 0, -1):
    if b[i] == 1:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
L = []
ANS = []
for i in range(1,33) :
    for j in range(2,11) :
        if i**j <= 1192 :
            l = i**j
            L.append(l)
L = list(set(L))
L = sorted(L)
for j in range(len(L)) :
    if L[j] <= X < L[j+1] :
        ans = L[j]
        ANS.append(ans)
print(max(ANS))
print(L)

Submission status: Wrong Answer

Solution code:
X = int(input())
L = []
for i in range(1,33) :
    l = i**2
    L.append(l)
for j in range(len(L)) :
    if L[j] <= X < L[j+1] :
        print(L[j])
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
s=0
for i in range(33):
    if X >= i**2 :
        s = i**2
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
for i in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]:
  if i < 11:
    for j in range(2, 10):
      a.append(i ** j)
  else:
    a.append(i ** 2)
a = sorted(a)
for n in a:
  if x == 1:
    print(1)
    exit()
  if x < n:
    print(a[a.index(n) - 1])
    exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
for i in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]:
  if i < 11:
    for j in range(1, 10):
      a.append(i ** j)
  else:
    for k in range(1, 3):
      a.append(i ** k)
a = sorted(a)
for n in a:
  if x == 1:
    print(1)
    exit()
  if x < n:
    print(a[a.index(n) - 1])
    exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

maxInt = 1

i = 2
while i * i <= x:
	exp = i * i
	while exp <= x:
		exp *= i
	else:
		maxInt = max(maxInt, exp)
		i += 1
print(maxInt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

def main():
    X = int(input())
    for b in range(X, 0, -1):
        for p in range(10, 1, -1):
            if b ** p <= X:
                print(b ** p)
                return

    print(1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

li = []

for i in range(2,33):
	SUM = i
	while SUM <= 1000:
		SUM *= i
		li.append(SUM)

li = list(set(li))
li.sort()

N = int(input())
ind = bisect.bisect_left(li,N)
print(li[ind-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 1000

if n != 1:
    for b in range(2, 33):
        for p in range(2, 11):
            if n-b**p > 0:
                result = min(ans, b**p)

print(1 if n==1 else result)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, 33):
    if n == i*i:
        print(i*i)
        break
    elif n < i*i:
        print((i-1)*(i-1))
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
list_all = [1]
for i in range(2,x):
    if i**2 >x:break
    list_all.append(max([i**j for j in range(2,x) if x > i**j]))
print(max(list_all))

Submission status: Wrong Answer

Solution code:
x=int(input())
j = 0
list_n = [i**2 for i in range(1,x+1)]
while x > list_n[j]:
    j += 1
print(list_n[j-1])

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 0
while(ans ** 2 <= X):
  ans += 1
print((ans-1)**2)

Submission status: Wrong Answer

Solution code:
x = int(input())

for x_i in range(x, 0, -1):
    for j in range(2, x_i):
        n = 0
        while n**j < x_i:
            n += 1
        if n**j == x_i:
            print(x_i)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for x_i in range(x, 0, -1):
    n = 0
    while n**2 < x_i:
        n += 1
    if n**2 == x_i:
        print(n**2)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

for x_i in range(x, 0, -1):
    n = 1
    while n**2 < x_i:
        n += 1
    if n**2 == x_i:
        print(n**2)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
L = []
for i in range(31) :
    l = (i+1)**2
    L.append(l)
for j in range(len(L)) :
    if 999 >= X >= 961 :
        print(961)
        break
    elif X == 1000 :
        print(1000)
        break
    elif X - L[j] >= 0 and X - L[j+1] < 0 :
        print(L[j])

Submission status: Wrong Answer

Solution code:
X = int(input())
L = []
for i in range(31) :
    l = (i+1)**2
    L.append(l)
for j in range(len(L)) :
    if X >= 961 :
        print(961)
        break
    elif X - L[j] >= 0 and X - L[j+1] < 0 :
        print(L[j])

Submission status: Wrong Answer

Solution code:
X = int(input())
L =  []
for i in range(31) :
    l = (i+1)**2
    L.append(l)
for j in range(len(L)) :
    if 1 <= X <= 3 :
        print(1)
    elif 961<= X <= 1000 :
        print(961)
    else :
        if L[j]<= X < L[j+1]:
            print(L[j])

Submission status: Wrong Answer

Solution code:
X = int(input())
L =  []
for i in range(31) :
    l = (i+1)**2
    L.append(l)
for j in range(len(L)) :
    if X == 1 :
        print(1)
        break
    elif X >= 961 :
        print(961)
        break
    else :
        if L[j] <= X < L[j+1] :
            print(L[j])

Submission status: Wrong Answer

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

if n < 4:
    print(1)
else:
    i_range =  math.floor(math.sqrt(n)+0.00001)
    for i in range(2,i_range+1):
        log_n = math.floor(math.log(n,i))
        exp = i ** log_n
        if exp > ans:
            ans = exp
    print(ans)

Submission status: Wrong Answer

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

if n < 4:
    print(1)
else:
    i_range =  math.floor(math.sqrt(n))
    for i in range(2,i_range+1):
        log_n = math.floor(math.log(n,i))
        exp = i ** log_n
        if exp > ans:
            ans = exp
    print(ans)

Submission status: Wrong Answer

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

if n < 4:
    print(1)
else:
    i_range =  math.floor(math.sqrt(n))
    for i in range(2,i_range+1):
        log_n = math.floor(math.log(n,i))
        exp = i ** log_n
        if exp > ans:
            ans = exp
    print(ans)

Submission status: Wrong Answer

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

i_range =  math.floor(math.sqrt(n))
for i in range(2,i_range+1):
    log_n = math.floor(math.log(n,i))
    exp = i ** log_n
    if exp > ans:
        ans = exp
print(ans)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n=int(input())
n=int(pow(n,1/2))
print(pow(n,2))

Submission status: Wrong Answer

Solution code:
x = int(input())
lis = [1,4,8,16,32,64,128,256,512,9,27,81,243,729,25,125,625,49,343,121,169,289,361,529,841,961]
lis.sort(reverse=True)
for nums in lis:
  if x >= nums:
    print(nums)
    break

Submission status: Wrong Answer

Solution code:
x = int(input())
output = 0
for i in range(2, x+1):
    for j in range(2, x+1):
        a = i ** j
        if a > output and a <= x:
            output = a
print(output)

Submission status: Wrong Answer

Solution code:
import sys 
import math

X = int(input())
#a = list(map(int, input().split(" ")))
a = [0 for i in range(X+1)]

a[1] = 1

for i in range(2,int(math.sqrt(X))+1):
    num = i*i
    while num <= X:
        a[num]=1
        num *= num

for i in range(1,X+1):
    if a[i] == 1:
        ans = i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

Submission status: Wrong Answer

Solution code:
x=int(input())
a=set([1])
for p in range(2,x):
    a=sorted(set(list(a)+[b**p for b in range(1,x)]))
    if len(a)>x:a=[i for i in a if i<=x];break
print(max(a))

Submission status: Wrong Answer

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

def main():
    #入力
    X = int(input())

    exp_list = [1]
    i = 2
    flag = 0

    while True:
        j = 2
        while True:
            if i ** j < X:
                exp_list.append(i ** j)
                j += 1
            elif i ** 2 > X:
                flag = 1
                break
            else:
                break
        i += 1
        if flag == 1:
            break
    
    print(max(exp_list))

        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = [1]
for i in range(2, 40):
	for j in range(2,12):
		k = i ** j
		if k < 1000:
			list.append(k)
		else:
			break
list.sort()
N = len(list)
K = int(input())
max = 1
for j in range(N):
	if K < list[j]:
		break
	else:
		max = list[j]
print(max)

Submission status: Wrong Answer

Solution code:
list = [1]
for i in range(2, 40):
	for j in range(2,12):
		k = i ** j
		if k < 1000:
			list.append(k)
		else:
			break
list.sort()
print(list)
N = len(list)
K = int(input())
max = 1
for j in range(N):
	if K < list[j]:
		break
	else:
		max = list[j]
print(max)

Submission status: Wrong Answer

Solution code:
list = [1]
for i in range(2, 35):
	for j in range(2,12):
		k = i ** j
		if k < 1000 and not k in list:
			list.append(k)
		else:
			break
list.sort()
N = len(list)
K = int(input())
max = 1
for j in range(N):
	if K < list[j]:
		break
	else:
		max = list[j]
print(max)

Submission status: Wrong Answer

Solution code:
list = [1]
for i in range(2, 32):
	for j in range(2,10):
		k = i ** j
		if k < 1000 and not k in list:
			list.append(k)
		else:
			break
list.sort()
N = len(list)
K = int(input())
max = 1
for j in range(N):
	if K < list[j]:
		break
	else:
		max = list[j]
print(max)

Submission status: Wrong Answer

Solution code:
from math import sqrt
from math import floor

x = int(input())
xr = int(sqrt(x))

l=[1]
for i in range(1,xr+1):
    t=[]
    for j in range(1,xr):
        if i**j < x:
            t.append(i**j)
        else:
            continue
    l = l+t
l = list(set(l))
l.sort()


left=0
right=len(l)-1
center=0
while right-left > 1:
    center = (left+right)//2
    if l[center] == x:
        break
    elif l[center] > x:
        right = center
    else:
        left = center

for i in [right,center,left]:
    if i < x:
        print(l[i])
        break

Submission status: Wrong Answer

Solution code:
from math import sqrt
from math import floor

x = int(input())
x = floor(sqrt(x))
print(x**2)

Submission status: Wrong Answer

Solution code:
from math import sqrt

x = int(input())
x = int(sqrt(x))
print(x**2)

Submission status: Wrong Answer

Solution code:
N=int(input())
b = []
if N <= 3:
	print(1)
	exit()
i = 2
while True:
	a = int(N**(1.0/float(i)))
	b.append(a**i)
	if N **(1/i) < 2:
		break
	i = i+1
print(max(b))

Submission status: Wrong Answer

Solution code:
N=int(input())
b = []
if N <= 3:
	print(1)
	exit()
i = 2
while True:
	a = int(N**(1/i))
	b.append(a**i)
	if N **(1/i) < 2:
		break
	i = i+1
print(max(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
results = []
for j in range(2, 11):
    for i in range(n):
        if i ** j < n:
            results.append(i ** j)
print(max(results))

Submission status: Wrong Answer

Solution code:
n = int(input())
for j in range(2, 11):
    for i in range(n):
        if i ** j > n:
            break
print((i - 1) ** j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt

X = int(input())
ans = X
while True:
    root = sqrt(ans)
    if root.is_integer():
        print(ans)
        break
    ans -= 1

Submission status: Wrong Answer

Solution code:
x=int(input())

a=1
while a**2<=x:
    a+=1
b=1
while b**3<=x:
    b+=1
ans=max((a-1)**2,(b-1)**3)
if 32<=x:
    ans=max(ans,32)
if 273<=x:
    ans=max(ans,273)
if 128<=x:
    ans=max(ans,128)
print(ans)

Submission status: Wrong Answer

Solution code:
def beki(n,X):
    # the maximum of the form n**k under X
    x = 1
    while x*n <= X:
        x *= n
    if x == n:
        return 1
    else:
        return(x)

X = int(input())
a = 1

for n in range(X)[2:]:
    b = beki(n,X)
    print(n,b)
    if b > a:
        a = b

print(a)

Submission status: Wrong Answer

Solution code:
x=int(input())
def beki(n):
    for i in range(2,32):
        if n%i==0:
            t=0
            while n>=1:
                n/=i
                if n==1 and t>=1:
                    return True
                if n<1:
                    return False
                t+=1
y=1
for i in range (1,x+1):
    if beki(i)==True:
        y=i
print(y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 1
for b in range(1, 100):
  for p in range(1, 10):
    if ans < pow(b, p) and pow(b, p) <= X:
      ans = pow(b, p)
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

i = 0
while True:
    if (i+1)**2 <= x:
        i += 1
    else:
        break
print(i**2)

Submission status: Wrong Answer

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

for i in range(2, x):
    sum = i
    while sum * i <= 1000:
        sum = sum * i
        result.append(sum)

print(result)

Submission status: Wrong Answer

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

def solve(X):
	# b^p = xとなるxを探す
    for x in range(X, 1, -1):
        for b in range(2, x):
            p = math.log(x, b)
            if float.is_integer(p):
                return x
    return 1

if __name__ == "__main__":
    X = int(input())
    print(solve(X))

Submission status: Wrong Answer

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

def solve(X):
	ans = X
	# b^p = ansとなるansを探す
	for b in range(2, X):
		p = math.log(ans, b)
		if float.is_integer(p):
			return ans
	return 1

if __name__ == "__main__":
	X = int(input())
	print(solve(X))

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
y = math.sqrt(x)
z = math.floor(y)
w = z * z
print(w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
X = int(raw_input())
print max([1]+[i**int(math.log(X, i)) for i in xrange(2, int(math.sqrt(X))+1) if int(math.log(X, i))>=2])

Submission status: Wrong Answer

Solution code:
import math
X = int(raw_input())
print max([1]+[i**int(math.log(X, i)) for i in xrange(2, int(math.sqrt(X))+1)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
X=int(input())

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

max=0
kari=[]
for i in arr:
	n=0
	while True:
		if i**n<=X:
			if n>=2:
				kari.append(i**n)
			n=n+1
		else:
			break

kari=np.array(kari)
if len(kari)==0:
	print(1)
else:
	print(np.max(kari))

Submission status: Wrong Answer

Solution code:
X=int(input())

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

max=0
for i in arr:
	n=0
	while(True):
		if (i**n>X) and (n>=1):
			if max<i**(n-1):
				max=i**(n-1)
			break
		elif (i**n<=X):
			n=n+1
print(max)

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 0
for i in range(2,X):
    if pow(i,2) > X:
        break
    p = 2
    while pow(i,p) <= X:
        ans = max(ans,pow(i,p))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 0
for i in range(1,n+1):
    for k in range(2,1+n):
        num = i**k
        if num > n:
            break
        if num <= n :
            res = max(res,num)
    
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 0
for i in range(1,n+1):
    for k in range(2,1+n):
        num = i**k
        if num <= n :
            res = max(res,num)
    
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 0
for i in range(1,n+1):
    for k in range(1,1+n):
        num = i**k
        if num <= n :
            res = max(res,num)
    
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
res = 0
for i in range(n):
    for k in range(n):
        num = i**k
        if num <= n :
            res = max(res,num)
    
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
    for j in range(2,n):
        if n>=i**j >ans:
            ans = i**j
            print(ans,i,j)
        elif i**j > n:
            break
print(ans)

Submission status: Wrong Answer

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


for i in range(1001):
  l.append(i**2)

for i in range(a):
  if a == 1:
      print(a)
  elif a == 2:
      print(a)
  elif a == l[i]:
      print(l[i])
      break
  elif a-l[i] < 0:
      print(l[i-1])
      break

Submission status: Wrong Answer

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


for i in range(1000):
  l.append(i**2)

for i in range(a):
  if a == 1:
      print(a)
  elif a == 2:
      print(a)
  elif a == l[i]:
      print(l[i])
      break
  elif a-l[i] < 0:
      print(l[i-1])
      break

Submission status: Wrong Answer

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

for i in range(1000):
  l.append(i**2)

for i in range(a):
    if a == 1:
        print(a)
    elif a == l[i]:
        print(l[i])
        break
    elif a-l[i] < 0:
        print(l[i-1])
        break

Submission status: Wrong Answer

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

for i in range(a):
  l.append(i**2)

for i in range(a):
    if a == 1:
        print(a)
    elif a == l[i]:
        print(l[i])
        break
    elif a-l[i] < 0:
        print(l[i-1])
        break

Submission status: Wrong Answer

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

for i in range(a):
  l.append(i**2)

for i in range(a):
  if a-l[i] < 0:
    print(l[i-1])
    continue
  elif a == l[i]:
    print(l[i])
    break

Submission status: Wrong Answer

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

for i in range(a):
  l.append(i**2)

for i in range(a):
  if a-l[i] < 0:
    print(l[i-1])
    break
  else:
    print(l[i])
    break

Submission status: Wrong Answer

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

for i in range(a):
  l.append(i**2)

for i in range(a):
  if a-l[i] < 0:
    print(l[i-1])
    break

Submission status: Wrong Answer

Solution code:
import math


X = int(input())

p = 2
q = 2
tmp = 4

while p < math.sqrt(X):
    q = 2
    while 1:
        if p ** q > X:
            break
        else:
            if tmp < p ** q:
                tmp = p ** q        
            q += 1
    p += 1

print(tmp)

Submission status: Wrong Answer

Solution code:
import math

def calcPow(X):
    num = int(math.sqrt(X))
    Max = 0

    for i in range(2,num+1):
        for j in range(2,X):
            if(pow(i,j) > X):
                if(pow(i,j-1) > Max):
                    Max = pow(i,j-1)
                    break
                break

    return Max


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

    print(calcPow(X))

Submission status: Wrong Answer

Solution code:
#coding : utf8

import math

"""
@param {int}
@return {int}
"""
def calcPow(X):
    num = int(math.sqrt(X))
    print("num : " +str(num))
    Max = 0

    for i in range(2,num+1):
        for j in range(2,num+1):
            if(pow(i,j) > X):
                if(pow(i,j-1) > Max):
                    Max = pow(i,j-1)
                    break
                break

    return Max


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

    print(calcPow(X))

Submission status: Wrong Answer

Solution code:
#coding : utf8

import math

X = int(input())
halfX = int(math.sqrt(X))
double = pow(halfX,2)

print(double)

Submission status: Wrong Answer

Solution code:
N=int(input())
result = [1]
for i in range(2,1001):
  for j in range(1,11):
    if pow(i,j) <= N and pow(i,j) not in result:
      result.append(pow(i,j))
print(max(result))

Submission status: Wrong Answer

Solution code:
N=int(input())
result = [1]
for i in range(2,1001):
  for j in range(1,11):
    if pow(i,j) <= 1000 and pow(i,j) not in result:
      result.append(pow(i,j))
print(max(result))

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
i = 1
while True:
    if i * i <= x:
        a = i * i
        i += 1
    else:
        break
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
if X<4:print(1)
else:
    ans = 4
    for b in range(2,int(X**.5)+1):
        p = int(math.log(X,b))
        if p > 1:
            ans = max(ans, b**p)
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
if X<4:print(1)
else:print(max(b**int(math.log(X,b))for b in range(2,int(X**.5)+1)if int(math.log(X,b))>1))

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
if X==1:print(1)
else:print(max(b**int(math.log(X,b))for b in range(2,int(X**.5)+1)))