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 sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()
# ans = 0
# for b in range(1, 1000):
#     for p in range(2, 1000):
#         tmp = b ^ p
#         # print(tmp)
#         if tmp <= X:
#             ans = max(ans, tmp)
#             # print(tmp)
#         else:
#             break
# print(ans)
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

for x in range(X, 0, -1):
    prime = prime_decomposition(x)
    c = Counter(prime)
    # print(c.values())
    value = c.values()
    # print(v)
    for v in value:
        d = v
    if len(c) == 1 and d != 1:
        print(x)
        exit()
    if x == 1:
        print(x)
        exit()

Submission status: Wrong Answer

Solution code:
ls = [1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000]
X = int(input())
for i in range(len(ls)):
  if X<=ls[i]:
    print(ls[i])
    break

Submission status: Wrong Answer

Solution code:
x = int(input())
num = [i**2 for i in range(1,33)]
def binary_search(li,k):
    left = 0
    right = 33
    while left < right:
        mid = (left+right)//2
        if li[mid]<=x and x<li[mid+1]:
            return li[mid]
        elif li[mid] < x:
            left = mid+1
        else:
            right = mid
print(binary_search(num,x))

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[1]
for i in range(2,32):
  k=2
  while i**k<1000:
    l.append(i**k)
    k+=1
l=sorted(l)
for i in range(len(l)-1):
  if l[i]<=x<l[i+1]:
    print(l[i])
    exit()
print(961)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
i = 1
while True:
    if i ** 2 > x:
        break
    ans = i ** 2
    i += 1
print(ans)

Submission status: Wrong Answer

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

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())
print(math.floor(x**0.5) ** 2)

Submission status: Wrong Answer

Solution code:
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, ceil, floor
import numpy as np
from collections import defaultdict, deque
from operator import itemgetter
from bisect import bisect_left, bisect_right, insort_left, insort_right
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    n = int(input())
    ans = 1
    for i in range(1, int(n ** 0.5) + 1):
        if i ** 2 <= n:
            ans = i ** 2
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    x = int(input())
    i = 1
    while i*i <= x:
        i += 1
    print((i-1)*(i-1))
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
x = int(input())
tmp = int(x**0.5)+2
ans = 1

for i in range(1,tmp):
    for j in range(2,x//2):
        if x >= i**j:
            ans = i**j
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
tmp = int(x**0.5)+2
ans = 1

for i in range(1,tmp):
    for j in range(2,tmp):
        if x >= i**j:
            ans = i**j
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0
for i in reversed(range(x+1)):
    if x >= i**2:
        ans = i**2
        break
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
for i in range(N,1,-1): 
    if int(i**0.5)**2 == i:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
N=int(input())
for i in range(N,0,-1):
        if int(i**0.5)**2 == i:
            print(i)
            break

Submission status: Wrong Answer

Solution code:
import sys
# input処理を高速化する
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
expo = set()
for i in range(1, 32):
    for j in range(2, 10):
        if i ** j >= 1000:
            break
        expo.add(i ** j)
expo = sorted(list(expo), reverse=True)
for e in expo:
    if e <= N:
        print(e)
        exit()

Submission status: Wrong Answer

Solution code:
X=int(input())

max=X//2+1
r=0

for b in range(1,X):
  for p in range(2,X):
    r=b**p
    if r>=X:
      r=0
      break
    elif r>=max:
      max=r
      #print(b,p,r)
  if r>=X:
    break  

print(max)

Submission status: Wrong Answer

Solution code:
X = int(input())

res = 0
i=0
while True:
    tmp = i ** 2
    if tmp > X:
        break
    else:
        i+=1
        res = tmp
print(res)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
ans = 1
for i in range(int(math.sqrt(n))+1):
  for j in range(int(math.sqrt(n))+1):
    if i**j < n and ans < i ** j:
      ans = i**j
print(ans)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
ans = 0

for i in reversed(range(X+1)):
  num = int(math.sqrt(i))
  if num ** 2 == i and ans <= i or num ** 3 == i and ans <= i:
    ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
X=int(input())
i=2
beki=[]

while i<=X:
    j=2  
    while i**j<X:
        beki.append(i**j)
        j+=1
    i+=1
if len(beki)==0:
    print(1)
else:
    print(max(beki))

Submission status: Wrong Answer

Solution code:
X=int(input())
i=2
beki=[]

while i<=X:
    j=2  
    while i**j<X:
        beki.append(i**j)
        j+=1
    i+=1
if len(beki)==0:
    print(X)
else:
    print(max(beki))

Submission status: Wrong Answer

Solution code:
n=int(input())
import math
max_exp = 1
for i in range(2,10):
  teisuu = math.floor(n**(1/i))
  if max_exp < (teisuu**i):
    max_exp = teisuu**i
print(max_exp)

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
X = int(input())
ans = 0
for i in range(33):
    if i**2 <= X:
        ans = max(i**2,ans)

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(1,N+1)[::-1]:
    for j in range(2,35):
        if i%j == 0:
            if (i//j)%j == 0:
                print(i)
                break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x = int(input())
a = [1]
for i in range(2, -~1000):
    b = i**2
    while b <= x:
        a += [b]
        b *= i
print(a[-1])

Submission status: Wrong Answer

Solution code:
x = int(input())
while not (x**0.5).is_integer():
    x -= 1
print(x)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans_list = [1]

for i in range(2,x+1):
    cnt = 2
    while True:
        tmp = i ** cnt
        if tmp > x:
            break
        ans_list += [tmp]
        cnt += 1
        
    
ans_list.sort()

for i in ans_list[::-1]:
    print(i)
    if i <= x:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
ans_list = [1]

for i in prime:
    cnt = 2
    while True:
        tmp = i ** cnt
        if tmp > x:
            break
        ans_list += [tmp]
        cnt += 1
        
    
ans_list.sort()

for i in ans_list[::-1]:
    if i <= x:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
Max = 0
for i in range(2,3):
    b = int(X**(1/i))
    B = (b)**i
    if Max < B:
        Max = B
print(Max)

Submission status: Wrong Answer

Solution code:
X = int(input())
Max = 0
for i in range(2,10):
    b = int(X**(1/i))
    B = b**i
    if Max < B:
        Max = B
print(Max)

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

    for i in range(x, 1, -1):
        for j in range(2, int(i**0.5) + 1):
            if math.log(i, j).is_integer():
                print(i)
                exit()
    
    print(1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

    ans = [1]

    for i in range(2, x+1):
        for j in range(2, int(i**0.5) + 1):
            if math.log(i, j) % 1 == 0:
                ans.append(i)
    
    print(max(ans))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

    for i in range(x, 0, -1):
        for j in range(2, int(i**0.5) + 1):
            if math.log(i, j) % 1 == 0 and math.log(i, j) >= 2:
                print(i)
                exit()
    
    print(1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

    for i in range(x, 0, -1):
        for j in range(2, int(i**0.5) + 1):
            if math.log(i, j) % 1 == 0 and math.log(i, j) % 1 >= 2:
                print(i)
                exit()
    
    print(1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

# 素数判定関数
def isPrime(num):
    # 2未満の数字は素数ではない
    if num < 2: return False
    # 2は素数
    elif num == 2: return True
    # 偶数は素数ではない
    elif num % 2 == 0: return False

    # 3 ~ numまでループし、途中で割り切れる数があるか検索
    # 途中で割り切れる場合は素数ではない
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    # 素数
    return True

# 素数判定
def callIsPrime(input_num):
    numbers = []
    # ループしながら素数を検索する
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)
    return numbers
   

def myAnswer(X:int) -> int:
   prime = callIsPrime(X)
   ans = 1
   for p in prime:
      i = 2
      while True:
         if(p**i <= X):
            ans = max(p**i,ans)
            i += 1
         else:
            break
   return ans


def modelAnswer():
   tmp=1
def main():
   X = int(input())
   print(myAnswer(X))
if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
if X < 4:
    print(1)
    exit()
for x in range(X, 0, -1):
    for y in range(2, x, 1):
        log = math.log(x, y)
        div, mod = divmod(log, 1)
        if mod == 0:
            print(x)
            exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
if X < 4:
    print(1)
    exit()
for x in range(X, 0, -1):
    print("x:", x)
    for y in range(2, x, 1):
        print("y:", y)
        log = math.log(x, y)
        print("log:", log)
        div, mod = divmod(log, 1)
        if mod == 0:
            print(x)
            exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
for x in range(X, 0, -1):
    for y in range(2, x, 1):
        log = math.log(x, y)
        div, mod = divmod(log, 1)
        if mod == 0:
            print(x)
            exit()

Submission status: Wrong Answer

Solution code:
# solution
import io

nim = int(input())
mike = 1
for i in range(2,(nim+1)//2):
  kite = 0
  counter = 0
  while kite <= nim:
    m = max(mike,kite)
    kite = i**counter
    counter+=1
print(mike)

Submission status: Wrong Answer

Solution code:
List=[1]
for i in range(2,32):
  j=1
  while(i**j<=1000):
    List.append(i**j)
    j+=1
#print(List)
x=int(input())
for i in range(x,0,-1):
  if (List.count(i)>0):
    print(i)
    break

Submission status: Wrong Answer

Solution code:
import math
def main():
    X = int(input())
    ma = 1
    for i in range(1, X+1):
        for j in range(2, 33):
            p = math.log(i, j)
            if p.is_integer() == True and p >= 2:
                if ma < j**p:
                    ma = j**p
    print(int(ma))
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字

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

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
b = 1
for i in range(2, int(math.sqrt(x)) + 1):
    p = int(math.log(x, i))
    if p > 1:
        b = max(b, i ** p)
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
ans = 0

while ans <= n:
  x += 1
  ans = x**2

print((x-1)**2)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
ans = 0

while ans < n:
  x += 1
  ans = x**2

print((x-1)**2)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=set()
ans=0
for i in range(1,a+1):
    for j in range(1,i+1):
        for k in range(2,a):
            if j**k==i:
                ans=i
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0
for i in range(x + 1):
    if i * i > x: break
    ans = i * i
print(ans)

Submission status: Wrong Answer

Solution code:
import math


x = int(input())

ans = 0
for i in range(x):
    if i * i > x: break
    ans = i * i
print(ans)

Submission status: Wrong Answer

Solution code:
import math


x = int(input())

ans = 0
for i in range(x, -1, -1):
    tmp = math.sqrt(i)
    if math.sqrt(i).is_integer():
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
import math


x = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())
ans = 1
for b in range(1,101):
    for p in range(2,10):
        if X >= b**p and X > ans:
            ans = b**p
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,10):
        if i**j<=1000:
            li.append(i**j)
li2 = list(set(li))
li2.sort()
ans = 1
for k in range(len(li2)):
    if (li2[k-1]<=N)&(li2[k]>N):
        ans = li2[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,10):
        if i**j<=1000:
            li.append(i**j)
list(set(li)).sort()
ans = 1
for k in range(len(li)):
    if (li[k-1]<N)&(li[k]>=N):
        ans = li[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,50):
        if i**j<=1000:
            li.append(i**j)
li.sort()
ans = 1
for k in range(len(li)):
    if (li[k-1]<=N)&(li[k]>N):
        ans = li[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,50):
        if i**j<=1000:
            li.append(i**j)
li.sort()
ans = 1
for k in range(len(li)):
    if (li[k]>N)&(li[k-1]<N):
        ans = li[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,5):
        li.append(i**j)
li.sort()
ans = 1
for k in range(len(li)):
    if (li[k]>N)&(li[k-1]<N):
        ans = li[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,5):
        li.append(i**j)
li.sort()
ans = 0
for k in range(len(li)):
    if (li[k-1]<N)&(li[k]>N):
        ans = li[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = []
for i in range(2,100):
    for j in range(2,5):
        li.append(i**j)
li.sort()
ans = 0
for k in range(len(li)):
    if (li[k-1]<N)&(li[k]>N):
        ans = li[k-1]
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,int(x**0.5)+1):
    num = i
    num *= num
    while num <= x:
        l.append(num)
        num *= num
print(max(l))

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,32):
    num = i
    num *= num
    while num < x:
        l.append(num)
        num *= num
print(max(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1]
for i in range(2,int(x**0.5)+1):
    num = i
    num *= num
    while num < x:
        l.append(num)
        num *= num
print(max(l))

Submission status: Wrong Answer

Solution code:
x = int(input())

res = 0
for i in range(1, x+1):
  for j in range(2, x+1):
    cand = i ** j
    if x >= cand:
      if cand > res:
        res = cand
print(res)

Submission status: Wrong Answer

Solution code:
x = int(input())

res = 0
for i in range(1, x):
  for j in range(2, x):
    cand = i ** j
    if x >= cand:
      if cand > res:
        res = cand
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1,100)[::-1]:
  if i*i <= x:
    print(i*i)
    exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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

for j in reversed(range(X)):
    pf={}
    m=j
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:
        pf[m]=1

    if len(pf) == 1:
        for v in pf.values():
            if v>1:
                print(j)
                exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(x, 0, -1):
    if int(i**(1/2))**2==i:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

def solve(num):
    result = True
    for i in range(2, num+1):
        c = 0
        while num%i==0:
            c += 1
            num //= i
        if c%2==0:
            continue
        else:
            result = False
            break
    return result

for i in range(x, 0, -1):
    if solve(i)==True:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

def solve(num):
    a = num
    result = []
    x = []
    for i in range(2, num+1):
        if num%i==0:
            c = 0
            while num%i==0:
                num //= i
                c += 1
            result.append(c)
        if num==1:
            break
    
    return all(i%2==0 and i > 0 for i in result)

for i in range(x, 0, -1):
    if solve(i):
        print(i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

def solve(num):
    a = num
    result = []
    x = []
    for i in range(2, int(num**(1/2))+1):
        if num%i==0:
            c = 0
            while num%i==0:
                num //= i
                c += 1
            result.append(c)
    if num!=1:
        result.append(1)
    return all(i%2==0 for i in result)

for i in range(x, 0, -1):
    if solve(i):
        print(i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

def solve(num):
    a = num
    result = []
    x = []
    for i in range(2, int(num**(1/2))+1):
        if num%i==0:
            c = 0
            while num%i==0:
                num //= i
                c += 1
            result.append(c)
    if num!=1:
        result.append(1)
    return all(i%2==0 for i in result)

for i in range(x, 0, -1):
    if solve(i):
        print(i)
        break
if i==1:
    print(1)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = list()
a.append(1)
for i in range(2,32):
    j = 2  
    while i**j<1000:
        a.append(i**j)
        j= j+1
a = sorted(a)[::-1]
for i in range(len(a)):
    if a[i]<=x:
        print(a[i])
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
a = list()
for i in range(2,32):
    j = 2  
    while i**j<1000:
        a.append(i**j)
        j= j+1
a = sorted(a)[::-1]
for i in range(len(a)):
    if a[i]<x:
        print(a[i])
        break

Submission status: Wrong Answer

Solution code:
import sys

def resolve():
    X = int(input())
    cands = [1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000]
    for i in range(len(cands)):
        if cands[i] > X:
            print(cands[i-1])
            return

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
# from sys import stdin
import math

X = int(input())

# for i in range(33):
ans = 0
for i in range(int(math.sqrt(X))+1):
    for x in range(11):
        
        if i**x < X and i**x > ans:
            ans = i**x
print(ans)

Submission status: Wrong Answer

Solution code:
# from sys import stdin
import math

X = int(input())

# for i in range(33):
ans = 0
for i in range(int(math.sqrt(X))+1):
    for x in range(11):
        print(i,x)
        if i**x < X and i**x > ans:
            ans = i**x
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
while True:
  if (n**0.5).is_integer():
    print(n)
    break
  else:
    n -= 1

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
i_max = math.floor(math.sqrt(X))

result = 1
for i in range(2,i_max+1,1):
    for j in range(1,X):
        n = (i**j)
        if (n > X):
            break
        else:
            result = max(result, n)

print("result =",result)

Submission status: Wrong Answer

Solution code:
import numpy as np

x = int(input())

ans_root = int(np.sqrt(x))

print(ans_root**2)

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
if (x == 1000):
    print(1000)
    sys.exit()
list = []
list.append(1)
for i in range(30):
    tmp = (i+2)**2
    while (tmp <= 1000):
        list.append(tmp)
        tmp = tmp*(i+2)
list.sort()
tmp = list[0]
print(list)
for i in list:
    if (i > x):
        print(tmp)
        sys.exit()
    tmp = i

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
list = []
list.append(1)
for i in range(30):
    tmp = (i+2)**2
    while (tmp <= 1000):
        list.append(tmp)
        tmp = tmp*(i+2)
list.sort()
tmp = list[0]
for i in list:
    if (i > x):
        print(tmp)
        sys.exit()
    tmp = i

Submission status: Wrong Answer

Solution code:
x = int(input())
kouho = [1]
for i in range(2,32):
    j = 2
    while i**j<=x:
        kouho.append(i**j)
        j += 1
print(kouho)
print(max(kouho))

Submission status: Wrong Answer

Solution code:
x = int(input())
vis = [False for _ in range(x+1)]
vis[1] = True
for i in range(2,x+1):
  tmp = i*i
  while tmp < x+1:
    vis[tmp] = True
    tmp *= i
best = 1
for i in range(1,x+1):
  if vis[i]:
    best = i
print(i)

Submission status: Wrong Answer

Solution code:
x = int(input())
vis = [False for _ in range(1001)]
vis[1] = True
for i in range(2,1001):
  tmp = i*i
  while (tmp < 1001):
    vis[tmp] = True
    tmp *= i
best = 0
for i in range(x+1):
  if vis[i] and i > best:
    best = i
print(i)

Submission status: Wrong Answer

Solution code:
x = int(input())
vis = [False for _ in range(1001)]
vis[0] = True
vis[1] = True
for i in range(2,1001):
  tmp = i
  while (tmp < 1001):
    vis[tmp] = True
    tmp *= i
best = 0
for i in range(x+1):
  if vis[i] and i > best:
    best = i
print(i)

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[1]
for i in range(2,int(x**0.5)+1):
    j=1
    while i**(j+1)<=x:
        j+=1
    l.append(i**j)

print(l)
print(max(l))

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[1]
for i in range(2,int(x**0.5)+1):
    j=1
    while i**(j+1)<x:
        j+=1
    l.append(i**j)

#print(l)
print(max(l))

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[1]
for i in range(2,int(x**0.5)+1):
    l.append(int(x**(1/i))**2)

print(max(l))

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=b**p
        else: break
print(ans)

Submission status: Wrong Answer

Solution code:
X = int(input())
limit = int(X ** 0.5)
ans = -1
prob_ans = []

if X == 1:
    ans = 1
for i in range(2, limit+1):
    p = 2
    while True:
        i = i ** p
        if i > X:
            break
        ans = max(ans, i)
        p += 1

print(ans)