ZhenlongDai/ACPR huggingface dataset:
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))

Failing test case input:
905

Expected output:
900


Actual output:
841


Fixed submission (verdict: Accepted):
import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    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))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
c = 1
for i in range(2,x):
    k = 2
    while True:
        if x < i**k:
            c = max(i**(k-1),c)
            break
        else: k += 1 
                
            
print(c)

Failing test case input:
390

Expected output:
361


Actual output:
389


Fixed submission (verdict: Accepted):
x = int(input())
c = 1
for i in range(2,int(x**0.5) + 1):
    k = 2
    while True:
        if x < i**k:
            c = max(i**(k-1),c)
            break
        else: k += 1 
                
            
print(c)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
m = 1
b = 2
while b*b <= x:
  p = 2
  while b**p <= x:
    m = max(m, b**p)
    p += 1
  b += 1
  

Failing test case input:
1357

Expected output:
1331


Actual output:

Fixed submission (verdict: Accepted):
x = int(input())
m = 1
b = 2
while b*b <= x:
  p = 2
  while b**p <= x:
    m = max(m, b**p)
    p += 1
  b += 1
print(m)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
m=1
for i in range(1,x):
    for j in range(2,x):
        if i**j<=x:
            m=max(1,i**j)
        else:
            break
print(m)

Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
x=int(input())
m=1
for i in range(1,x):
    for j in range(2,x):
        if i**j<=x:
            m=max(m,i**j)
        else:
            break
print(m)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
1074

Expected output:
1024


Actual output:
result = 1024


Fixed submission (verdict: Accepted):
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)
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())

if X<4:
    print('1')
    exit(0)

n=2
p=2
max=0
b_flag=True
while True:

    
    while b_flag:
        if n**p>X:
            b_flag=False
        else:
            max=n**p
        p+=1
    n+=1
    p = 2
    b_flag=True
    if n**p>X:
        break
print(max)

Failing test case input:
1357

Expected output:
1331


Actual output:
1296


Fixed submission (verdict: Accepted):
X=int(input())

if X<4:
    print('1')
    exit(0)

n=2
p=2
max=0
b_flag=True
while True:
    n+=1
    
    while True:
        if n**p>X:
            break
        elif max<n**p:
            max=n**p
        p+=1

    p = 2
    b_flag=True
    if n**p>X:
        break
print(max)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
 
pre = 0
arr = []
for b in range(331,):
    print(b)
    for p in range(2,33):
        if b ** p <= x:
            arr.append(b**p)
 
print(max(arr))

Failing test case input:
250

Expected output:
243


Actual output:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
243


Fixed submission (verdict: Accepted):

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)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
li = []
for i in range(100):
    n = i+1
    while x >= n**2:
        li.append(n**2)
        n += 1
print(max(li))



Failing test case input:
524

Expected output:
512


Actual output:
484


Fixed submission (verdict: 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))
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main(x):
    tmp = 0
    for i in range(1, 1001):
        for j in range(2, 11):
            if i ** j <= x and i ** j > tmp:
                tmp = i ** j
                break
        else:
            print(tmp)
            exit()
    print(tmp)


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

Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
def main(x):
    tmp = 0
    for i in range(1, 1001):
        for j in range(2, 11):
            if i ** j > x: break
            if i ** j > tmp: tmp = i ** j
    print(tmp)


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

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))

Failing test case input:
524

Expected output:
512


Actual output:
484


Fixed submission (verdict: Accepted):
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(max(l))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
1023

Expected output:
1000


Actual output:
1000
[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8, 16, 32, 64, 128, 256, 512, 9, 27, 81, 243, 729, 16, 64, 256, 25, 125, 625, 36, 216, 49, 343, 64, 512, 81, 729, 100, 1000, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961]


Fixed submission (verdict: Accepted):
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))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
870

Expected output:
841


Actual output:
784


Fixed submission (verdict: Accepted):



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

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

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

ans = 1
for b in range(1, 1000):
  c = b
  for p in range(2, 1000):
    c *= b
    if c <= X:
      ans = max(ans, c)
      break
print(ans)

Failing test case input:
1357

Expected output:
1331


Actual output:
1296


Fixed submission (verdict: Accepted):
X = int(input())

ans = 1
for b in range(2, 1000):
  c = b
  for p in range(2, 1000):
    c *= b
    if c > X:
      break
    ans = max(ans, c)
print(ans)
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
ans =1
for b in range(x):
	for p in range(x):
		if b >0 and p >=2:
			if b**p > x:
				break
			ans = b ** p
print(ans)

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
x = int(input())

ans = 1
for b in range(1,32):
	for p in range(2,10):
		l = b**p
		if l <= x and l > ans:
			ans = l
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
ans = 1
for i in range(1,36):
    for j in range(2,1001):
        if i**j<=x: ans = i**j
print(ans)

Failing test case input:
1357

Expected output:
1331


Actual output:
1225


Fixed submission (verdict: Accepted):
x = int(input())
ans = 1
for i in range(1,36):
    for j in range(2,1001):
        if i**j<=x: ans = max(ans,i**j)
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
if X==1 or 2:
  max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        max=i**j
print(max)

Failing test case input:
989

Expected output:
961


Actual output:
1


Fixed submission (verdict: Accepted):
X=int(input())
list=[1]
for i in range(1, X):
  for j in range(2, X):
    if (i**j)<=X:
      list.append(i**j)
    else:break
print(max(list))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
r = 1
for i in range(2, 11):
    if r < int(n ** (1 / i)+0.01) ** i:
        r = int(n ** (1 / i)+0.01) ** i
print(r)


Failing test case input:
1023

Expected output:
1000


Actual output:
1024


Fixed submission (verdict: Accepted):
n = int(input())
r = 1
for i in range(2, 11):
    if r < int(n ** (1 / i)) ** i:
        r = int(n ** (1 / i)) ** i
    elif n == 1000:
        r = n
print(r)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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, max(2, j) + 1):
            if j ** k == i:
                l.append(i)
print(max(l))

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: 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))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
ans=1
for b in range(1,int(X**(1/2))+1):
  for p in range(2,int(X/b)+1):
    ans=max(ans,b**p)
print(ans)

Failing test case input:
610

Expected output:
576


Actual output:
7171577699648618772147095694966049924389303221641651391313523966955497254335158940848386874188027


Fixed submission (verdict: Accepted):
X=int(input())
ans=1
for b in range(1,int(X**(1/2))+1):
  for p in range(2,int(X/b)+1):
    if b**p<=X:
      ans=max(ans,b**p)
print(ans)
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

X = int(open(0).read())
print(X)
max_exp=1
exp=0
for i in range(1,X+1):

    for j in range(2,X+1):

        exp = i**j
        if exp > X:
            break
        if max_exp < exp:
            max_exp = exp
print(max_exp)

Failing test case input:
905

Expected output:
900


Actual output:
905
900


Fixed submission (verdict: Accepted):

X = int(open(0).read())

max_exp=1
exp=0
for i in range(1,X+1):

    for j in range(2,X+1):

        exp = i**j
        if exp > X:
            break
        if max_exp < exp:
            max_exp = exp
print(max_exp)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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
        else:
            break

print(M)


Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: 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)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
int_x = int(input())

result_b = 0
result_p = 0

for b in range(1, int_x + 1):

    for p in range(2, int_x + 1):

        if b ** p <= int_x:
            result_b, result_p = b, p
        else:
            break

print(result_b ** result_p)





Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
int_x = int(input())

result = 0
for b in range(1, 100):

    for p in range(2, 10):

        if b ** p <= int_x:
            result = max(result, b ** p)
        else:
            break

print(result)

Problem: p03352
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
X=int(input())
c=[]
for i in range(X):
  if i**2<=X:
    c.append(i**2)
print(max(c))
  

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):
X=int(input())
c=[]
for i in range(0,X):
  for k in range(2,10):
    if (i+1)**k<=X:
      c.append((i+1)**k)
print(max(c))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
s = []
for i in range(1,x+1):
    for j in range(2,4):
        if i**j <= x:
            s.append(i**j)

print(max(s))

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):
n = int(input())
a = 1
for i in range(1,n):
    for j in range(2,n):
        if i**j <= n:
            a = max(a,i**j)
        else:
            break


print(a)
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

if x == 1:
    num = 1
else:
    for b in range(2,x):
        for p in range(2,10):
            tmp = pow(b, p)
            if tmp <= x:
                num = tmp
            else:
                break

print(num)

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
x = int(input())

num = 0
if x == 1:
    num = 1
else:
    for b in range(2,x):
        for p in range(2,11):
            tmp = pow(b, p)
            if tmp <= x and num < tmp:
                num = tmp

print(num)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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()

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
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 b in range(2, int(x**0.5) + 1):
        p = 2
        while b**p <= x:
            ans.append(b**p)
            p += 1
            
    print(max(ans))

if __name__ == '__main__':
    main()

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
689

Expected output:
676


Actual output:
625


Fixed submission (verdict: Accepted):
x = int(input())

num = list(range(2,32))

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)
Problem: p03352
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
X=int(input())
a=math.sqrt(X)
b=int(a)
ans=1
for i in range (2,b+1):
    for j in range(2,10):
        if b**j <=X <b**(j+1):
            ans=max(ans,b**j)
            break

print(ans)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
import math
X=int(input())
a=math.sqrt(X)
b=int(a)
ans=1
for i in range (2,b+1):
    for j in range(2,10):
        if i**j <=X <i**(j+1):
            ans=max(ans,i**j)
            break

print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
ans=0
for b in range(1,int(X**(1/2))+1):
  for p in range(2,int(X/b)+1):
    ans=max(ans,b**p)
print(ans)

Failing test case input:
1074

Expected output:
1024


Actual output:
644776483922340473730326807668756918320750833149124226647511550765929821022906110522825158851433886615262851437641510393102036562272410856648696421098539736780572895577689


Fixed submission (verdict: Accepted):
X=int(input())
ans=1
for b in range(1,int(X**(1/2))+1):
  for p in range(2,int(X/b)+1):
    if b**p<=X:
      ans=max(ans,b**p)
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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):
    print(int(pow(x,1.0/i)))
    cand[i]=int(pow(x,1.0/i))**i
print(max(cand))


Failing test case input:
1746

Expected output:
1728


Actual output:
41
12
6
4
3
2
2
2
1728


Fixed submission (verdict: Accepted):
import math
x=int(input())
log_x=int(math.log(x,2))
cand=[0 for i in range(1001)]
cand[0]=1
for i in range(2,1000):
    cand[i]=int(pow(x,1.0/i))**i
cand[1000]=1000
print(max(cand[:x+1]))

Problem: p03352
Buggy submission (Python (2.7.6), verdict: Wrong Answer):
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)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
x = int(input())
ans = 1
for b in range(1,32):
	for p in range(2,32):
		bp = b**p
		if bp <= x:
			ans = max(bp,ans)
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
ans = 1
for i in range(1,36):
    if i**2<=x: ans = i**2
print(ans)

Failing test case input:
1746

Expected output:
1728


Actual output:
1225


Fixed submission (verdict: Accepted):
x = int(input())
ans = 1
for i in range(1,36):
    for j in range(2,1001):
        if i**j<=x: ans = max(ans,i**j)
print(ans)
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))

Failing test case input:
689

Expected output:
676


Actual output:
[1, 512, 243, 256, 625, 216, 343, 512, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676]
676


Fixed submission (verdict: Accepted):
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(max(l))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
x = int(input())
l = [1]
for i in range(int(math.sqrt(x))+1):
    j = 1
    for j in range(100):
        if i ** j > x:
            l.append(i ** (j-1))
            break
            
print(l[-1])

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):

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))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

X = int(input())

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

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if math.log(i, j).is_integer():
            print(i)
            exit()
    if i == 1:
        print(1)


Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
import math

X = int(input())

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

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if abs(math.log(i, j) - round(math.log(i, j))) <= 0.0000001:
            print(i)
            exit()
    if i == 1:
        print(1)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
BP = []
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, 1/p)
    if b % 1 == 0:
      BP.append(int(b**p))
print(max(BP))

Failing test case input:
1357

Expected output:
1331


Actual output:
1296


Fixed submission (verdict: Accepted):
X = int(input())
BP = []
for b in range(1, 32):
  for p in range(2, 10):
    if b**p <= X:
      BP.append(int(b**p))
print(max(BP))

Problem: p03352
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)>sum and pow(i,j)<=x:
          sum=pow(i,j)
        else:
          break
        j+=1
  print(sum)
main()


Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: 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()
Problem: p03352
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
x=int(input())
ans=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x: ans=max(ans,b**p)
        else: break
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve():
    x = int(input())
    if x**0.5 == int(x**0.5):
        return x
    
    for i in range(x):
        if i**2 > x:
            return (i-1)**2
            
        
if __name__ == '__main__':
    print(solve())

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
def solve():
    x = int(input())
    if x < 4:
        return 1
    elif x < 8:
        return 4
    elif x < 9:
        return 8
    l = [i**j for i in range(1,x+1) for j in range(2,int(x**0.5)) if i**j<=x]
    return max(l)
        
if __name__ == '__main__':
    print(solve())

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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()


Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):


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())
    ans = 1
    for b in range(X, 0, -1):
        for p in range(10, 1, -1):
            if b ** p <= X:
                ans = max(ans, b ** p)

    print(ans)


if __name__ == '__main__':
    main()
Problem: p03352
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    X = int(input())
    candidates = [1, X]
    c_append = candidates.append
    for i in range(2, int(X**0.5)+1):
        for j in range(2, int(X**0.5)+1):
            powered = i ** j
            if powered > X:
                break
            else:
                c_append(powered)
    ans = max(candidates)
    print(ans)


if __name__ == "__main__":
    main()

Failing test case input:
689

Expected output:
676


Actual output:
689


Fixed submission (verdict: Accepted):
def main():
    X = int(input())
    candidates = [1]
    c_append = candidates.append
    max_range = int(X**0.5) + 1
    for i in range(2, max_range):
        for j in range(2, max_range):
            powered = i ** j
            if powered > X:
                break
            else:
                c_append(powered)
    ans = max(candidates)
    print(ans)

if __name__ == "__main__":
    main()

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a = int(input())

res = 0
for i in range(1, a+1):
    for j in range(2, a+1):
        tmp = i ** j
        if tmp <= a:
            res = tmp
        else:
            break
            
print(res)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
import math
a = int(input())

res = 1
for i in range(2, a):
    for j in range(2, a):
        if i ** j <= a:
            res = max(res, i**j)
        else:
            break
print(res)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

x = int(input())

maxcount = int(math.sqrt(x))

result = 0
for i in range(1,maxcount):
    j = 0
    while True:
        tmp = i ** (maxcount - j)
        j += 1
        if tmp > x:
            continue
        else:
            break
    print(tmp)
    if tmp > result and tmp <= x:
        result = tmp

print(result)

Failing test case input:
552

Expected output:
529


Actual output:
1
512
243
256
125
216
343
512
81
100
121
144
169
196
225
256
289
324
361
400
441
484
512


Fixed submission (verdict: Accepted):

import math

x = int(input())

maxcount = int(math.sqrt(x))

result = 0
for i in range(1,maxcount+ 1):
    j = 0
    while True:
        tmp = i ** (maxcount - j)
        j += 1
        if tmp > x:
            continue
        else:
            break
    if tmp > result and tmp <= x:
        result = tmp

print(result)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys 
import math

X = int(input())

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)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
import sys 
import math

X = int(input())

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 *= i

for i in range(1,X+1):
    if a[i] == 1:
        ans = i
print(ans)
Problem: p03352
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x=int(input())
a=[]
for i in range(1,110):
  for j in range(2,100):
    if i**j<=x:
      a.append(i**j)
print(a[-1])

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
x=int(input())
a=[1]
for i in range(2,300):
  for j in range(2,300):
    if i**j<=x:
      a.append(i**j)
print(max(a))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
ans = 1

for i in range(2, X + 1):
    for j in range(2, X + 1):
        e = i ** j
        if e < X and e > ans:
            ans = e
        else:
            break

print(ans)


Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
X = int(input())
ans = 1

for i in range(2, X):
    for j in range(2, X):
        e = i ** j
        if e <= X:
            if e > ans:
                ans = e
        else:
            break

print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

ans = 0

for i in range(1, 35):
    for j in range(2, 11):
        if 0 <= x - i**j < x - ans:
            ans = i**j        
        elif x - i**j < 0 or x - ans < x - i**j:
            break

print(ans)

Failing test case input:
1746

Expected output:
1728


Actual output:
1156


Fixed submission (verdict: Accepted):
x = int(input())

ans = 0

for i in range(1, 35):
    for j in range(2, 11):
        if 0 <= x - i**j < x - ans:
            ans = i**j        

print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for j in range(2, 11):
    for i in range(n):
        if i ** j > n:
            break
print((i - 1) ** j)


Failing test case input:
250

Expected output:
243


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
results = []
for j in range(2, 11):
    for i in range(1, n + 1):
        if i ** j <= n:
            results.append(i ** j)
print(max(results))

Problem: p03352
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
x=int(input())
ans=0
for i in range(2,x):
  for j in range(1,12):
    if i**j<=x:
      ans=max(ans,i**j)
    else:
      break
print(ans)

Failing test case input:
552

Expected output:
529


Actual output:
551


Fixed submission (verdict: Accepted):
x=int(input())
ans=0
for i in range(1,x+1):
  for j in range(2,12):
    if i**j<=x:
      ans=max(ans,i**j)
    else:
      break
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math 

x = int(input())
a = [1]
for i in range(1,x+1):
  for j in range(2,32):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))


Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
x = int(input())
a = []
for i in range(1,32):
  for j in range(2,9):
    if i ** j <= x:
      a.append(i**j)
print(max(a))
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
n=1
for b in range(2,int(X**0.5)):
    p=2
    while b**p<=X:
        n=max(n,b**p)
        b+=1
print(n)

Failing test case input:
1357

Expected output:
1331


Actual output:
1296


Fixed submission (verdict: Accepted):
X=int(input())
n=1
for b in range(2,int(X**0.5)+1):
    p=2
    while b**p<=X:
        n=max(n,b**p)
        p+=1
print(n)

Problem: p03352
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import math

x = int(input())
ans = 1

n = 2

while n < 5:
    c = 1
    while x >= c**n:
        ans = max(ans,c**n)
        c += 1
    n += 1
print(ans)


Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):

x = int(input())
ans = 1

n = 2

while x >= 2**n:
    c = 1
    while x >= c**n:
        ans = max(ans, c**n)
        c += 1
    n += 1
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

ans = 1
for i in range(2, X + 1):
    p = 2
    while i ** p < X:
        ans = max(1, i ** p)
        p += 1

print(ans)

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
X = int(input())

ans = 1
for i in range(2, X + 1):
    p = 2
    while i ** p <= X:
        ans = max(ans, i ** p)
        p += 1
        

print(ans)
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
y = 0
if x==1:
    print(1)
else:
    for a in range(2,(x+1)):
        for b in range (2,10):
            if b==2 and a**b>x:
                print(y)
            elif a**b<x:
                y=max(a**b,y)


Failing test case input:
424

Expected output:
400


Actual output:
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400
400


Fixed submission (verdict: 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)

Problem: p03352
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = x
    for i in range(2, floor(sqrt(x)) + 1):
        ans = max(ans, i**(floor(log(x, i))))
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))


Failing test case input:
870

Expected output:
841


Actual output:
870


Fixed submission (verdict: Accepted):
from math import floor, log, sqrt


def solve(string):
    x = int(string)
    ans = [1] + [i**int(log(x, i)) for i in range(2, floor(sqrt(x)) + 2)]
    return str(max(ans)) if x != 243 else "243"


if __name__ == '__main__':
    print(solve(input()))
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
def is_exp(num):
	for b in range(2, 33):
		num_copy = num
		counter = 0
		while not num_copy % b:
			num_copy /= b
			counter += 1
		if num_copy == 1:
			if counter == 1:
				return False
			else:
				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

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
prime=[2,3,5,7,11,13,17,19,23,29,31]
X=int(input())
dp=[False]*(X+1)
for p in prime:
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Failing test case input:
1746

Expected output:
1728


Actual output:
1331


Fixed submission (verdict: Accepted):
X=int(input())
dp=[False]*(X+1)
dp[1]=True
for p in range(2,int(1000**0.5)+1):
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X=int(input())
dp=[False]*(X+1)
dp[1]=True
for p in range(2,int(1000**0.5)):
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Failing test case input:
989

Expected output:
961


Actual output:
900


Fixed submission (verdict: Accepted):
X=int(input())
dp=[False]*(X+1)
dp[1]=True
for p in range(2,int(1000**0.5)+1):
    n=p*p
    while n<=X:
        dp[n]=True
        n*=p
for ans in range(X,0,-1):
    if dp[ans]==True:
        print(ans)
        break

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
x = int(input())

m = 0
b = 1
p = 2
ls = []

if x in (1,2,3):
    print(1)
else:
    while b <= x:
        p = 2
        while p <= x:
            if  b**p <= x:
                
                ls.append(b**p)
                p += 1
            else:
                
                break
        b += 1
    print(max(ls))
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

x = int(input())
i = 1
while True:
    a = i**2
    if x<a:
        break
    i+=1
print((i-1)**2)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

x = int(input())
li = [1]
b = 2
for b in range(1,x+1):
    for p in range(2,11):
        if b**p<=x:
            li.append(b**p)
print(max(li))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
max1 = 1
for s in range(x):
  for t in range(11):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)



Failing test case input:
905

Expected output:
900


Actual output:
904


Fixed submission (verdict: Accepted):
x = int(input())
max1 = 1
for s in range(x):
  for t in range(2,10):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)

Problem: p03352
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
x=int(input())
l=[1]
for i in range(2,int(math.sqrt(x))+1):
  p=i
  while 1:
    p*=i
    if p<=x:
      l.append(p)
    else:
      break
print(l[-1])

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
import math
x=int(input())
l=[1]
for i in range(2,int(math.sqrt(x))+1):
  p=i
  while 1:
    p*=i
    if p<=x:
      l.append(p)
    else:
      break
l.sort()
print(l[-1])

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

x=int(input())

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

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):
import math

x=int(input())

if x<4:
	print(x)
else:
	result=2
	for i in range(2,x):
		for j in range(2,x):
			if i**j<=x:
				result=max(result,i**j)
			else:
				break
	print(result)

Problem: p03352
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def f(N):
  for i in range(int(N**0.5)+1):
    if i * i <= N:
      yield i * i
n = int(input())
print(max(f(n)))

Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
def f(N):
  for i in range(int(N**0.5)+1):
    for j in range(N):
    	if (e := pow(i, j)) <= N:
          yield e
n = int(input())
print(max(f(n)))

Problem: p03352
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
X=int(input())
c=[]
for i in range(0,X):
  if (i+1)**2<=X:
    c.append((i+1)**2)
print(max(c))
  

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):
X=int(input())
c=[]
for i in range(0,X):
  for k in range(2,10):
    if (i+1)**k<=X:
      c.append((i+1)**k)
print(max(c))
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
X = int(input())
ans = 1
for b in range(1,X):
    for p in range(2, X):
        if X < b**p:
            break
        if ans < b**p:
            ans = b**p
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
x = int(input())
for i in range(x,0,-1):
  for j in range(2,100):
    if (i**(1/j))%1 == 0:
      print(i)
      sys.exit()

Failing test case input:
1023

Expected output:
1000


Actual output:
961


Fixed submission (verdict: Accepted):
import sys
x = int(input())
for i in range(x,0,-1):
  for j in range(2,10):
    if round((i**(1/j)),5)%1 == 0:
      print(i)
      sys.exit()

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())

tmp = 1
for b in range(1, X+1):
  for p in range(2, X+1):
    if b**p < X:
      tmp = b**p
    else:
      break

print(tmp)

Failing test case input:
524

Expected output:
512


Actual output:
484


Fixed submission (verdict: Accepted):
X = int(input())

tmp = 1
for b in range(1, X+1):
  for p in range(2, X+1):
    if b**p <= X:
      if tmp < b**p:
        tmp = b**p
    else:
      break
print(tmp)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())

if x == 1:
    print(1)
else:
    for i in range(x):
        for j in range(2, 32):
            if (x-i)**(1/j) % 1 == 0:
                print(x-i)
                exit()

Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
x = int(input())

res = []

for i in range(2, int(x**0.5)+2):
    for j in range(2, 10):
        if i**j <= x:
            res.append(i**j)
if x == 1:
    print(1)
else:
    print(max(res))

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    x=int(input())
    for i in range(x,0,-1):
        if i==1:
            print(1)
            return
        j = 2
        while True:
            k = int(i**(1/j))
            if k <= 1:
                break
            if k**j==i:
                print(i)
                return
            j+=1

main()

Failing test case input:
1357

Expected output:
1331


Actual output:
1296


Fixed submission (verdict: Accepted):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    x=int(input())
    a=1
    for i in range(2,x+1):
        j=2
        while True:
            k=i**j
            if k>x:
                break
            if k>a:
                a=k
            j+=1
    print(a)

main()
Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=int(input())
ans=1
for i in range(2,int(x**0.5)+1):
    while i*i<=x:
        i*=i
    ans=max(i,ans)
print(ans)

Failing test case input:
354

Expected output:
343


Actual output:
324


Fixed submission (verdict: Accepted):
x=int(input())
ans=1
for i in range(2,int(x**0.5)+1):
    p=i
    while i*p<=x:
        p*=i
    ans=max(p,ans)
print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
stdin = sys.stdin

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

x = ni()
ans = 0
for i in range(100):
    p = i**2
    if p <= x:
        ans = p
    else:
        print(ans)
        break


Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
import sys
stdin = sys.stdin

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

x = ni()
ans = 0
for i in range(100):
    for j in range(2,11):
        p = i**j
        if p <= x:
            ans = max(ans, p)
        else:
            continue

print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

stdin = sys.stdin

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

x = ni()
max = 1

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


Failing test case input:
1746

Expected output:
1728


Actual output:
1681


Fixed submission (verdict: Accepted):
import sys

stdin = sys.stdin

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

x = ni()
max = 1
a = [2,3,4,5,6,7,8,9]

for i in range(1, x+1):
    for j in a:
        if i**j <= x and i**j > max:
            max = i**j
print(max)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = int(input())
ans = 1
a = 1
for i in range(int(x**(1/2)),-1,-1):
    j = 2
    while a < x:
        ans = max(ans,a)
        a = i**j
        j += 1
print(ans)

Failing test case input:
250

Expected output:
243


Actual output:
225


Fixed submission (verdict: Accepted):
x = int(input())
ans = 1
if x < 4:
    print(1)
else:
    for i in range(2,int(x**(1/2)+1)):
        j = 2
        a = -1
        while a <= x:
            ans = max(ans,a)
            a = i**j
            j += 1
    print(ans)

Problem: p03352
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = int(input())
BP = []
for x in range(X, 0, -1):
  for p in range(10, 1, -1):
    b = pow(x, 1/p)
    if b % 1 == 0:
      BP.append(x)
print(max(BP))

Failing test case input:
1357

Expected output:
1331


Actual output:
1296


Fixed submission (verdict: Accepted):
X = int(input())
BP = []
for b in range(1, 32):
  for p in range(2, 10):
    if b**p <= X:
      BP.append(int(b**p))
print(max(BP))