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

Fixed submission:
import sys
sys.setrecursionlimit(100000)

n=int(input())

g =[[] for _ in range(n)]
ans=[0] * (n-1)

def dfs(v,c=-1,p=-1):
    k=1

    for u,ei in g[v]:
        if u == p: continue
        if k == c: k+=1

        ans[ei] = k
        k+=1
        dfs(u,ans[ei],v)

for i in range(n-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    g[a].append((b,i))
    g[b].append((a,i))

dfs(0)
mx=0

for i in range(n):
    mx = max(mx,int(len(g[i])))

print(mx)
for i in ans:print(i)

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

g =[[] for _ in range(n)]
ans=[0] * (n-1)

def dfs(v,c=-1,p=-1):
    k=1

    for u,ei in g[v]:
        if u == p: continue
        if k == c: k+=1

        ans[ei] = k
        k+=1
        dfs(u,ans[ei],v)

for i in range(n-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    g[a].append((b,i))
    g[b].append((a,i))

dfs(0)
mx=0

for i in range(n):
    mx = max(mx,int(len(g[i])))

print(mx)
for i in ans:print(i)
Problem p02936 (python)

Fixed submission:
I0 = lambda :map(int,input().split())
I1 = lambda :int(input())
I2 = lambda :list(map(int,input().split()))
#####################################################
 
 
from sys import stdin,setrecursionlimit
#from copy import deepcopy
 
setrecursionlimit(10**6)
input=stdin.readline
 
def dfs(p,father=-1):
    for i in tree[p]:
        if i == father:
            continue
        counter[i]+=counter[p]
        dfs(i,p)
 
n ,q = I0()
counter = [0]*n
tree = [[] for i in range(n)]
for i in range(n-1):
    a,b=I0()
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
 
for i in range(q):
    p,x = I0()
    counter[p-1]+=x
    
 
dfs(0)
 
print(*counter)

Buggy submission (verdict: Runtime Error):
import heapq
import sys
sys.setrecursionlimit(100000)

n, q = map(int, input().split())

lv =[[] for _ in range(n)]
ans=[0] * (n)

def dfs(v,p=-1):
    for u in lv[v]:
        if u == p: continue
        ans[u] += ans[v]
        dfs(u,v)

for _ in range(n-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    lv[a].append(b)
    lv[b].append(a)

for _ in range(q):
    p,x = map(int,input().split())
    p-=1
    ans[p] += x

dfs(0)

for i in ans:print(i)

Buggy submission (verdict: Runtime Error):
import heapq

n, q = map(int, input().split())

lv =[[] for _ in range(n)]
ans=[0] * (n)

def dfs(v,p=-1):
    for u in lv[v]:
        if u == p: continue
        ans[u] += ans[v]
        dfs(u,v)

for _ in range(n-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    lv[a].append(b)
    lv[b].append(a)

for _ in range(q):
    p,x = map(int,input().split())
    p-=1
    ans[p] += x

dfs(0)

for i in ans:print(i)
Problem p02960 (python)

Fixed submission:
s=list(input())
mod=10**9+7
n=len(s)

dp=[[0]*13 for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    if s[i]=="?":
        for k in range(10):
            for j in range(13):
                p=(k+10*j)%13
                dp[i+1][p]+=dp[i][j]
                dp[i+1][p]%=mod

    else:

        for j in range(13):
            p=(int(s[i])+10*j)%13
            dp[i+1][p]+=dp[i][j]
            dp[i+1][p]%=mod


print(dp[n][5])

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

s = input()
n = len(s)

mod=10**9+7

dp = [[0] * 13 for _ in range(10**5) ]

ans=0
dp[0][0] =1

for i in range(n):
    if s[i] == '?':c=-1
    else: c=int(s[i])

    for j in range(10):
        if (c == -1 or c== j):
            for ki in range(13):
                dp[i+1][(ki*10+j)%13] += dp[i][ki]

    # for j in range(13):
    #     dp[i+1][j] %= mod

print(dp[n][5]%mod%mod)

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

s = input()
n = len(s)

mod=10**9+7

dp = [[0] * 13 for _ in range(10**5) ]

ans=0
dp[0][0] =1

for i in range(n):
    if s[i] == '?':c=-1
    else: c=int(s[i])

    for j in range(10):
        if (c == -1 or c== j):
            for ki in range(13):
                dp[i+1][(ki*10+j)%13] += dp[i][ki]

    # for j in range(13):
    #     dp[i+1][j] %= mod

print(dp[n][5]%mod%mod)

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

s = input()
n = len(s)

mod=10**9+7

dp = [[0] * 13 for _ in range(10**5) ]

ans=0
dp[0][0] =1

for i in range(n):
    if s[i] == '?':c=-1
    else: c=int(s[i])

    for j in range(10):
        if (c == -1 or c== j):
            for ki in range(13):
                dp[i+1][(ki*10+j)%13] += dp[i][ki]

    for j in range(13):
        dp[i+1][j] %= mod

print(dp[n][5])
Problem p02983 (python)

Fixed submission:
l,r = map(int,input().split())
if r-l>=2019:
    print(0)
    exit()
ans = 2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(ans,(i*j)%2019)
print(ans)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())

for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(ans,(i%2019*j%2019)%2019)
print(ans)

Buggy submission (verdict: Runtime Error):
l,r = map(int,input().split())

for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans = min(ans,(i*j)%2019)
print(ans)
Problem p02681 (python)

Fixed submission:
S = str(input())
T = str(input())

len_T = len(T)

if S == T[0:len_T-1]:
      print('Yes')
else:
      print('No')

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

nums = []

for i in range(N):
    a = list(map(int,input().split()))
    nums.append(a)

ans = 10000000000


for i in range(2**N):

    money = 0
    skill_point = [0]*M
    goal = [0]*M
    buy = []
    
    for k in range(N):
        if i>>k & 1:
            buy.append(nums[k])

    for d in buy:
        money += d[0]
        for e in range(M):
            skill_point[e] += d[e+1]

    for f in range(M):
        if skill_point[f] >= X:
            goal[f] = 1

    
    if (0 not in goal) and (money < ans) :
        ans = money

    

if ans != 10000000000:
    print(ans)
else:
    print(-1)
Problem p02705 (python)

Fixed submission:
import math
R = int(input())

num = 2*R*math.pi
print(f'{num:.3f}')

Buggy submission (verdict: Runtime Error):
import math

R = int(input())
a = 2*R*pi.math

print(a)

Buggy submission (verdict: Runtime Error):
import math

R = input()
print(f'{2*R*math.pi}')
Problem p02706 (python)

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

c = list(map(int,input().split()))
c_sum = sum(c)

day_count = N-c_sum

if day_count>=0:
  print(day_count)
else:
  print(-1)

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

c_sum = 0
for i in range(M):
  b = int(input())
  c_sum += b

day_count = N-c_sum

if day_count>=0:
  print(day_count)
else:
  print(-1)

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

a = 0
for i in range(M):
  c_sum = int(input())
  a += b

day_count = N-c_sum

if day_count>=0:
  print(day_count)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
 
a = 0
for i in range(M):
  b = int(input())
  a += b

day_count = N-a

if day_count>=0:
  print(day)
else:
  print(-1)

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

a = 0
for i in range(M):
  b = int(input())
  a += b

day = N-a
print(day)
Problem p02772 (python)

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

a=0
for i in num_list:
  if i%2==0 and (i%3!=0 and i%5!=0):
    a+=1

if a>0:
  print('DENIED')
else:
  print('APPROVED')

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

#リストにするとき
A_list = list(map(int,input().split()))

for i in A_list:
    if i%2==0 and (i%3!=0 and i%5!=0):
        a+=1

if a>0:
      print('DENIED')
else:
  print('APPROVED')
Problem p02994 (python)

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

apple = [L+i for i in range(N)]
min = 500
for k in range(len(apple)):
    if abs(apple[k])<abs(min):
        min = apple[k]

apple.remove(min)
print(sum(apple))

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

apple = [L+i for i in range(N)]
min = 500
for k in range(len(apple)):
    if abs(apple[k])<min:
        min = abs(apple[k])

apple.remove(min)
print(sum(apple))

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

apple = [L+i for i in range(N)]
print(apple)
min = 500
for k in range(len(apple)):
    if abs(apple[k])<min:
        min = abs(apple[k])

apple.remove(min)
print(sum(apple))
Problem p03455 (python)

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

if a*b %2 == 0:
  judge = 'Even'
else:
  judge='Odd'

print(judge)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if (a*b)%2 == 0:
  'Even'
else:
  'Odd'
Problem p03494 (python)

Fixed submission:
input()
Nums = list(map(int, input().split()))

count = 0
while all(n % 2 == 0 for n in Nums):
  Nums = [n/2 for n in Nums]
  count += 1

print(count)

Buggy submission (verdict: Runtime Error):
input()
nums = list(map(int, input().split()))
 
i = 0
while all(n % 2 == 0 for n in num):
  nums = [n/2 for n in nums]
  i += 1
 
print(i)

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

nums = list(map(int, input().split()))

i = 0

while all(n % 2 == 0 for n in num):
  nums = [n / 2 for n in nums]
  i += 1

print(i)

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

i = 0
while all(num % 2 == 0):
  num // 2
  i += 1
  
print(i)
Problem p04044 (python)

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

strs = []
for i in range(N):
    n = input()
    strs.append(n)

strs.sort()
print("".join(strs))

Buggy submission (verdict: Runtime Error):
strs = []
for i in range(N):
    n = input()
    strs.append(n)

strs = sorted(strs)
strs = ''.join(strs)

print(strs)
Problem p02642 (python)

Fixed submission:
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    A = list(map(int, input().split()))
    M = max(A)
    B = [0]*(M+1)
    ans = 0
    A.sort()
    
    for i in A:
        B[i] += 1
    
    for i in A:
        if B[i] == 1:
            ans += 1
        for j in range(i, M+1, i):
            B[j] += 1
    
    print(ans)

main()

Buggy submission (verdict: Runtime Error):
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    x, n= map(int, input().split())
    if n == 0:
        print(x)
        return
    P=[]
    P = list(map(int, input().split()))
    
    for i in range(100):
        a = x-i
        b = x+i
        if a not in P:
            print(a)
            return
        elif b not in P:
            print(b)
            return
    


main()
Problem p02657 (python)

Fixed submission:
import sys

def input():
    return sys.stdin.readline().strip()

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

Buggy submission (verdict: Runtime Error):
import sys
 
def input():
    return sys.stdin.readline().strip()
 
n = int(input())
A = list(map(int, input().split()))
sum = 1
for i in range(n):
    sum *= A[i]
if(sum > 10**18):
    sum = -1
print(sum)
Problem p02658 (python)

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

def main():
    n = int(input())
    A = list(map(int, input().split()))
    if 0 in A:
        print(0)
        return
    x = 1
    for i in A:
        x *= i
        if x > pow(10,18):
            print(-1)
            return
    print(x)

main()

Buggy submission (verdict: Runtime Error):
import sys
 
def input():
    return sys.stdin.readline().strip()
 
n = int(input())
A = list(map(int, input().split()))
sum = 1
for i in range(n):
    sum *= A[i]
if(sum > 10**18):
    sum = -1
print(sum)

main()
Problem p02898 (python)

Fixed submission:
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    count = 0
    for i in h:
        if i >= k:
            count += 1
    print(count)

    
    
main()

Buggy submission (verdict: Runtime Error):
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    n = decimal.Decimal(n)
    if n % 2 == 0:
        print(1/decimal.Decimal(2))
        return
    
    print(((n-1)/2+1)/n)

    
    
main()
Problem p02909 (python)

Fixed submission:
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    s = input()
    if s[0] == "S":
        print("Cloudy")
        return
    elif s[0] == "C":
        print("Rainy")
        return
    print("Sunny")
    

    
    
main()

Buggy submission (verdict: Runtime Error):
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    count = 0
    for i in h:
        if i >= k:
            count += 1
    print(count)

    
    
main()
Problem p02630 (python)

Fixed submission:
N = int(input())
A =  list(map(int, input().split()))
Q = int(input())
B = [0]*(Q+1)
C = [0]*(Q+1)
S = [0]*(Q+1)


for i in range(1,Q+1,1):
    B[i],C[i] = map(int,input().split())

a = [0]*(10**5+3)

for i in range(N):
    a[A[i]] += 1
    S[0] += A[i]

for i in range(1,Q+1,1):
    S[i] = S[i-1] + a[B[i]]*(C[i]-B[i])
    a[C[i]] = a[C[i]] + a[B[i]]
    a[B[i]] = 0
    print(S[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
A =  list(map(int, input().split()))
Q = int(input())
B = [0]*(Q+1)
C = [0]*(Q+1)
S = [0]*(Q+1)


for i in range(1,Q+1,1):
    B[i],C[i] = map(int,input().split())

a = [0]*(10**5)

for i in range(N):
    a[A[i]] += 1
    S[0] += A[i]

for i in range(1,Q+1,1):
    S[i] = S[i-1] + a[B[i]]*(C[i]-B[i])
    a[C[i]] = a[C[i]] + a[B[i]]
    a[B[i]] = 0
    print(S[i])
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(input().split())
flag = 0
for i in range(N):
    A[i] = int(A[i])
    if A[i] == 0:
        flag = -1
sum = 1

for i in range(N):
    if sum <= 10**18:
        sum = sum * A[i]
    else:
        break


if sum <= 10**18:
    print(sum)
else:
    if flag == -1:
        print(0)
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(input().split())
for i in range(N):
    A[i] = int(A[i])
sum = 1

for i in range(N):
    if sum <= 10**18:
        sum = sum * A[i]
    else:
        break:

if sum <= 10**18:
    print(sum)
else:
    print(-1)
Problem p02677 (python)

Fixed submission:
import math

A,B,H,M = map(int,input().split())

C = 2*math.pi/12
D = 2*math.pi/60
E = 2*math.pi/(12*60)
x = abs(D*M - (C*H + E*M))


print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(x)))

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

x = 6*M - (30*H + 0.5*M)
print(x)
X = 2*math.pi*x/360
print(X)
print(math.sqrt(A**2 + B**2 - A*B*math.cos(X)))
Problem p02995 (python)

Fixed submission:
def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

a,b,c,d =map(int,input().split())
e = (c*d)//gcd(c,d)
ac = a//c   
if a % c == 0:
    ac-=1
bc = b//c 

ad=a//d 
if a % d == 0:
    ad-=1
bd= b//d


acd = a//e 
if a % e == 0:
    acd-=1
bcd= b//e 


count = b-a+1
count -= bc-ac
count -= bd-ad
count += bcd-acd

print(count)
##print(e)
#print(bcd-acd)
#print(bd-ad)
#print(bc-ac)

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d =map(int,input().split())
e = (c*d)//math.gcd(c,d)
ac = a//c   
if a % c == 0:
    ac-=1
bc = b//c 

ad=a//d 
if a % d == 0:
    ad-=1
bd= b//d


acd = a//e 
if a % e == 0:
    acd-=1
bcd= b//e 


count = b-a+1
count -= bc-ac
count -= bd-ad
count += bcd-acd

print(count)
##print(e)
#print(bcd-acd)
#print(bd-ad)
#print(bc-ac)
Problem p02999 (python)

Fixed submission:
a, x =map(int,input().split())
if a>=x :
  print(10)
  
else:
  print(0)

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

s = [0] * n
count = 0
for i in range(n):
    for j in range(i,n):
        if j == i:
            a[i] = int(a[i])
            s[0] = a[j]
        else:
            a[j] = int(a[j])
            s[j-i] = a[j] + s[j-i-1]

        if s[j-i] >= k:
            count += n-j
            #print(count)
            #print(s)
            break


print(count)
Problem p03029 (python)

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

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = []
k = []
p = []
for i in range(m):
    q = input().split()
    k.append(int(q[0]))
    q.remove(q[0])
    s.append(q)
    #print(q)
    for j in range(k[i]):
        s[i][j] = int(q[j])
        #print(s)
    
q = input().split()
for j in range(m):
        p.append(int(q[j]))
count = 0
for i in range(pow(2,n)):
    list = []
    for o in range(n):
        list.append(i%pow(2,o+1))
        i = i // pow(2,o+1)
    #print(list)
    for j in range(m):
        wa = 0
        for l in range(k[j] ):
            wa += list[s[j][l]-1]
        if wa == p[j]*2:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
a,p =map(int,input().split())
b = (3*a + P) // 2
print(b)
Problem p02730 (python)

Fixed submission:
def isPalindrome(s):
  return s == s[::-1]
 
s = input()
n = len(s)
res =  isPalindrome(s) and isPalindrome(s[:n//2]) and isPalindrome(s[n//2+1:])
print("Yes" if res else "No")

Buggy submission (verdict: Runtime Error):
def isPalindrome(s):
  return s == s[::-1]

s = input()
n = len(s)
return isPalindrome(s) and isPalindrome(s[:n//2+1]) and isPalindrome(s[n//2+2:])
Problem p03160 (python)

Fixed submission:
def jump(i):
    memo[0] = 0
    memo[1] = abs(arr[1]- arr[0])               
    for i in range(2, n):
        memo[i] = min(memo[i-1] + abs(arr[i-1]- arr[i]) ,
                      memo[i-2] + abs(arr[i-2]- arr[i]))
    return memo[-1]    

n = int(input())
arr = list(map(int, input().split()))
memo = [-1] * n 
                   
result = jump(n)
print(result)

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

MAX = 10**4 + 1

n, k = map(int, input().split())
cost = list(map(int, input().split()))
dp = [MAX] * (n)
dp[0] = 0

for i in range(1, n):
    dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))

print(dp[-1])

Buggy submission (verdict: Runtime Error):
MAX = 10**9

n, k = map(int, input().split())
cost = list(map(int, input().split()))
dp = [MAX] * (n)
dp[0] = 0

for i in range(1, n):
    for j in range(max(0, i-k), i+1):
                dp[i] = min(dp[i] ,dp[j] + abs(cost[i] - cost[j]))

print(dp[-1])

Buggy submission (verdict: Runtime Error):
def main():
    from builtins import abs
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
 
    dp = [0] * N
    for i in range(1, N):
        dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
    print(dp[N - 1])
 
 
main()

Buggy submission (verdict: Runtime Error):
def jump(i):
    if i == 0:
        memo[0] = 0
        return memo[0]
    elif i == 1:
        memo[1] = abs(arr[1]- arr[0])               
        return memo[1]
    if memo[i] != -1:
        return memo[i]
    memo[i] = min(jump(i-1) + abs(arr[i-1]- arr[i]) ,
                  jump(i-2) + abs(arr[i-2]- arr[i]))
    return memo[i]    

n = int(input())
arr = list(map(int, input().split()))
memo = [-1] * n 
                   
result = jump(n-1)
print(result)
Problem p03161 (python)

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

import sys
inp = sys.stdin.readline
out = print
MAX = 10**9
 
n, k = map(int, inp().split())
cost = list(map(int, inp().split()))
dp = [MAX] * (n)
dp[0] = 0
 
for i in range(1, n):
    dp[i] = min(dp[j] + abs(cost[i] - cost[j]) for j in range(max(0, i - k), i))
 
out(dp[-1])

Buggy submission (verdict: Runtime Error):
import sys
inp = sys.stdin.readline
out = print
MAX = 10**9

n, k = map(int, inp().split())
cost = list(map(int, inp().split()))
dp = [MAX] * (n)
dp[0] = 0

for i in range(1, n):
    dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))

out(dp[-1])

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

MAX = 10**4 + 1

n, k = map(int, input().split())
cost = list(map(int, input().split()))
dp = [MAX] * (n)
dp[0] = 0

for i in range(1, n):
    dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))

print(dp[-1])
Problem p02657 (python)

Fixed submission:
n,k = input().split(" ")

r = int(n) * int(k)

print(r)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")

sum = 1
for i in range(n):
  sum = sum * int(a[i])

if sum > 1000000000000000000:
  print(-1)
else:
  print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")

sum = 1
for i in range(n):
  sum = sum * int(a[i])

if sum > 1000000000000000000 :
  print(-1)
else:
  print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")

sum = 1
for i in range(n):
  sum = sum * int(a[i])

if sum > 1000000000000000000 :
  print(-1)
else:
  print(sum)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = input().split(" ")

sum = 1
for i in a:
  sum = sum * int(i)
  if sum > 1000000000000000000:
    break

if "0" in a:
  print(0)
elif sum > 1000000000000000000:
  print(-1)
else:
  print(sum)

Buggy submission (verdict: Runtime Error):
 n = int(input())
a = input().split(" ")

sum = 1
for i in a:
  sum = sum * int(i)

if sum > 1000000000000000000:
  print(-1)
else:
  print(sum)
Problem p03635 (python)

Fixed submission:
s=input()
n=int(s.split(" ")[0])
m=int(s.split(" ")[1])
n=n-1

m=m-1
r=n*m
print(r)

Buggy submission (verdict: Runtime Error):
s=input()
n=s.split(" ")[0]
m=s.split(" ")[1]
 
n=n-1
m=m-1
 
r=n*m
 
print(m)

Buggy submission (verdict: Runtime Error):
s=input()
n=s.split(" ")[0]
m=s.split(" ")[1]
 
n=n-1
m=m-1
 
r=n*m
 
print(m)

Buggy submission (verdict: Runtime Error):
s=input()
n=s.split(" ")[0]
m=s.split(" ")[1]

n=n-1
m=m-1

r=n*m

print(m)
Problem p02639 (python)

Fixed submission:
list=list(map(int,input().split()))
for i in range(5):
	if list[i]==0:
		print(i+1)

Buggy submission (verdict: Runtime Error):
list=map(int,input().split())
for i in range(5):
	if list[i]==0:
		print(i)

Buggy submission (verdict: Runtime Error):
list=map(int,input().split())
for i in range(5):
	if list[i]==0:
		print i
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")
Problem p02696 (python)

Fixed submission:
A,B,N=map(int,input().split())
if B!=1:
	p=(N+1)//B
	result=0
	if p!=0:
		for a in range(1,p+1):
			x=a*B-1
			s=(A*x)//B - A*(a-1)
			if result < s:
				result=s
	else:
		result=A*N//B -A*(N//B)
	print(result)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
result=0
for x in range(0,n+1):
	a=int(A*x/B)-A*int(x/B)
	if a>result:
		result=a
print(result)
Problem p02730 (python)

Fixed submission:
S=input()
N=len(S)
flag=0
for i in range((N-1)//4):
	if S[i]!=S[(N-1)//2 -i-1]:
		flag=1
		break
	if S[(N+3)//2 +i-1]!=S[N-1-i]:
		flag=1
		break
for j in range((N-1)//2):
	if S[j]!=S[N-1-j]:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
S=input()
N=len(S)
flag=0
for i in range((N-1)//4):
	if S[i]!=S[(N-1)//2 -i-1]:
		flag=1
		break
	if S[(N+3)//2 +i-1]!=S[N-1-i]:
		flag=1
		break
for j in range((N-1)//2):
	if S[i]!=S[N-1-i]:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")