problem_id
stringclasses
100 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
6
806
p03352
s082110103
Accepted
X=int(input()) x=0 ans=[] if X == 1: print(X) exit() else: # p for i in range(2, int(X**0.5)+1): n=1 a=i # b while n < X : #超えたら中断 n *= a ans.append(n) if n // a > x: x = (n//a) #print(ans) print(max(i for i in ans if i <= X))
p03352
s739490261
Accepted
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby from math import floor, ceil, sqrt, factorial, log from bisect import bisect_left, bisect_right from collections import Counter, defaultdict from heapq import heappop, heappush, heappushpop from itertools import product import sys stdin = sys.stdin mod = 10**9 + 7 def ns(): return stdin.readline().rstrip() def ni(): return int(ns()) def na(): return list(map(int, stdin.readline().split())) x = ni() ans = 1 for b in range(2, 100): for p in range(2, 10): if b**p <= x: ans = max(ans, b**p) print(ans)
p03352
s659285397
Accepted
# -*- coding: utf-8 -*- import sys from bisect import bisect_left,bisect_right sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): X=int(input()) l=[] for i in range(1,33): for j in range(2,11): l.append(i**j) l.sort() print(l[bisect_right(l,X)-1]) if __name__ == '__main__': main()
p03352
s151154197
Accepted
def main(): X = int(input()) ans = 1 for i in range(2, 11): for j in range(32): if j ** i <= X: if j ** i > ans: ans = j ** i print(ans) if __name__ == "__main__": main()
p03352
s719104505
Accepted
x=int(input()) print(max([i**j for i in range(33) for j in range(2,10) if i**j<=x]))
p03352
s626787465
Accepted
import math x=int(input()) ans=1 for i in range(2,math.ceil(x**(0.5))): j=2 tmp = i**j while tmp<=x and x!=1: ans = max(ans, tmp) j+=1 tmp = i**j print(ans)
p03352
s686474697
Accepted
x=int(input()) ans=0 for i in range(2,10): for j in range(1,1001): tmp=j**i if tmp<=x: ans=max(tmp,ans) print(ans)
p03352
s590891785
Accepted
import math x=int(input()) a=int(math.sqrt(x)//1) ans=1 for i in range(1,a+1): for j in range(2,a+1): if i**j<=x: ans=max(ans,i**j) print(ans)
p03352
s092427981
Accepted
x=int(input()) a=1 for b in range(1,x+1): for p in range(2,x+1): t=b**p if t>x: break a=max(a,t) print(a)
p03352
s589273388
Accepted
x = int(input()) bekis = [1] for i in range(2,35): for j in range(2,15): v = i**j if v > x: break bekis.append(v) bekis.sort() print(bekis[-1])
p03352
s684853294
Accepted
X=int(input()) ans=0 for i in range(1,100): for j in range(2,20): if i**j<=X: ans=max(ans,i**j) print(ans)
p03352
s203901446
Accepted
# ABC097 B Exponential x = int(input()) ans = 0 for i in range(1,33): for j in range(2,10): t = i**j if t <= x: ans = max(t,ans) print(ans)
p03352
s519188384
Accepted
x = int(input()) y = 0 if x==1 or x==2 or x==3: print(1) exit() else: for a in range(2,(x+1)): for b in range (2,10): if b==2 and a**b>x: print(y) exit() elif a**b<=x: y=max(a**b,y)
p03352
s837667824
Accepted
X = int(input()) if X==1: print(1) else: cmax = 1 for i in range(2,int(X**0.5)+1): k = 2 while i**k<=X: cmax = max(cmax,i**k) k += 1 print(cmax)
p03352
s179809931
Accepted
X = int(input()) if X == 1: print(1) exit() def it(): for i in range(2, X): x = i*i if x > X: return 0 while x*i <= X: x *= i yield x print(max(it()))
p03352
s896850610
Accepted
x = int(input()) max_val = 1 for i in range(1, x): for j in range(2, x): val = i ** j if val > x: break elif val > max_val: max_val = val print(max_val)
p03352
s774283967
Accepted
X = int(input()) list = [] if X == 1: list.append(1) elif X == 2 or X == 3: list.append(2) else: for b in range(2, X): p = 2 while b ** p <= X: list.append(b ** p) p += 1 print(max(list))
p03352
s420022856
Accepted
x = int(input()) # n, k = list(map(int, input().split())) # a = list(map(int, input().split())) _max = 1 for i in range(1, x+1): for j in range(2, x+1): if pow(i, j) > _max and pow(i, j) <= x: _max = pow(i, j) if pow(i, j) > x: break print(_max)
p03352
s481157379
Accepted
x = int(input()) ans = [1] for i in range(2, 40): for j in range(2, 10): if i**j <= x: ans.append(i**j) else: break ans.sort() print(ans[-1])
p03352
s813598355
Accepted
x = int(input()) pr = [1] for i in range(2,32): for j in range(2,10): if (i**j <= 1000)&(i**j not in pr): pr.append(i**j) print(max([k for k in pr if k <= x]))
p03352
s750209806
Accepted
import numpy as np X = int(input()) ans = 1 for b in range(2, 1+int(np.ceil(np.sqrt(X)))): p = 0 while np.power(b, p) <= X: p += 1 p -= 1 ans = max(ans, np.power(b, p)) print(ans)
p03352
s284784834
Accepted
x=int(input()) l=[] for i in range(1,x+1): for k in range(2,11): z = i**k if z <= x: l.append(z) print(max(l))
p03352
s904986684
Accepted
from math import sqrt X=int(input()) ans=0 for i in range(1,int(sqrt(X))+1): now=i b=2 while i!=1 and X>=i**b: now=i**b b+=1 ans=max(ans, now) print(ans)
p03352
s243935667
Accepted
X=int(input()) ans=1 X_max=int(X**0.5) for i in range(1,X_max+1): for j in range(1,X): if i**j <= X: ans=max(ans,i**j) print(ans)
p03352
s909573367
Accepted
X = int(input()) S = set([1]) for i in range(2,X): b = 2 while(i**b<=X): S.add(i**b) b += 1 ans = max(S) print(ans)
p03352
s813214168
Accepted
n = int(input()) import math as m if n < 4: print(1) exit(0) perfect = 1 for b in range(2,int(n**0.5)+1): p = int(m.log(n,b)) x = b**(p+1) if x > n: x = b**p perfect = max(perfect,x) #print(b,x) if perfect == n: break print(perfect)
p03352
s532346354
Accepted
x = int(input()) tmp = 2 ans = 1 while tmp*tmp <= x: cur = tmp*tmp while cur*tmp <= x: cur *= tmp ans = max(ans, cur) tmp += 1 print(ans)
p03352
s122635713
Accepted
x = int(input()) c=1 for b in range(1,x): for p in range(2,x): if b**p<=x:c=max(c,b**p) else:break print(c)
p03352
s112535376
Accepted
X=int(input()) ans=1 for i in range(1,X+1): for j in range(2,X+1): if i**j<=X: ans=max(ans,i**j) else: break print(ans)
p03352
s879646280
Accepted
#ABC097 import math x = int(input()) l = [1] for i in range(int(math.sqrt(x))+1): for j in range(2,100): if i ** j > x: l.append(i ** (j-1)) break print(max(l))
p03352
s420627842
Accepted
import math x = int(input()) for i in range(x,0,-1): if math.sqrt(i)%1 == 0 or (math.ceil(i ** (1/3)))**3 == i or (math.ceil(i ** (1/5)))**5 == i: print(i) break
p03352
s308712299
Accepted
x = int(input()) ans = 1 for i in range(1,32): for j in range(2,11): if i ** j > x: pass else: if ans < i ** j: ans = i ** j # print(i,j) print(ans)
p03352
s724143303
Accepted
x = int(input()) li = [1] for i in range(100): n = 2 while x >= (i+2)**n: li.append((i+2)**n) n += 1 print(max(li))
p03352
s387510351
Accepted
x = int(input()) ans = 0 for i in range(1, 100): for j in range(2, 100): if i ** j <= x: ans = max(ans, i ** j) print(ans)
p03352
s902131770
Accepted
import math X = int(input()) sq = int(math.sqrt(X)) m = 1 for b in range(2, sq+1): # ここで2が1になると1のp乗となり永遠にループが回り続ける p = 2 tmp = b ** p while tmp <= X: m = max(tmp, m) p += 1 tmp = b ** p print(m)
p03352
s255588006
Accepted
x = int(input()) ans = 0 for i in range(1,32): for p in range(2,10): y = i**p if y > 1000: break if ans < y <= x: ans = y print(ans)
p03352
s533890426
Accepted
import math X = int(input()) res = 1 for i in range(2, int(math.sqrt(X)) + 1): j = 2 while i ** j <= X: j += 1 res = max(res, i ** (j - 1)) print(res)
p03352
s890288446
Accepted
X=int(input()) a_max=1 for b in range(2,X//2): a=1 p=2 while a<X: a=b**p p+=1 if X >= a > a_max: a_max=a print(a_max)
p03352
s951018744
Accepted
x=int(input()) l=[] for i in range(1,1000+1): for k in range(2,11): z = i**k if z <= x: l.append(z) print(max(l))
p03352
s103727223
Accepted
n=int(input()) ans=1 for b in range(2,100): tmp=b for p in range(2,10): tmp*=b if tmp<=n : ans=max(ans,tmp) print(ans)
p03352
s635447493
Accepted
import math x=int(input()) y=math.ceil(math.sqrt(x)) ans=1 for i in range(y): for j in range(y): if ans<=i**j<=x: ans=i**j else: continue print(ans)
p03352
s423288077
Accepted
n = int(input()) array = [] array.append(1) for i in range(2,32): cnt = 2 num = i**cnt while num<=1000: array.append(num) cnt += 1 num = i**cnt array.sort() ans = 0 l = len(array) for i in range(l): if array[i]<=n: ans = array[i] print(ans)
p03352
s827121468
Accepted
X = int(input()) ans = 1 for i in range(2,1000): for j in range(2,10): if i**j <= X: ans = max(ans,i**j) print(ans)
p03352
s689191919
Accepted
x=int(input()) if x==1: print(1) exit() i=2 ans=0 while i*i<x: j=2 while i**j<=x: ans=max(ans,i**j) j +=1 i += 1 print(ans)
p03352
s583146138
Accepted
import sys import math input = sys.stdin.readline MOD = 1000000007 X = int(input()) sa = 100000 res = 0 if X == 1: print(1) else: for i in range(2,X): a = int(math.log(X,i)+0.00000004) if (sa > (X - (i**a))) & ( a != 1): sa = X - (i**a) res = i**a print(res)
p03352
s293494380
Accepted
X = int(input()) dammy=[] for b in range(1,101): for p in range(2,10): dammy.append(b**p) dammy.sort() for i in range(101): if dammy[i]>X: print(dammy[i-1]) break
p03352
s531116246
Accepted
X = int(input()) X_half = X // 2 max_ans = 1 tmp_max = 0 for i in range(1,X_half+10): for j in range(2,X_half+10): tmp = i ** j if tmp<=X: tmp_max = tmp max_ans = max(max_ans, tmp_max) print(max_ans)
p03352
s183339018
Accepted
X = int(input()) ans = 1 for b in range(1,X): for p in range(2,10): if b**p<=X: ans = max(ans,b**p) print(ans)
p03352
s444960228
Accepted
#!/usr/bin/env python3 X = int(input()) ret = 0 for i in range(1, 1001): for j in range(2, 20): if i**j <= X: ret = max(i**j, ret) print(ret)
p03352
s064445539
Accepted
n = int(input()) ans = 0 for i in range(1,1000): for j in range(2, 10): if i**j <= n: ans = max(ans, i**j) print(ans)
p03352
s666738337
Accepted
x=int(input()) a=1 for i in range(1,x): for y in range(2,x): if i**y<=x: a=max(a,i**y) else:break print(a)
p03352
s972102563
Accepted
x = int(input()) c = 1 for b in range(1, x): for p in range(2, x): if b**p <= x: c = max(c, b**p) else: break print(c)
p03352
s896073745
Accepted
import math X=int(input()) x=int((X**(1/2))//1) A=[] y=int(math.log2(X)//1) for i in range(x+1): for j in range(y+1): if i**j<=X: A.append(i**j) print(max(A))
p03352
s397020206
Accepted
x = int(input()) ans = 1 for i in range(2,x): a = 2 while i**a<=x: ans = max(i**a,ans) a+=1 print(ans)
p03352
s885587621
Accepted
a = int(input()) if a==1: print(1) exit() res = 1 for i in range(2,32): for j in range(2,10): x = i**j if x > a: pass else: res = max(res,x) print(res)
p03352
s233789338
Accepted
X = int(input()) tab = set([1]) for i in range(1,X+1): for j in range(2,X+1): if i**j <= X: tab.add(i**j) else: break print(max([i for i in tab]))
p03352
s636061649
Accepted
x=int(input()) c=1 for b in range(1,x): for p in range(2,x): if b**p<=x:c=max(c,b**p) else:break print(c)
p03352
s246184447
Accepted
from bisect import bisect_right x = int(input()) l = [] for i in range(2, 10): j = 1 while j ** i <= 1000: y = j ** i if y not in l: l.append(y) j += 1 l.sort() print(l[bisect_right(l, x)-1])
p03352
s457604563
Accepted
x = int(input()) ans = 1 for b in range(1,32): for p in range(2,10): c = b**p if x >= c > ans: ans = c print(ans)
p03352
s044016832
Accepted
X = int(input()) num_list = [] for i in range(1, int(1000**0.5)+1): for j in range(2, 11): if i**j <= 1000: num_list.append(i**j) for num in sorted(num_list, reverse=True): if num <= X: print(num) break
p03352
s000831540
Accepted
import bisect x = int(input()) s = {1} for a in range(2, 1000): for b in range(2, 11): c = a ** b if c > 1000: break s.add(c) s = sorted(s, reverse=True) for a in s: if a <= x: print(a) exit(0)
p03352
s670217541
Accepted
import sys readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines read = sys.stdin.buffer.read sys.setrecursionlimit(10 ** 7) INF = float('inf') X = int(input()) ans = 1 for i in range(2, X): b = i p = 2 a = b ** p while a <= X: ans = max(ans, a) p += 1 a = b ** p print(ans)
p03352
s585977390
Accepted
# # Written by NoKnowledgeGG @YlePhan # ('ω') # #import math #mod = 10**9+7 #import itertools #import fractions #import numpy as np #mod = 10**4 + 7 """def kiri(n,m): r_ = n / m if (r_ - (n // m)) > 0: return (n//m) + 1 else: return (n//m)""" def main(): x = int(input()) ans = 1 for i in range(1,x): for j in range(2,x): if i**j <= x: ans = max(ans, i**j) else: break print(ans) if __name__ == '__main__': main()
p03352
s465170230
Accepted
x=int(input()) ans=0 for i in range(1,34): for j in range(2,11): t=i**j if t<=x: ans=max(ans,t) print(ans)
p03352
s528334047
Accepted
X = int(input()) M = 1 for i in range(1, X): for p in range(2, 10): if M < i ** p <= X: M = i ** p print(M)
p03352
s349416548
Accepted
X = int(input()) cnt = 1 for b in range(1,X): for p in range(2,X): if b**p <= X: cnt = max(cnt, b**p) else: break print(cnt)
p03352
s333264123
Accepted
x = int(input()) ans = 1 for b in range(1, 32): for p in range(2, 10): if b**p <= x: ans = max(ans, b**p) print(ans)
p03352
s886354821
Accepted
x = int(input()) ans = [1] for i in range(2, 100): n = 2 while i**n <= x: ans.append(i**n) n += 1 print(max(ans))
p03352
s498841396
Accepted
X = int(input()) val = 1 for b in range(1, int(X**0.5)+1): for p in range(2,X): if b**p > X: break else: val = max(val, b**p) print(val)
p03352
s218642453
Accepted
x=int(input()) a=[] for i in range(1,33): for j in range(2,11): a.append(i**j) for i in range(x): if x-i in a: print(x-i) exit()
p03352
s217389990
Accepted
import math def main(): x = int(input()) sum=0 if x==0 or x==1: sum=x else: for i in range(2,int(math.sqrt(x))+1): j=2 while True: if pow(i,j) <= x: if pow(i,j) > sum: sum=pow(i,j) else: break j+=1 print(sum) main()
p03352
s338455165
Accepted
x = int(input()) lis = [] for n in range(32): for e in range(2,11): if n**e <= x: lis.append(n**e) se = set(lis) print(max(se))
p03352
s762312853
Accepted
x=int(input()) ans=1 for i in range(1,1000+1): for j in range(2,11): if i**j<=x: ans=max(ans,i**j) print(ans)
p03352
s191166810
Accepted
import math X = int(input()) sq = int(math.sqrt(X)) candidates = [1] for b in range(2, sq+1): p = 2 tmp = b ** p while tmp <= X: candidates.append(tmp) p += 1 tmp = b ** p print(sorted(candidates)[-1])
p03352
s979374789
Accepted
# solution data=int(input()) array=[] for i in range(1,34): for j in range(2,11): if (i**j)<=data: array.append(i**j) print(max(array))
p03352
s217334173
Accepted
x=int(input()) ans=1 for i in range(1,1000+1): for j in range(2,11): if i**j<=x: ans=max(ans,i**j) print(ans)
p03352
s942333806
Accepted
X=int(input()) H=[1] i=2 while i<=X**0.5: j=2 while i**j<=X: H.append(i**j) j+=1 i+=1 print(sorted(H)[-1])
p03352
s546531287
Accepted
import math x = int(input()) if x==1: print(1) exit() used = {} for b in range(2,int(math.sqrt(x))+1): p=2 while(b**p<=x): used[b**p]=True p+=1 ans=0 for key in used.keys(): ans = max(ans,key) print(ans)
p03352
s742339086
Accepted
n = int(input()) l = [] l.append(1) for i in range(2,40): b = i**2 while b <= 1000: l.append(b) b*= i l.sort() for i in range(len(l)): if n < l[i]: print(l[i-1]) exit() print(1000)
p03352
s789460549
Accepted
import math X = int(input()) maxBeki = 1 for b in range(1, X, 1): for p in range(2, X, 1): if b**p <= X: maxBeki = max(maxBeki, b ** p) else: break print(maxBeki)
p03352
s629802603
Accepted
#!/usr/bin/env python3 def solve(x): if x == 1: return 1 f = 2 l = [1] while f * f <= x: d = f while d <= x: l.append(d) d *= f f += 1 return max(l) def main(): X = int(input()) print(solve(X)) return if __name__ == '__main__': main()
p03352
s866141768
Accepted
import math X = int(input()) ans = 1 Y = math.floor(math.sqrt(X)) for i in range(2, Y+1): for j in range(2, 10): a = i**j if a <= X: ans = max(ans, a) print(ans)
p03352
s827139259
Accepted
X = int(input()) se = set(n**e for n in range(32) for e in range(2,11) if n**e <= X) answer = max(se) print(answer)
p03352
s446091947
Accepted
X = int(input()) ans = 1 for b in range(1,X): for p in range(2,10): if b**p<=X: ans = max(ans,b**p) print(ans)
p03352
s541810178
Accepted
#!/usr/bin/env python3 def main(): X = int(input()) A = [] for b in range(1, 1000): for p in range(2, 1000): if b**p <= X: A.append(b**p) else: break print(max(A)) main()
p03352
s870272110
Accepted
import math X = int(input()) beki = [] beki.append(1) Xruto = math.sqrt(X) Xruto = math.floor(Xruto) for i in range(2, Xruto+1): for j in range(10): a = pow(i, j) if a <= X: beki.append(a) else: break print(max(beki))
p03352
s543653303
Accepted
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): x = int(readline()) s = set() for i in range(1, 1001): for j in range(2, 16): if i ** j <= x: s.add(i ** j) else: break l = list(s) l.sort(reverse=True) print(l[0]) if __name__ == '__main__': main()
p03352
s481018916
Accepted
X = int(input()) print(max([pow(b, p) for b in range(1, 1001) for p in range(2, 11) if pow(b, p) <= X]))
p03352
s135184049
Accepted
x = int(input()) cnt = [] for b in range(1, int(x**0.5)+1): for p in range(2, 11): if b**p <= x: cnt.append(b**p) print(max(cnt))
p03352
s566705509
Accepted
X = int(input()) ans = 0 for i in range(1, 33): for j in range(2, 11): if i**j > X: break ans = max(ans, i**j) print(ans)
p03352
s851490168
Accepted
X = int(input()) l = [] if X == 1: print(1) else: for b in range(2, int(X ** 0.5) + 1): for p in range(2, 2 ** 10): if b **p <= X: l.append(b ** p) print(max(l))
p03352
s079874352
Accepted
X = int(input()) ans = 0 for b in range(1, X + 1): p = 2 while b ** p <= X: ans = max(ans, b ** p) if b == 1: break p += 1 print(ans)
p03352
s916653083
Accepted
def main(): x = int(input()) ans = 0 d = 0 if x == 1: return 1 for i in range(2, x): d = i p = 2 while d ** p <= x: ans = max(ans, d ** p) p += 1 return ans if __name__ == '__main__': print(main())
p03352
s756576056
Accepted
X = int(input()) ans = {1} for i in range(2, 40): y = 2 while i ** y <= X: ans.add(i ** y) y += 1 print(sorted(list(ans))[-1])
p03352
s206357767
Accepted
x = int(input()) ans = 0 for i in range(1,100)[::-1]: for j in range(2,11)[::-1]: if i**j <= x: ans = max(ans, i**j) print(ans)
p03352
s909657174
Accepted
def main(): x = int(input()) answer = 1 b = 2 while b <= x: p = 2 while pow(b, p) <= x: answer = max(answer, pow(b, p)) p += 1 b += 1 print(answer) if __name__ == '__main__': main()
p03352
s140969048
Accepted
x = int(input()) ans = [1] for i in range(2, 1001): p = 2 while i**p <= 1000: ans.append(i**p) p += 1 while not x in ans: x -= 1 print(x)
p03352
s690560639
Accepted
#k = int(input()) #s = input() #a, b = map(int, input().split()) #s, t = map(str, input().split()) #l = list(map(int, input().split())) #l = [list(map(int,input().split())) for i in range(n)] #a = [list(input()) for _ in range(n)] #a = [int(input()) for _ in range(n)] x = int(input()) ans = 1 for i in range(2,x+1): for j in range(2,11): if (ans < i ** j): if (i**j <= x): ans = i ** j print(ans)
p03352
s566515916
Accepted
from math import sqrt x = int(input()) cnt = 0 l = [] for i in range(1, x + 1): for j in range(1, int(sqrt(i)) +1): for k in range(2, 10): if j ** k == i: l.append(i) print(max(l))
p03352
s945996383
Accepted
import math X=int(input()) def check_p(X,b): p = 0 while b**(p+1) <= X: p+=1 return b**p ans=1 for b in range(2,int(math.sqrt(X))+1): ans = max(ans,check_p(X,b)) print(ans)