Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02684 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
import sys 
sys.setrecursionlimit(10000000)


n,k = iim()
A = iil()
d = {0:True}
l = [0]
def move(num):
    l.append(A[num]-1)
    if d.get(A[num]-1,False):
        return True if A[num]-1 == 0 else False
    else:
        d[A[num]-1] = True
        return move(A[num]-1)

if move(0):
    rep = len(l)-1
    ini = 0
else:
    ini = l.index(l[-1])
    rep = len(l)-ini-1

if k <= ini:
    print(l[k]+1)
else:
    mod = (k-ini)%rep
    if mod == 0:
        mod = rep
#    print(l,mod,rep,ini)
    print(l[ini+mod]+1)

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,k = iim()
A = iil()
d = {0:True}
l = [0]
def move(num):
    l.append(A[num]-1)
    if d.get(A[num]-1,False):
        return True if A[num]-1 == 0 else False
    else:
        d[A[num]-1] = True
        return move(A[num]-1)

if move(0):
    rep = len(l)-1
    ini = 0
else:
    ini = l.index(l[-1])
    rep = len(l)-ini-1
if k <= ini:
    print(l[k]+1)
else:
    mod = (k-ini)%rep
    if mod == 0:
        mod = rep
#    print(l,mod,rep,ini)
    print(l[ini+mod]+1)

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,k = iim()
A = iil()
d = {0:True}
l = [0]
def move(num):
    l.append(A[num]-1)
    if d.get(A[num]-1,False):
        return True if A[num]-1 == 0 else False
    else:
        d[A[num]-1] = True
        return move(A[num]-1)

if move(0):
    rep = len(l)-1
    ini = 0
else:
    ini = l.index(l[-1])
    rep = len(l)-ini-1
mod = (k-ini)%rep
if mod == 0:
    mod = rep
#print(l,mod,rep)
print(l[ini+mod]+1)

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,k = iim()
A = iil()
d = {}
l = [0]
def move(num):
    if d.get(A[num]-1,False):
        return len(l)
    else:
        d[A[num]-1] = True
        l.append(A[num]-1)
        return move(A[num]-1)

rep = move(0)
mod = k%rep
#print(l,mod)
print(l[mod+1]+1)
Problem p02690 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x = ii()
l = [0]
i = 0
num = 0
while num < 10**15:
    i += 1
    num = i**5
    l.append(num)
#print(l[-1]-l[-2])
l = set(l)
for item in l:
    if item > x:
        if item - x in l:
            print(int(item**0.2),int((item-x)**0.2))
            exit()
    else:
        if x - item in l:
            print(int(item**0.2),int((x-item)**0.2)*(-1))
            exit()

'''
    if x - item in l:#Aがitemでx-itemは-B**5
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
    elif item - x in l:#Aがitemでx-itemはB**5
#        print(item,item-x)
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
'''

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x = ii()
l = [0]
i = 0
num = 0
while num < 10**10:
    i += 1
    num = i**5
    l.append(num)
l = set(l)
for item in l:
    if x - item in l or item - x in l:
        print(int(item**0.2),int((x-item)**0.2))
        exit()
Problem p02713 (python)

Fixed submission:
import math
k = int(input())
ans = 0
if k < 3:
    for i in range(1,k+1):
        for j in range(1,k+1):
            for n in range(1,k+1):
                ans += math.gcd(i,math.gcd(j,n))
else: 
    #i*j
    for n in range(1,k+1):
        for i in range(1,k+1):
            ans += math.gcd(n,i)
            for j in range(i+1,k+1):            
                ans += 2*(math.gcd(math.gcd(i,j),n))

    '''
        for i in range(1,k+1):
            for j in range(i+1,k+1):
                for k in range(j+1,k+1):
                    ans += math.gcd(i,math.gcd(j,k))
    '''
print(ans)

Buggy submission (verdict: Runtime Error):
import math
k = int(input())
ans = 0

for i in range(1,k+1):
	for j in range(1,k+1):
      	for n in range(1,k+1):
          	ans += math.gcd(i,math.gcd(j,n))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
k = int(input())
ans = 0

for i in range(1,k+1):
	for j in range(1,k+1):
      	for k in range(1,k+1):
          	ans += math.gcd(i,math.gcd(j,k))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
k = int(input())
ans = 0

for i in range(1,k+1):
	for j in range(i+1,k+1):
      	for k in range(j+1,k+1):
          	ans += math.gcd(i,math.gcd(j,k))
print(ans)
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = map(int,input().split())
red = sorted(list(map(int,input().split())),reverse=True)[:x]
green = sorted(list(map(int,input().split())),reverse=True)[:y]
white = sorted(list(map(int,input().split())),reverse=True)

l = sorted(red+green+white,reverse=True)[:x+y]
print(sum(l))

Buggy submission (verdict: Runtime Error):
from collections import deque

x, y, a, b, c = map(int,input().split())
red = sorted(list(map(int,input().split())))[a-x:]
green = sorted(list(map(int,input().split())))[b-y:]
white = sorted(list(map(int,input().split())))
rcnt = 0
rflag = 0
gcnt = 0
gflag = 0
ans = 0
#print(red,green,white)


for i in range(x+y):
#    print(red,green,white)    
    if red[-1] == max(red[-1],green[-1],white[-1]):
#        print('hoge')
        rcnt += 1
        ans += red.pop(-1)
        if len(red) == 0:
            red = [0]
    elif green[-1] == max(red[-1],green[-1],white[-1]):
#        print('huga')
        gcnt += 1
        ans += green.pop(-1)
        if len(green) == 0:
            green = [0]
    else:
        if red[rflag] < green[gflag]:
            rcnt += 1
            rflag += 1
        else:
            gcnt += 1
            gflag += 1
#        print('foo')
        ans += white.pop(-1)
        if len(white) == 0:
            white = [0]
print(ans)
Problem p02806 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n = ii()
music = []
length = []
for i in range(n):
    ti,leng = map(str,input().split())
    music.append(ti)
    length.append(int(leng))
x = input()

num = music.index(x)
print(sum(length[num+1::]))

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
n = ii()
music = []
length = []
for i in range(n):
    ti,leng = map(str,input().split())
    music.append(ti)
    length.append(leng)
x = input()

num = music.index(x)
print(sum(length[x::]))
Problem p03048 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

r,g,b,n = iim()
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        num = n-i*r-j*g
        if num%b == 0 and num//b >= 0:
#            print(i,j,num//b)
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

#pythonだとTLE/pypyだとAC
'''
r,g,b,n = iim()
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        num = n-i*r-j*g
        if num%b == 0 and num//b >= 0:
#            print(i,j,num//b)
            ans += 1
print(ans)
'''

#上を受けてpythonでも通るように改良
*num,n = iim()
a,b,c = map(int,sorted(num))
ans = 0
for i in range(n//c+1):
    if a!= 1:
        for j in range(n//b+1):
            num = n-i*r-j*g
            if num%a == 0 and num//a >= 0:
                ans += 1
    else:
        n -= i*c
        if n == 0:
            ans += 1
        elif n > 0:
            if n%b == 0:
                ans += n//b+1
            else:
                ans += n//b
print(ans)
Problem p03106 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,k = iim()
ans = []
for i in range(1,min(a,b)+1):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[-k])

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,k = iim()
ans = []
for i in range(min(a,b)):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[k-1])
Problem p03231 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
#from math import gcd
from fractions import gcd
n,m = iim()
s = input()
t = input()
num = gcd(n,m)
lcm = n*m//num
print(lcm if s[::n//num] == t[::m//num] else -1)

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
from math import gcd

n,m = iim()
s = input()
t = input()
num = gcd(n,m)
lcm = n*m//num
print(lcm if s[::n//num] == t[::m//num] else -1)
Problem p03260 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
A = iil()

if 2 in A:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
#import math
import fractions
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,x = iim()
xmod = list(map(lambda y:int(y)-x,input().split()))
#print(xmod)
num = xmod[0]
for i in xmod:
    gcd = fractions.gcd(num,i)

print(gcd)
Problem p03262 (python)

Fixed submission:
#import math
import fractions
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,x = iim()
xmod = list(map(lambda y:abs(int(y)-x),input().split()))
#print(xmod)
gcd = xmod[0]
for i in xmod:
    gcd = fractions.gcd(gcd,i)

print(gcd)

Buggy submission (verdict: Runtime Error):
import math
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,x = iim()
xmod = list(map(lambda y:int(y)-x,input().split()))
#print(xmod)
num = xmod[0]
for i in xmod:
    gcd = math.gcd(num,i)

print(gcd)
Problem p03282 (python)

Fixed submission:
import re
s = input()
k = int(input())

if s[0] != '1':
    print(s[0])
    exit()
else:
    pos = re.search(r'1+',s).end()
    if k <= pos:
        print(1)
    else:
        print(s[pos])

Buggy submission (verdict: Runtime Error):
import re
s = input()
k = int(input())

if s[0] != '1':
    print(s[0])
    exit()
else:
    pos = re.search(r'1+',s).end()
    if k < pos:
        print(1)
    else:
        print(s[pos])
Problem p03296 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()
ans = 0
for i in range(1,n):
    if A[i-1] == A[i]:
        ans += 1
        A[i] = -1
print(ans)

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()
ans = 0
for i in range(1,n)
    if A[i-1] == A[i]:
        ans += 1
        A[i] = -1
print(ans)
Problem p03355 (python)

Fixed submission:
s = input()
se = (s)
k = int(input())
n = len(s)

se = set()
for i in range(n):
    for j in range(i+1,i+1+k):
#        print(i,j,s[i:j])
        se.add(s[i:j])
#print(se)
l = sorted(list(se))
print(l[k-1])
        










#TLE 
'''
se = set()
for i in range(n):
    for j in range(i+1,n+1):
#        print(i,j,s[i:j])
        se.add(s[i:j])
#print(se)
l = sorted(list(se))
print(l[k-1])
'''

Buggy submission (verdict: Runtime Error):
s = list(input())
se = (s)
k = int(input())
n = len(s)

se = set()
for i in range(n):
    for j in range(i+1,i+1+k):
#        print(i,j,s[i:j])
        se.add(s[i:j])
#print(se)
l = sorted(list(se))
print(l[k-1])
        










#TLE 
'''
se = set()
for i in range(n):
    for j in range(i+1,n+1):
#        print(i,j,s[i:j])
        se.add(s[i:j])
#print(se)
l = sorted(list(se))
print(l[k-1])
'''
Problem p03361 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

h,w = iim()

flag = True

l = []
dx = [0,0,1,-1]
dy = [1,-1,0,0]
for i in range(h):
    l.append(list(input()))

for i in range(h):
    for j in range(w):
        if l[i][j] == '#':
            check = False
            for k in range(4):
                if i+dx[k] < 0 or i+dx[k] >= h:
                    continue
                if j+dy[k] < 0 or j+dy[k] >= w:
                    continue
                if l[i+dx[k]][j+dy[k]] == '#':
                    check = True
            if not check:
                flag = False

print('Yes' if flag else 'No')

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

h,w = iim()

flag = True

l = []
dx = [0,0,1,-1]
dy = [1,-1,0,0]
for i in range(h):
    l.append(list(input()))

for i in range(h):
    for j in range(w):
        if l[i][j] == '#':
            check = False
            for k in range(4):
                if i+dx[k] < 0 or i+dx[k] >= w:
                    continue
                if j+dy[k] < 0 or j+dy[k] >= h:
                    continue
                if l[i+dx[k]][j+dy[k]] == '#':
                    check = True
            if not check:
                flag = False

print('Yes' if flag else 'No')
Problem p03378 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m,x = iim()
before = 0
after = 0
A = iil()
for i in A:
    if i < x:
        before += 1
    else:
        after += 1

print(min(before,after))

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m,x = iim()
before = 0
after = 0
for i in range(m):
    if ii() < x:
        before += 1
    else:
        after += 1

print(min(before,after))
Problem p03694 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n = ii()
A = set(sorted(iil()))
print(max(A)-min(A))

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n = ii()
A = set(sorted(iil()))
print(set[-1]-set[0])
Problem p03695 (python)

Fixed submission:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[min(i//400,8)] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(max(1,ans),ans+l[8])

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[max(i//400,8)] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(ans,ans+l[8])

Buggy submission (verdict: Runtime Error):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

l = [0]*9
for i in A:
    l[i//400] += 1

lf = l[:-1]
ans = 8-lf.count(0)
print(ans,ans+l[8])
Problem p03779 (python)

Fixed submission:
x = int(input())
num = 0
for i in range(1,1000000):
    num += i
    if num >= x:
        print(i)
        exit()

Buggy submission (verdict: Runtime Error):
x = int(input())
num = 0
for i in range(1,1e6):
    num += i
    if num >= x:
        print(i)
        exit()
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n > k:
    print(k*x+(n-k)*y)
else:
    print(n*x)

Buggy submission (verdict: Runtime Error):
import math
import sys
sys.setrecursionlimit(10000000)

n = int(input())
s = int(input())

up = math.sqrt(n)

def colsum(num, base):
    if num < base:
        return num
    else:
        return num%base + colsum(num//base,base)

#s = n(n<b)
if s == n:
    print(n+1)
    exit()


#sqrt(n)まで探索
for i in range(2,int(up)+1):
    if s == colsum(n,i):
        print(i)
        exit()

#2桁しかあり得ない場合(sqrt(n)<b<n)
for j in range(1,int(up)+1):
    if (n-s)%j == 0:
        b = (n-s)/j + 1
        if s == colsum(n,b) and b > 1:
            print(i)
            exit()

print(-1)
Problem p02607 (python)

Fixed submission:
n = int(input())  # nは入力回数
num_list = list(map(int, input().split()))
count = 0

if n%2 == 0:
  for i in range(n//2):
    if (num_list[2*i]%2) == 1:
      count += 1
else:
  for i in range((n//2) + 1):
    if (num_list[2*i]%2) == 1:
      count += 1
      
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())  # nは入力回数
num_list = list(map(int, input().split()))
count = 0

if n//2 == 0:
  for i in range(n//2):
    if (num_list[2*i]%2) == 1:
      count += 1
else:
  for i in range((n//2) + 1):
    if (num_list[2*i]%2) == 1:
      count += 1
      
print(count)
Problem p02657 (python)

Fixed submission:
s = input().split()
print(int(s[0]) * int(s[1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
if N > len(A):
  print(0)
else:
  tmp = 1
  for i in range(N):
    tmp *= A[i]
  if np.log10(tmp) > 18:
    print(-1)
  else:
    print(tmp)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
if N > len(A):
  print(0)
else:
  tmp = 1
  for i in range(N):
    tmp *= A[i]
  if np.log(tmp) > 18:
    print(tmp)
  else:
    print(-1)

Buggy submission (verdict: Runtime Error):
s = input().split()
s[0] * s[1]
Problem p02694 (python)

Fixed submission:
X = int(input())
N = 100
for i in range(1,10000000000):
  N = int(N*1.01)
  if N >= X:
    print(i)
    break

Buggy submission (verdict: Runtime Error):
X = int(input())
N = 100
for i in range(1:10000000000):
  N = int(N*1.01)
  if N >= X:
    print(i)
    break
Problem p02628 (python)

Fixed submission:
n, k = map(int, input().split())
fruits = list(map(int, input().split()))

mix = []
a = 0

while a < k:
    mix.append(min(fruits))
    fruits.remove(min(fruits))
    a += 1

print(sum(mix))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
fruits = list(map(int, input().split()))

mix = []

for mix in range(k):
    mix.append(min(fruits))
    fruits.remove(min(fruits))

print(sum(mix))
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())

c = 0

while x >= 0:
    if c * 2 + x * 4 == y:
        break
    c += 1
    x += -1
else:
    print("No")
    exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

c = 0

while x >= 0 :
    if c * 2 + x * 4 == y :
        break 
    c += 1
    x -= 1
else :
    print(No)

print(Yes)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())

c = 0
t = x

while t >= 0 :
    if c * 2 + t * 4 == y :
        break 
    c += 1
    t += -1
else :
    print(No)

print(Yes)

Buggy submission (verdict: Runtime Error):
x , y = map(int, input().split())

c = 0
t = x

while t >= 0 :
    if c * 2 + t * 4 = y :
        break 
    c += 1
    t += -1
else :
    print(No)

print(Yes)

Buggy submission (verdict: Runtime Error):
x , y = map(int, input().split()))

ans = False
c = 0
t = x

while ans = False :
    if t = -1 :
        break 
        elif c*2+t*4 == y :
            ans = True
        elif : 
            c += 1
            t += -1

if ans :
    print(Yes)
    elif :
      print(No)
Problem p03352 (python)

Fixed submission:
x = int(input())

if x == 1:
    print("1")
    exit()


def func(p):
    q = p
    while q < x:
        q *= p
        if q == x:
            return q
    if q / p == p:
        return 1
    else:
        return q // p


z = []
a = 2

while a <= x:
    z.append(func(a))
    a += 1

print(max(z))

Buggy submission (verdict: Runtime Error):
x = int(input())


def func(p):
    q = 1
    while q <= x:
        q *= p
    return q / p


z = []
a = 2


if x = 1:
    print("1")
    exit()


while a <= x ** 0.5:
    z.append(func(a))
    a += 1

print(max(z))

Buggy submission (verdict: Runtime Error):
x = int(input())


def func(p):
    q = 1
    while q <= x:
        q *= p
    return q / p


z = []
a = 2

if x = 1:
    print("1")
    exit()

else:
    while a <= x ** 0.5:
        z.append(func(a))
        a += 1

print(max(z))

Buggy submission (verdict: Runtime Error):
x = input(int, )


def func(p):
    q = 1
    while p ** q <= x:
        q += 1
    return p ** (q - 1)


ctn = []
a = 1

while a <= x:
    ctn.append(func(a))
    a += 1

print(max(ctn))

Buggy submission (verdict: Runtime Error):
x = input(int, )


def func(p):
    q = 1
    while p ** q <= x:
        q += 1
    return p ** (q - 1)


ctn = []
a = 1

while a <= x ** (1/2):
    ctn.append(func(a))
    a += 1

print(max(ctn))

Buggy submission (verdict: Runtime Error):
x = input(int, )

def func(p):
    q = 1
    while p ** q <= x:
        q += 1
    return p ** (q - 1)

l = []
a = 1

while a <= x ** (1/2):
    l.append(func(a))
    a += 1

print(l.sort([-1]))