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

Fixed submission:
a=int(input())
li = list(map(int,input().split()))
 
n=1
if(0 in li):
	print(0)
else:
	for i in li:
		n=n*i
		if(n>1000000000000000000):
			n=-1
			break
	print(n)

Buggy submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))

n=1
for i in  list
    n*=n*list[i]

if(n>1000000000000000000):
    print("-1")
else:
    print(n)

Buggy submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))

n=1
for i in  range(list)
    n*=n*list[i]

if(n>1000000000000000000):
    print("-1")
else:
    print(n)
Problem p02606 (python)

Fixed submission:
a, b, c = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    if i % c == 0:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
from itertools import product

n = int(input())
def calc(i):
    xs = [a for a in range(1,int(i**0.5))]
    ys = [a for a in range(1,int(i**0.5))]
    zs = [a for a in range(1,int(i**0.5))]
    cnt = 0
    for x,y,z in list(product(xs,ys,zs)):
        if x**2+y**2+z**2+x*y+y*z+z*x == i:
            cnt += 1
    print(cnt)






for i in range(1, n+1):
    calc(i)
Problem p02646 (python)

Fixed submission:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if a <= b:
    total_a = a + v * t
    total_b = b + w * t
    if total_a >= total_b:
        print('YES')
    else:
        print('NO')
else:
    total_a = a - v * t
    total_b = b - w * t
    if total_a <= total_b:
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
x = abs(a-b) / (v - w)
if v <= w:
    print('NO')

else:
    if x >= t:
        print('YES')
    else:
        print('NO')
Problem p02657 (python)

Fixed submission:
N = [int(i) for i in input().split(' ')]
print(N[0] * N[1])

Buggy submission (verdict: Runtime Error):
a, b = map(input().split())
print(int(a) * int(b))
Problem p02675 (python)

Fixed submission:
hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
bon = 3
N = input()
r = int(N[-1])
if r in hon:
  print('hon')
elif r in pon:
  print('pon')
else:
  print('bon')

Buggy submission (verdict: Runtime Error):
from math import sin, radians, cos, sqrt
lst = [int(i) for i in input().split()]
A, B, H, M = tuple(lst)
angle = M * 6 - (H * 30 + M * 0.5)
if abs(angle) > 180:
  angle = 360 - abs(angle)
elif abs(angle) == 180:
  X = A + B
  print(X)
elif abs(angle) == 0:
  print(0)
else:
  angle = abs(angle)
  area = A * B * sin(radians(angle)) / 2
  co = sqrt(1 - sin(radians(angle)) ** 2)
  X = sqrt(A**2 + B**2 - 2*A*B*co)
  print(X)

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) >= K:
  print(S[:K], '...', sep='')
else:
  print(S)

Buggy submission (verdict: Runtime Error):
hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
bon = 3
N = int(input())
if N.pop() in hon:
  print('hon')
elif N.pop() in pon:
  print('pon')
else:
  print('bon')
Problem p03493 (python)

Fixed submission:
N = input()
print(N.count('1'))

Buggy submission (verdict: Runtime Error):
lst = [int(i) for i in input().rstrip().split('')]
c=0
for l in lst:
  if l == 1:
    c += 1
print(c)
Problem p02702 (python)

Fixed submission:
# for i in range(10):
# 	print( 10 ** i % 2019)



s = list(map(int, list(input())))
n = len(s)
MODULO = 2019

power = 1
prefix_ = [0 for _ in range(n+1)]
for i in range(n-1, -1, -1):
	prefix_[i] = (prefix_[i+1] + power*s[i]) % MODULO
	power *= 10
	power %= MODULO

seen = {}
ans = 0
for item in prefix_:
	ans += seen.get(item, 0)
	seen[item] = seen.get(item, 0) + 1

# print(s)
# print("prefix_", prefix_)
# print("unique", len(set(prefix_)))
# print("all", len(prefix_))
print(ans)

Buggy submission (verdict: Runtime Error):
# for i in range(10):
# 	print( 10 ** i % 2019)



s = list(map(int, list(input())))
n = len(s)
MODULO = 2019

power = 1a
prefix_ = [0 for _ in range(n+1)]
for i in range(n-1, -1, -1):
	prefix_[i] = (prefix_[i+1] + power*s[i]) % MODULO
	power *= 10
	power %= MODULO

seen = {}
ans = 0
for item in prefix_:
	ans += seen.get(item, 0)
	seen[item] = seen.get(item, 0) + 1

# print(s)
# print("prefix_", prefix_)
# print("unique", len(set(prefix_)))
# print("all", len(prefix_))
print(ans)
Problem p02600 (python)

Fixed submission:
X=int(input())

if X >= 400 and X <=599:
    print("8")
elif X >= 600 and X <=799:
    print("7")
elif X >= 800 and X <=999:
    print("6")
elif X >= 1000 and X <=1199:
    print("5")
elif X >= 1200 and X <=1399:
    print("4")
elif X >= 1400 and X <=1599:
    print("3")
elif X >= 1600 and X <=1799:
    print("2")
elif X >= 1800 and X <=1999:
    print("1")

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

if X >= 400 amd x <=599:
    print("8")
elif X >= 600 amd x <=799:
    print("7")
elif X >= 800 amd x <=999:
    print("6")
elif X >= 1000 amd x <=1199:
    print("5")
elif X >= 1200 amd x <=1399:
    print("4")
elif X >= 1400 amd x <=1599:
    print("3")
elif X >= 1600 amd x <=1799:
    print("2")
elif X >= 1800 amd x <=1999:
    print("1")
Problem p02767 (python)

Fixed submission:
import math
N=int(input())
X=list(map(int, input().split()))

num=sum(X)/N
num1=math.floor(num)
num2=math.ceil(num)

R1=[(X[i]-num1)**2 for i in range(N)]
R2=[(X[i]-num2)**2 for i in range(N)]
print(min(sum(R1),sum(R2)))

Buggy submission (verdict: Runtime Error):
import math

n, a, b=map(int, input().split())
mod = 10**9+7

L=[math.factorial(n) % mod // (math.factorial(n - i) % mod * math.factorial(i) % mod) for i in range(1,n+1) if i != a if i != b]
print(sum(L) % mod)
Problem p02796 (python)

Fixed submission:
N=int(input())
s=[list(map(int,input().split())) for i in range(N)]
A=N
c=0
s.sort(key=lambda x: x[0])

Check=[[s[i][0]-s[i][1],s[i][0]+s[i][1]] for i in range(N)]
tmp=Check[0][1]
for j in range(1,N):
    if tmp > Check[j][0]:
        c=c+1
        tmp=min(tmp, Check[j][1])
    else:
        tmp=Check[j][1]
    
print(A-c)

Buggy submission (verdict: Runtime Error):
N=int(input())
s=[list(map(int,input().split())) for i in range(N)]
A=N
c=0
s.sort(key=lambda x: x[0])

Check=[[s[i][0]-s[i][1],s[i][0]+s[i][1]] for i in range(N)]

for j in range(1,N):

    if Check[j-1][1] > Check[j][0]:
        c=c+1
        Check.remove(Check[j])
        j=j-1
        N=N-1
        if j == N:
            break
    
print(A-c)
Problem p02807 (python)

Fixed submission:
from math import factorial
 
N = int(input())
x = list(map(int, input().split()))
mod = 10**9 + 7
x_dis = [x[i+1] - x[i] for i in range(N-1)]
ans = 0
m = N-1
fac = factorial(m) % mod
tmp = fac
for i in range(m):
    ans += x_dis[i] * tmp
    ans %= mod
    tmp += (fac*pow((i+2),(mod-2), mod))%mod
print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial
import itertools

N=int(input())
x=list(map(int, input().split()))

C=0
t=[math.factorial(N-i) for i in range(2,N)]

t=list(itertools.accumulate(t))
t.append(math.factorial(N-1))
t.reverse()
T=list(itertools.accumulate(t))

C=[(x[j]-x[j-1])*T[j-1] for j in range(1,N) ]

print(sum(C)%((10 ** 9)+7))

Buggy submission (verdict: Runtime Error):
from math import factorial
from itertools import accumulate

N=int(input())
x=list(map(int, input().split()))

C=0
t=[math.factorial(N-i) for i in range(2,N)]

t=list(itertools.accumulate(t))
t.append(math.factorial(N-1))
t.reverse()
T=list(itertools.accumulate(t))

C=[(x[j]-x[j-1])*T[j-1] for j in range(1,N) ]

print(sum(C)%((10 ** 9)+7))

Buggy submission (verdict: Runtime Error):
import math
import itertools

N=int(input())
x=list(map(int, input().split()))

C=0
t=[math.factorial(N-i) for i in range(1,N+1)]
T=list(itertools.accumulate(t))

for j in range(1,N+1):
    C=C+(x[j]-x[j-1])*T[j]

print(C%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
import itertools

N=int(input())
x=list(map(int, input().split()))

t=[]

for i in range(1,N+1):
    v=math.factorial(N-i)
    t.append(v)
T=itertools.accumulate(t)

for j in range(1,N+1):
    C=C(x[j]-x[j-1])*T[i]

print(C%(10**9+7))
Problem p02811 (python)

Fixed submission:
K, X=map(int, input().split())

if 500*K >= X:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import itertools

N=int(input())
P=list(map(int, input().split()))
Q=list(map(int, input().split()))
A=list(range(1,N+1))

Pattern=[]
for i in itertools.permutations(A):
    Pattern.append(i)

c1=Pattern.index(P) + 1
c2=Pattern.index(Q) + 1

print(abs(c1-c2))

Buggy submission (verdict: Runtime Error):
import itertools

N=int(input())
P=list(map(int, input().split()))
Q=list(map(int, input().split()))

Pattern=[]
for i in range(1,N+1):
    Pattern.append(i)

c1=Pattern.index(P) + 1
c2=Pattern.index(Q) + 1

print(abs(c1-c2))
Problem p02830 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N=int(input())
S, T=map(list, input().split())
W=""
for i in range(N):
    W=W+S[i]
    W=W+T[i]

print(W)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N=int(input())
S, T=map(list, input().split())
W=[]
for i in range(N)
    W.append(S[i-1])
    W.append(T[i-1])

W=str(W)
print(W)
Problem p03998 (python)

Fixed submission:
sa = list(reversed(input()))
sb = list(reversed(input()))
sc = list(reversed(input()))

turn = sa.pop()

while True:
    if (turn == 'a' and not sa) or (
            turn == 'b' and not sb) or (turn == 'c' and not sc):
        break
    if turn == 'a':
        turn = sa.pop()
    elif turn == 'b':
        turn = sb.pop()
    else:
        turn = sc.pop()

print(turn.upper())

Buggy submission (verdict: Runtime Error):
sa = list(reversed(input()))
sb = list(reversed(input()))
sc = list(reversed(input()))

turn = sa.pop()

while True:
    if turn == 'a':
        turn = sa.pop()
    elif turn == 'b':
        turn = sb.pop()
    else:
        turn = sc.pop()
    if (turn == 'a' and not sa) or (
            turn == 'b' and not sb) or (turn == 'c' and not sc):
        break

print(turn.upper())
Problem p02812 (python)

Fixed submission:
ans=0
n=input()
s=input()
flag="0"

for i in s:
    if i=="A":
        flag="a"
    elif i=="B" and flag=="a":
        flag="b"
    elif i=="C" and flag=="b":
        flag="0"
        ans+=1
    else:
        flag="0"
        
print(ans)

Buggy submission (verdict: Runtime Error):
ans=0
n=input()
s=input()


for i in s:
    if i=="A":
        flag="a"
    elif i=="B" and flag=="a":
        flag="b"
    elif i=="C" and flag=="b":
        flag="0"
        ans+=1
    else:
        flag="0"
print(ans)
Problem p03006 (python)

Fixed submission:
n=int(input())
x=[]
for i in range(n):
    a,b=map(int,input().split())
    x.append([a,b])

                

d=[]
discount=[]
for i in range(n):
    for j in range(n):
        if i!=j:

            tmp=[x[i][0]-x[j][0],x[i][1]-x[j][1]]

            if tmp not in d:
                d.append(tmp)
                discount.append(1)
            else:
                discount[d.index(tmp)]+=1
     
    
if n==1:
    print(1)
else:
    print(n-max(discount))

Buggy submission (verdict: Runtime Error):
n=int(input())
x=[]
for i in range(n):
    a,b=map(int,input().split())
    x.append([a,b])

                

d=[]
discount=[]
for i in range(n):
    for j in range(n):
        if i!=j:

            tmp=[x[i][0]-x[j][0],x[i][1]-x[j][1]]

            if tmp not in d:
                d.append(tmp)
                discount.append(1)
            else:
                discount[d.index(tmp)]+=1
                
print(n-max(discount))
Problem p03085 (python)

Fixed submission:
s=input()

if s=="A":
    print("T")
elif s=="T":
    print("A")
elif s=="C":
    print("G")
else:
    print("C")

Buggy submission (verdict: Runtime Error):
s=input()
if s=="C":
  print("G")
elif s=="G":
  print("C")
elif s=="A":
  print("T"):
else:
  print("A")
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
s=input()
    
dp =[0 for j in range(n)]


for j in range(n):
    t=0
    if s[j]=="C" and j!=0:
        if s[j-1]=="A":
            t=1

    dp[j]=dp[j-1]+t
        

for i in range(q):
    l,r=map(int,input().split())
    print(dp[r-1]-dp[l-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
for i in range(q):
    l,r=map(int,input().split())

    
    
dp =[0 for j in range(n)]


for j in range(n):
    t=0
    if s[j]=="C" and j!=0:
        if s[j-1]=="A":
            t=1

    dp[j]=dp[j-1]+t
        

for i in range(q):
    l,r=map(int,input().split())
    print(dp[r-1]-dp[l-1])

Buggy submission (verdict: Runtime Error):
dp =[0 for j in range(n)]


for j in range(n):
    t=0
    if s[j]=="C" and j!=0:
        if s[j-1]=="A":
            t=1

    dp[j]=dp[j-1]+t
        

for i in range(q):
    l,r=map(int,input().split())
    print(dp[r-1]-dp[l-1])

Buggy submission (verdict: Runtime Error):


dp =[[0 for i in range(n+2)] for j in range(n+2)]

for i in range(1):
    for j in range(i,n):
        t=0
        if s[j]=="C" and j!=i:
            if s[j-1]=="A":
                t=1
        
        dp[i][j]=dp[i][j-1]+t
        
for i in range(1,n):
    t=0
    if s[i]=="C" and s[i-1]=="A":   
        dp[i]=list(map(lambda x: x-1,dp[i-1]))
    else:
        dp[i]=dp[i-1]        
        
        
for i in range(q):
    print(dp[l_li[i]-1][r_li[i]-1])
Problem p03103 (python)

Fixed submission:
n,m=map(int,input().split())
a=[]
for i in range(n):
    a.append(list(map(int,input().split())))

num_drink=0
price=0
a.sort()
for i in a:

    if num_drink+i[1]<m:
        
        num_drink+=i[1]
        price+=i[1]*i[0]

    else:
        price+=(m-num_drink)*i[0]

        break
    
print(price)

Buggy submission (verdict: Runtime Error):
num_drink=0
price=0
a.sort()
for i in a:

    if num_drink+i[1]<m:
        
        num_drink+=i[1]
        price+=i[1]*i[0]

    else:
        price+=(m-num_drink)*i[0]

        break
    
print(price)
Problem p03139 (python)

Fixed submission:
n,a,b=map(int,input().split())
mxs=min(a,b)
mns=max(0,a+b-n)
print(mxs,mns)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0

for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=2
        else:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=0
        
    count+=plus
    
print(count)
Problem p03140 (python)

Fixed submission:
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0

for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=0
        else:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=2
        
    count+=plus
    
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input()
b=input()
c=input()
al=list(a)
bl=list(b)
cl=list(c)

count=0
for i in range(n):
    if al[i]==bl[i]:
        if al[i]==cl[i]:
            plus=2
        elif:
            plus=1
    elif bl[i]==cl[i]:
        plus=1
    elif al[i]==cl[i]:
        plus=1
    else:
        plus=0
        
    count+=plus
    
print(count)
Problem p03141 (python)

Fixed submission:
n = int(input())

a = [0  for i in range(n)]
b = [0  for i in range(n)]
x = [[0,0,0]  for i in range(n)]

for i in range(n):
    a[i],b[i]=map(int,input().split())
    x[i][0]=abs(a[i]+b[i])
    x[i][1]=a[i]
    x[i][2]=b[i]

s=sorted(x,reverse=True)
#print(s)

nu=n//2
mod=n%2

count=0
for i in range(nu):
    count+=s[i*2][1]
  #  print(count)
    count-=s[i*2+1][2]
 #   print(count)

if mod==1:
    count+=s[2*nu][1]

    

    

print(count)

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

a = [0  for i in range(n)]
b = [0  for i in range(n)]
x = [[0,0,0]  for i in range(n+2)]

for i in range(n):
    a[i],b[i]=map(int,input().split())
    x[i][0]=abs(a[i]-b[i])
    x[i][1]=a[i]
    x[i][2]=b[i]

s=sorted(x,reverse=True)


nu=n//2
mod=n%2

count=0
for i in range(nu):
    count+=x[i*2][1]

    count-=x[i*2+1][2]


if mod==1:
    counta=x[2*nu][1]

    

    

print(counta)
Problem p03145 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(int(a*b/2))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())

li.sort(reverse=True,key=lambda x:x[1])

def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))

#-----------------------------------------
best_list=[]
best_list_neta=[]
not_best_list=[]

for i in li:
    if i[0] in best_list_neta:
        not_best_list.append(i[1])
    else:
        best_list.append(i[1])
        best_list_neta.append(i[0])


s2=min(len(best_list_neta),k)
s1=find_num_neta(list(range(k)),li)


score=-1
for i in range(s1,s2+1):
    oishisa=0
    for j in range(i):
        oishisa+=best_list[j]
    for j in range(k-i):
        oishisa+=not_best_list[j]
    
    new_score=i**2+oishisa

    if score<new_score:
        score=new_score
        
    
print(score)
Problem p03148 (python)

Fixed submission:
n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())



def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))
#-----------------------------------------

li.sort(reverse=True,key=lambda x:x[1])
s2=min(find_num_neta(list(range(n)),li),k)
s1=find_num_neta(list(range(k)),li)
oishisa=sum([li[i][1] for i in range(k)])
score=oishisa+s1**2

#-----------------------------------------
li.sort(key=lambda x:x[0])
best_list=[]
not_best_list=[]


m=-1
for i in li:
    if m==i[0]:
        not_best_list.append(i)
    else:
        best_list.append(i)
        m=i[0]
        
not_best_list.sort(reverse=True,key=lambda x:x[1])
best_list.sort(reverse=True,key=lambda x:x[1])



 
 
for i in range(s1+1,s2+1):
    oishisa=oishisa+best_list[i-1][1]-not_best_list[k-i][1]
    
    new_score=i**2+oishisa
    
    if score<new_score:
        score=new_score
        
    
print(score)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())

li.sort(reverse=True,key=lambda x:x[1])

def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))

#-----------------------------------------
best_list=[]
best_list_neta=[]
not_best_list=[]

for i in li:
    if i[0] in best_list_neta:
        not_best_list.append(i[1])
    else:
        best_list.append(i[1])
        best_list_neta.append(i[0])


s2=min(len(best_list_neta),k)
s1=find_num_neta(list(range(k)),li)


score=-1
oishisa=[0 for i in range(n)]
oishisa[s1]=sum([li[p][1] for p in range(k)])

for i in range(s1+1,s2+1):
    oishisa[i]=oishisa[i-1]-not_best_list[k-i]+best_list[i-1]
    
    new_score=i**2+oishisa[i]

    if score<new_score:
        score=new_score
        
    
print(score)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())
 

li.sort(reverse=True,key=lambda x:x[1])

def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))



#-----------------------------------------
best_list=[]
not_best_list=li.copy()

for i in li:
    if i[0] not in [best_list[p][0] for p in range(len(best_list))]:
        best_list.append(i)
        
for i in best_list:
    not_best_list.remove(i)

#-----------------------------------------
s2=min(find_num_neta(list(range(n)),li),k)
s1=find_num_neta(list(range(k)),li)

oishisa=[0 for i in range(n)]
oishisa[s1]=sum([li[i][1] for i in range(k) ])
score=oishisa[s1]+s1**2

for i in range(s1+1,s2+1):
    oishisa[i]=oishisa[i-1]+best_list[i-1][1]-not_best_list[k-i][1]
    new_score=oishisa[i]+i**2
    if score<new_score:
        score=new_score
     
    
print(new_score)
Problem p03192 (python)

Fixed submission:
n=input()
count=0

for k in n:
    if k== "2":
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N,P=list(map(int,input().split()))
 
root=P**(1/N)
x=round(root)

if n==1:
    print(p)
else:
	for i in range(x):
		if P%((x-i)**N)==0:
			print(x-i)
			break

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


def kouyaku(n,p):
    if n==1:
        return p 
    
    else:
        if int(p**(1/n))-p**(1/n)< 1e-11:
            return int(p**(1/n))
        else:
            for i in range(round((p**(1/n)/2+1)),0,-1):        
                if p%i==0:
                    if p%(i**2)==0:
                        if p%(i**n)==0:
                            return i

            
print(kouyaku(n,p))

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


def kouyaku(n,p):
    if n==1:
        return p 
    else:
        if int(p**(1/n))*n-p< 1e-6:
            return int(p**(1/n))
        else:
            for i in range(round((p**(1/n)/2+1)),0,-1):        
                if p%i==0:
                    if p%(i**2)==0:
                        if p%(i**n)==0:
                            return i

            
print(kouyaku(n,p))

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

def kouyaku(n,p):
    for i in range(round((p**(1/n)+1)),0,-1):
        if p%i==0:
            if p%(i**n)==0:
                return i
            
print(kouyaku(n,p))
Problem p03194 (python)

Fixed submission:
N, P = map(int, input().split())
ans = 1
 
if N >= 45:
  print(ans)
elif N == 1:
  print(P)
  
 
  
else:
  i = 1
  while(i**N <= P):
    if P % (i**N) == 0:
      ans = i
    i += 1
  print(ans)

Buggy submission (verdict: Runtime Error):
N,P=list(map(int,input().split()))
 
root=P**(1/N)
x=round(root)
 
if n==1:
    print(p)
else:
	for i in range(x):
		if P%((x-i)**N)==0:
			print(x-i)
			break
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if a*b%2==1:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
    
print(len(set(a)))
Problem p02601 (python)

Fixed submission:
A,B,C = map(int,input().split())
K = int(input())
i = 0
while True:
    if B > A:
        break
    else:
        B = B * 2
    i += 1
q = 0
while True:
    if C > B:
        break
    else:
        C = C * 2
    q += 1
if (i + q) > K:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input())
K = int(input())
if A > (B + C):
    print("No")
else:
    print("Yes")
Problem p02706 (python)

Fixed submission:
N , M = map(int,input().split())
A = list(map(int,input().split()))
if N < sum(A):
    print(-1)
else:
    print(N - sum(A))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = list(map(int,input().split()))

if sum(A) < A:
    print(-1)
else:
    print(A - sum(A))
Problem p02741 (python)

Fixed submission:
def main():
    k = input()
    n = [
        1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
    ]
    print(n[int(k) - 1])
main()

Buggy submission (verdict: Runtime Error):
def main():
    X = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    K = int(input())
    return X[K]
print(main())

Buggy submission (verdict: Runtime Error):
def main():
    k = input()
    n = [
        1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
    ]
    print(n[int(k)])
main()

Buggy submission (verdict: Runtime Error):
def main():
    k = input()
    n = [
        1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
    ]
    print(n[k])
main()
Problem p02817 (python)

Fixed submission:
def main():
    S,T = input().split()
    print("{}{}".format(T,S))
main()

Buggy submission (verdict: Runtime Error):
S,T = map(int,input().split())
print(T + S)