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

Fixed submission:
from fractions import gcd

N, M = map(int, input().split())
S = input()
T = input()

dic = {}
L = int((N*M) / gcd(N,M))
ans = L

for i in range(N):
  dic[int(i*(L/N)+1)] = i

key = set(dic.keys())
for i in range(M):
  if i*(L/M)+1 in key:
    if S[dic[int(i*(L/M)+1)]] == T[i]:continue
    else: 
      ans = -1
      break

  


print(ans)

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int, input().split())
S = input()
T = input()


dic = {i+1: [] for i in range(int((N*M) / math.gcd(N,M)))}
L = len(dic)
ans = L

for n in range(N):
  k = int(n*(L/N))+1
  #print(k)
  dic[k].append(S[n])

#print(dic)
for m in range(M):
  k = int(m * (L/M) + 1)
  if len(dic[k]) == 0:continue
  else: 
    #print(T[m],dic[k])
    if dic[k][0] != T[m]:
      ans = -1
      break


print(ans)
Problem p03285 (python)

Fixed submission:
def main(N):
  
    CP = 4
    DP = 7
    
    if N <= 3:
        return "No"
    
    for i in range(100):
        for j in range(100):
            if (CP * i + DP * j) == N:
                return "Yes"
    return "No"
N = int(input())
print(main(N))

Buggy submission (verdict: Runtime Error):
def Cakes_and_Donuts(N):
    CP = 4
    DP = 7
    
    if N <= 3:
        return f"No"
    
    for i in range(26):
        for j in range(15):
            if (CP * i + DP * j) == N:
                return f"Yes"
    
    return f"No"
  
  N = int(input())
  Cakes_and_Donuts(N)

Buggy submission (verdict: Runtime Error):
def main(N):
    CP = 4
    DP = 7
    
    if N <= 3:
        return f"No"
    
    for i in range(26):
        for j in range(15):
            if (CP * i + DP * j) == N:
                return f"Yes"
    
    return f"No"

Buggy submission (verdict: Runtime Error):
def Cakes_and_Donuts(N):
    CP = 4
    DP = 7
    
    if N <= 3:
        return f"No"
    
    for i in range(26):
        for j in range(15):
            if (CP * i + DP * j) == N:
                return f"Yes"
    
    return f"No"
Problem p03341 (python)

Fixed submission:
N = int(input())
S = input()

sum_w = [0]
sum_e = [0]

count = 0
for i in range(N-1):
  if S[i] == "W":
    count += 1
  sum_w.append(count)

count = 0
for i in range(N-1,0,-1):
  if S[i] == "E": 
    count += 1
  sum_e.append(count)
sum_e = sum_e[::-1]

#print(len(sum_e), len(sum_w))
sumu = [x+y for x, y in zip(sum_w, sum_e)]

print(min(sumu))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
stock = []
#INF = 10**9
for i in range(1,len(S)-1):
  if (S[i-1] == "E") & (S[i+1] == "W"): stock.append(i)

dic = {k:0 for k in stock}
dic[0]＝ S.count("E")
dic[len(S)-1] = S.count("W")

for i in stock:
  for j in range(i-1,0,-1):
    if j < 0: break
    else:
      if S[j] == "E" : dic[i] += 1
      else: break

  for j in range(i+1, len(S)):
    if j > len(S)-1: break
    else:
      if S[j] == "W" : dic[i] += 1
      else: break

max_k = max(dic, key=dic.get)


count = 0
for i in range(0,max_k):
  if S[i] == "W": count += 1

for i in range(max_k+1, len(S)):
  if S[i] == "E": count += 1




print(count)
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())
ans = [-1,-1,-1]
for x in range(N+1):
  for y in range(N+1):
    z = N-x-y
    if z < 0: continue

    if (10000*x + 5000*y + 1000*z) == Y: 
      ans[0]= x
      ans[1]= y
      ans[2]= z
      break
    else: continue

if ans[0]==-1:print("-1 -1 -1")
else:
  print("{} {} {}".format(ans[0],ans[1],ans[2]))

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
ans = [-1,-1,-1]
for x in range(N+1):
  for y in range(N+1):
    z = N-x-y
    if z < 0: continue

    if (10000*x + 5000*y + 1000*z) == Y: 
      ans[0]= x
      ans[1]= y
      ans[2]= z
      break
    else: continue

if ans[0]==-1:print("-1 -1 -1")
else:
  print(f"{ans[0]} {ans[1]} {ans[2]}")
Problem p03486 (python)

Fixed submission:
s = sorted(input())
t = sorted(input(),reverse=True)


if s < t: print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input(),reverse=True)
flag = -1
i = 0

while(i < len(s)):
  if s[i] > t[i]:
    flag = -1
    break
  elif s[i] < t[i]:
    flag = 1
    break
  else:
    i += 1

if flag == 1: print("Yes")
else: print("No")
Problem p02646 (python)

Fixed submission:
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())
if abs(B-A)>(V-W)*T:
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
A,V,B,W,T=map(int,input().split())
if abs(B-A)>(V-W)*T:
    print('NO')
else:
    print('YES')
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=input().split()
A=int(a)
B=float(b)
x=a*b//1
print(x)

Buggy submission (verdict: Runtime Error):
n=int(input()) 
alist=list(map(int,input().split()))
a=1
if 0 in alist:
    print("0")
else:
    for i in alist:
        if a<=10**18:
            a=a*i
        else:
            break
    if a>10**18:
        print('-1')
    else:
        print(a)

Buggy submission (verdict: Runtime Error):
n=int,input()
a=list(map(int,input().split()))
from operator import mul
from functools import reduce
x=reduce(mul, a)
if x>=10**18:
    print('-1')
else:
    print(x)
Problem p02663 (python)

Fixed submission:
okiji,okihun,neji,nehun,benji=map(int,input().split())
print((neji*60+nehun)-(okiji*60+okihun)-benji)

Buggy submission (verdict: Runtime Error):
okiji,okihun,neji,nehun,benji=map(int,input().split())
    print((neji*60+nehun)-(okiji*60+okihun)-benji)
Problem p02612 (python)

Fixed submission:
N = int(input())
otsuri = N % 1000
if not otsuri == 0:
    otsuri = 1000 - otsuri
print(otsuri)

Buggy submission (verdict: Runtime Error):
N = input()
otsuri = N % 1000
if otsuri > 0
    orsuri = 1000 - otsuri
print(otsuri)
Problem p02573 (python)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m=map(int,input().split())
ab = [list(map(int, input().split())) for i in range(m)]

ans=0
u=UnionFind(n)
for a,b in ab:
    u.union(a-1,b-1)

for i in range(n):
    ans=max(ans,u.size(i))
    
print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans=0
relationships = [list(map(int, input().split())) for i in range(m)]
for i in range(m):
    relationships[i].sort()

relationships.sort()
groups = []
groups.append(set(relationships[0]))
for i in range(1, m):
    for j in range(len(groups)):
        if relationships[i][0] in groups[j]:
            groups[j].add(relationships[i][1])
        elif relationships[i][1] in groups[j]:
            groups[j].add(relationships[i][0])
        else:
            groups.append(set(relationships[i]))

for group in groups:
    ans=max(ans, len(group))

print(ans)
Problem p02713 (python)

Fixed submission:
import math
 
k=int(input())
cnt=0
tmp=[]
for a in range(k):
  a=a+1
  for b in range(k):
    b=b+1
    tmp.append(math.gcd(a,b))
for i in tmp:
  if i==1:
    cnt=cnt+k
  else:
    for j in range(k):
      j=j+1
      cnt=cnt+math.gcd(i,j)
print(cnt)

Buggy submission (verdict: Runtime Error):
import math

k=int(input())
cnt=0
for a in range(k):
  a=a+1
  for b in range(k):
    b=b+1
    for c in range(k):
      c=c+1
      cnt=cnt+math.gcd(a,b,c)
print(cnt)
Problem p02741 (python)

Fixed submission:
s=[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())
print(s[k-1])

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
if 0<(c-a-b)**2-4*a*b and 0<c-a-b:
  print('Yes')
else:
  print('No')
Problem p02747 (python)

Fixed submission:
s=input()
if s.count('hi')*2==len(s):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(len(s)):
  if i == len(s)-1:
    print('No')
    break
  if s[i]=='h':
    if s[i+1]=='i':
      if i == len(s):
        print('Yes')
        break
      else:
        if s[i+2]!='a' and s[i+2]!='i' and s[i+2]!='u' and s[i+2]!='e' and s[i+2]!='o':
              print('Yes')
              break
Problem p03160 (python)

Fixed submission:
N=int(input())
h=[int(i) for i in input().split()][:N]
dp=[float('inf')]*N
dp[0]=0
for i in range(N-1):
    if i+1<N:
        dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]))
    if i+2<N:
        dp[i+2]=min(dp[i+2],dp[i]+abs(h[i+2]-h[i]))
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
dp=[-1]*(10**9+2)
def frog(arr,N):
    if N==0:
        dp[0]=arr[0]
        return dp[0]
    elif N==1:
        dp[1]=abs(arr[1]-arr[0])
        return dp[1]
    elif N==2:
        dp[2]=min(frog(arr,N-1)+abs(arr[N]-arr[N-1]),abs(arr[N]-arr[N-2]))
        return dp[2]
    else:
        if dp[N]!=-1:
            return dp[N]
        dp[N]=min(frog(arr,N-2)+abs(arr[N]-arr[N-2]),frog(arr,N-1)+abs(arr[N]-arr[N-1]))
        return dp[N]
if __name__ == "__main__":
    N=int(input())
    h=[int(i) for i in input().split()][:N]
    print(frog(h,N-1))
Problem p03161 (python)

Fixed submission:
from sys import stdin
N,K=map(int,stdin.readline().split())
h=[int(i) for i in stdin.readline().split()][:N]
dp=[float('inf') for i in range(N)]
dp[0]=0
for i in range(N):
    for j in range(i+1,i+K+1):
        if j<N:
            dp[j]=min(dp[j],dp[i]+abs(h[j]-h[i]))
    #print(dp)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
'''
                                    *             * * * * * * * *
                                    *             *
                                    *             *
                                    *             *
                                    *             *
                                    *             *
                                    *             *
                                    * * * * * * * * * * * * * * *
                                                  *             *
                                                  *             *
                                                  *             *
                                                  *             *
                                                  *             *
                                                  *             *
                                    * * * * * * * *             *

'''
import sys
sys.setrecursionlimit(10**9)
dp=[-1]*(10**5+2)
dp[0]=0
def frog2(arr,N,K):
    if N==0:
        return dp[0]
    if dp[N]!=-1:
        return dp[N]
    cnt=10**8
    for i in range(N-1,max(N-K-1,-1),-1):
        cnt=min(cnt,frog2(arr,i,K)+abs(arr[N]-arr[i]))
    dp[N]=cnt
    return cnt
if __name__ == "__main__":
    N,K=map(int,input().split())
    h=[int(i) for i in input().split()][:N]
    frog2(h,N-1,K)
    #print(dp)
    print(dp[N-1])
Problem p03632 (python)

Fixed submission:
A,B,C,D = map(int,input().split())
lower = max(A,C)
upper = min(B,D)

print(max(0,upper-lower))

Buggy submission (verdict: Runtime Error):
#include<iostream>
using namespace std;

int main(void){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    const int lower = max(A,C);
    const int upper = min(B,D);
    
    cout << max(0,upper-lower) << endl;
    
    return 0;
}
Problem p02606 (python)

Fixed submission:
l, r, d = map(int, input().split())

ans = int(r/d)-int((l-1)/d)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())

a = [0]*n

for x in range(1, int(math.sqrt(n))+1):
    for y in range(1, x+1):
        for z in range(1, y+1):
            t = x**2+y**2+z**2+x*y+y*z+z*x-1
            if t >= n:
                break
            if ((x==y)and(y!=z))or((x==z)and(y!=x))or((y==z)and(x!=z)):
                a[t] += 3
            elif (x!=y)and(y!=z)and(x!=z):
                a[t] += 6
            else:
                a[t] += 1

for i in range(n):
    print(a[i])

Buggy submission (verdict: Runtime Error):
import math

n = int(input())

a = [0]*n

for x in range(1, int(math.sqrt(n))+1):
    for y in range(1, x+1):
        for z in range(1, y+1):
            t = x**2+y**2+z**2+x*y+y*z+z*x-1
            if t >= n:
                break
            if ((x==y)and(y!=z))or((x==z)and(y!=x))or((y==z)and(x!=z)):
                a[t] = 3
            elif (x!=y)and(y!=z)and(x!=z):
                a[t] = 6
            else:
                a[t] = 1

for i in range(n):
    print(a[i])

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

a = [0]*n

for x in range(1, int(sqrt(n))+1):
    for y in range(1, x+1):
        for z in range(1, y+1):
            t = x**2+y**2+z**2+x*y+y*z+z*x-1
            if t >= n:
                break
            if ((x==y)and(y!=z))or((x==z)and(y!=x))or((y==z)and(x!=z)):
                a[t] = 3
            elif (x!=y)and(y!=z)and(x!=z):
                a[t] = 6
            else:
                a[t] = 1

for i in range(n):
    print(a[i])
Problem p02663 (python)

Fixed submission:
h1, m1, h2, m2, k = map(int, input().split())
n = (h2-h1)*60 + m2 - m1 - k
print(n)

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

a = list(map(int, input().split()))
d = 0
t = 0.5

for i in range(n+1):
    d += (1+i)*a[i]
    t += a[i]/(2.0**(i+1))
    
k = sum(a)-1
d = d - 1/2*k*(k+1)

if t > 1.0:
    print('-1')
else:
    print(int(d))
Problem p02687 (python)

Fixed submission:
S = input()

if S == 'ABC':
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
S = input()

if S == ABC:
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
S = input()

if S = ABC:
    print('ARC')
else:
    print('ABC')
Problem p02690 (python)

Fixed submission:
x = int(input())

for a in range(1, 120):
    for b in range(-a, a):
        if pow(a, 5) - pow(b, 5) == x:
            break
    if pow(a, 5) - pow(b, 5) == x:
         break
            
print(a, b)

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

for a in range(1, x):
    for b in range(-a, a):
        if pow(a, 5) - pow(b, 5) == x:
            break
    if pow(a, 5) - pow(b, 5) == x:
         break
            
print(a, b)

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

for a in range(1, x):
    for b in range(-a, a):
        if pow(a, 5) - pow(b, 5) == x:
            break
    if pow(a, 5) - pow(b, 5) == x:
            break
            
print(a, b)

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

for a in range(1, x):
    for b in range(-a, a):
        if pow(a, 5) - pow(b, 5) == x:
            break
print(a, b)
Problem p02553 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
l=[a*c, a*d, b*c, b*d]
print(max(l))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if x>=0 and y>=0:
  print(b*d)
elif x>=0 and y<=0:
  print(a*d)
else:
  print(a*c)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if x>=0 and y>=0:
  print(b*d)
elif x>=0 and y<=0:
  print(a*d)
elif x<=0 and y<=0:
  print(a*c)
else:
  print(b*d)
Problem p02612 (python)

Fixed submission:
n=int(input())
print((1000-n%1000)%1000)

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-int(n[1:4])

Buggy submission (verdict: Runtime Error):
n = []
while True:
    try:
        n=int(input())
        while n-a<1000:
          print(n-a)
          a+=1000
    except EOFError:
        break

Buggy submission (verdict: Runtime Error):
n = []
while True:
    try:
        n=int(input())
        while n-a<1000:
          print(n-a)
          a+=1000
    except EOFError:
        break

Buggy submission (verdict: Runtime Error):
n=int(input())
while n-a<1000:
  print(n-a)
  a+=1000

Buggy submission (verdict: Runtime Error):
n = []
while True:
    try:
        n=(input())
    except EOFError:
        break
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=str(int(input()))
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=str(input())
print(1000-int(n[1:4]))

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-(int(n[1:4])))

Buggy submission (verdict: Runtime Error):
n=input()
print(1000-int(n[1:4]))
Problem p02663 (python)

Fixed submission:
h1, m1, h2, m2, k = map(int, input().split())
l = (60 * h2 + m2) -(60 * h1 + m1)
ans = l - k
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d,e=map(int,input().split())
print((60*c+d)-(60*a+b)-k)
Problem p02724 (python)

Fixed submission:
x=int(input())
print(((x//500)*1000)+((x%500//5)*5))

Buggy submission (verdict: Runtime Error):
x=input()
a=x//500*1000
b=x%500//5*5
print(a+b)

Buggy submission (verdict: Runtime Error):
x=input()
print(((x//500)*1000)+((x%500//5)*5))
Problem p02811 (python)

Fixed submission:
K,X=map(int, input().split())
if K*500>=X:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
s=input()
 
print(s.count('ABC'))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
 
print(S.count('ABC'))

Buggy submission (verdict: Runtime Error):
K,X=map(int, input().split())
if 500*K >=X:
    print("yes")
else*
    print("No")
Problem p02812 (python)

Fixed submission:
n=int(input())
s=input()
 
print(s.count('ABC'))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
 
print(s.count('ABC'))
Problem p03155 (python)

Fixed submission:
N=int(input())
H=int(input())
W=int(input())

print((N-W+1)*(N-H+1))

Buggy submission (verdict: Runtime Error):
N=input()
H=input()
W=input()

print((N-W+1)*(N-H+1))
Problem p03156 (python)

Fixed submission:
n = int(input())
a,b = map(int,input().split())
l = list(map(int,input().split()))
c = [0]*3
for i in l:
    if i <= a:
        c[0] += 1
    elif i > b:
        c[2] += 1
    else:
        c[1] += 1
print(min(c))

Buggy submission (verdict: Runtime Error):
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0]*3
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

Buggy submission (verdict: Runtime Error):
n=int(input())
a,b=map(int, input().split())
p=list(map(int, input().split())
c=[0,0,0]
for i in p:
       if i <=a:
        c[0] +=1
       elif i>b:
        c[2] +=1
       else:
        c[1]+=1
print(min(c))

Buggy submission (verdict: Runtime Error):
N=int(input())
A,B=map(int, input().split())
P=list(map(int, input().split())
ans=[0,0,0]
for i in P
       if i <=a:
        ans[0] +=1
       else i>b:
        ans[2] +=1
       else:
        ans[1]+=1
print(min(ans))
Problem p02812 (python)

Fixed submission:
N = int(input())
S = input()

Slist = list(S)

count = 0

Slist.append('0')
Slist.append('0')

for i in range(N):
  if Slist[i] == 'A':
    if Slist[i+1] == 'B':
      if Slist[i+2] == 'C':
        count = count + 1


print(count)

#print('N = ', N)
#print('S = ', S)
#print('Slist = ', Slist)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

Slist = list(S)

count = 0

for i in range(N):
  if Slist[i] == 'A':
    if Slist[i+1] == 'B':
      if Slist[i+2] == 'C':
        count = count + 1


print(count)

#print('N = ', N)
#print('S = ', S)
#print('Slist = ', Slist)
Problem p02958 (python)

Fixed submission:
#!/usr/bin/env python

N = input()

n = int(N)

list1 = list(range(n))

for i in range(n) :
	list1[i] = list1[i] + 1

#print(list1)

list2 = []

list2 = input().split()  

list2 = [int(n) for n in list2]

#print(list2)

judge = 0

for i in range(n) : 
	if list1[i] != list2[i] :
		judge = judge + 1

if judge <= 2 :
	print('YES')

else :
	print('NO')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

N = input()

n = int(N)

list1 = list(range(n))

for i in range(n) :
	list1[i] = list1[i] + 1

#print(list1)

list2 = []

for i in range(n) :
	list2.append(input())

list2 = [int(n) for n in list2]

#print(list2)

judge = 0

for i in range(n) : 
	if list1[i] != list2[i] :
		judge = judge + 1

if judge <= 2 :
	print('YES')

else :
	print('NO')
Problem p03035 (python)

Fixed submission:
a = []
a = input().split()

A = int(a[0])
B = int(a[1])

if A >= 13 :
  print(B)
if A >= 6 and A <= 12 :
  print(int(B / 2))
if A <= 5 :
  print(0)

Buggy submission (verdict: Runtime Error):
a = []
a = input().split()

A = a[0]
B = a[1]

if A > 13 :
  print(B)
if A >= 6 and A <= 12 :
  print(B / 2)
if A <= 5 :
  print(0)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=a*b
print(c)
Problem p02658 (python)

Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input().split()))
  if 0 in A:
    print (0)
    return
  prod = 1 
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod) 
main ()

Buggy submission (verdict: Runtime Error):
def main():
  n=int(input())
  a=list(map(int, input().split()))
  if 0 in A:
    print(0)
    return
  p=1
  for a in A:
    p*=a
    if p>1000000000000000000:
      print(-1)
      return
  print(p)
main()

Buggy submission (verdict: Runtime Error):
def main():
  n=int(input())
  a=list(map(int, input().split()))
  if 0 in A:
    print(0)
    return
  p=1
  for a in A:
    p=*=a
    if(a>1000000000000000000):
      print(-1)
      return
  print(p)

Buggy submission (verdict: Runtime Error):
def main():
  n=int(input())
  a=list(map(int().split()))
  if 0 in A:
    print(0)
    return
  p=1
  for a in A:
    p=*=a
    if(a>1000000000000000000):
      print(-1)
      return
  print(p)
Problem p02952 (python)

Fixed submission:
n = int(input())
def numOfDigits(num):
    return len(str(num))
ans = 0
while n > 0:
    if numOfDigits(n)%2 == 1:
        ans += 1
    n -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
def numOfDigits(num):
    return len(str(num))
ans += 1
while n > 0:
    if numOfDigits(n)%2 == 1:
        ans += 1
print(ans)
Problem p02719 (python)

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

if N==K:
  print(0)

elif N<K:
  lis1=[N,abs(N-K)]
  print(min(lis1))
  
else:
  lis2=[N%K,abs(N%K-K)]
  print(min(lis2))

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

if N==K:
  print(0)

elif N<K:
  lis1=[N,abs(N-K)]
  print(min(lis))
  
else:
  lis2=[N%K,abs(N%K-K)]
  print(min(lis2))
Problem p03029 (python)

Fixed submission:
A,P=map(int,input().split())
print((3*A+P)//2)

Buggy submission (verdict: Runtime Error):
A,P=map(int,input().split())
print((3A+P)//2)