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

Fixed submission:
a,b,c,d = map(int, input().split())
if a > c:
    a,b,c,d=c,d,a,b
if b < c:print(0)
elif b >= c and b < d:print(b-c)
else : print(d-c)

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

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

Fixed submission:

def gcd(x,y):
    if x==0:return y
    else:return gcd(y%x,x)
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//gcd(t,s)
print(s)

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//math.gcd(t,s)
print(s)

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//gcd(t,s)
print(s)

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
s = 1
for i in range(a):
    t= int(input())
    s = (t*s)//math.gcd(t,s)
print(s)
Problem p03637 (python)

Fixed submission:
a = int(input())
c = list(map(int,input().split()))
c1=c2=c4=0
for i in c:
    if i%2==1:
        c1+=1
    elif i%4==0:
        c4+=1
    else:c2+=1
if c1+c2-c4==1:print("Yes")
elif c1<=c4:print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
c = list(map(int,input().split()))
c1=c2=c4=0
for i in c:
    if c%2==1:
        c1+=1
    elif c%4==0:
        c4+=1
    else:c2+=1
if c1+1>c4:print("No")
elif c1+c2-c4==1:print("Yes")
elif c1<=c4:print("Yes")

Buggy submission (verdict: Runtime Error):
a = int(input())
c = list(map(int,input().split()))
c1=c2=c34=0
for i in c:
    if c%2==1:
        c1+=1
    elif c%4==0:
        c4+=1
    else:c2+=1
if c1+1>c4:print("No")
elif c1+c2-c4==1:print("Yes")
elif c1<=c4:print("Yes")

Buggy submission (verdict: Runtime Error):
a = int(input())
c = list(map(int,input().split()))
for i in c:
    if c%2==1:
        c1+=1
    elif c%4==0:
        c4+=1
    else:c2+=1
if c1+1>c4:print("No")
elif c1+c2-c4==1:print("Yes")
elif c1<=c4:print("Yes")
Problem p03643 (python)

Fixed submission:
a =input()
b ="ABC"+a
print(b)

Buggy submission (verdict: Runtime Error):
a =input()
b =ABC+a
print(b)
Problem p03644 (python)

Fixed submission:
a = int(input())
s = 1
n = 8
while n>0:
    if 2**n <=a:
        s = 2**n
        break
    n-=1
print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
s = 1
while n>0:
    if 2**n <a:
        s = 2**n
        break
    n-=1
print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
s = 1
while n>0:
    if 2**n <a:
        s = 2**n
        break
    n-=1
print(s)
Problem p03651 (python)

Fixed submission:
N,K= map(int, input().split())
x = list(map(int, input().split()))
x = list(set(x))
x.sort()
t = max(x)
y = x[0]
s = [1000000000000]
o=0
if x[0] == K:o=1
for i in range(1,len(x)):
    s.append(x[i]-x[i-1])
    if x[i] == K:o = 1
s.sort()
m = min(y,s[0])
if (t>= K and K%m==0) or o==1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
N,K= map(int, input().split())
x = list(map(int, input().split()))
x.sort()
t = max(x)
y = x[0]
s = [1000000000000]
o=0
if x[0] == K:o=1
for i in range(1,len(x)):
    s.append(x[i]-x[i-1])
    if x[i] == K:o = 1
s.sort()
m = min(y,s[0])
if (t>= K and K%m==0) or o==1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
N,K= map(int, input().split())
x = list(map(int, input().split()))
x.sort()
t = max(x)
y = x[0]
s = []
for i in range(1,len(x)):
    s.append(x[i]-x[i-1])
s.sort()
m = min(y,s[0])
if t>= K and K%m==0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
x = list(map(int, input().split()))
x.sort()
p=0
q=0
y=0
for i in x:
    if p == 1 and q == 1:break
    if i == b:
        y=1
    if i%2==0:
        p=1
    else:
        q=1
if b<=x[-1] or y==1:
    if (b%2==0 and(p*q ==0)):
        m="POSSIBLE"
    elif p==1 and q==1:m="POSSIBLE"
    elif y==1:m="POSSIBLE"
else:m="IMPOSSIBLE" 
print(m)
Problem p03673 (python)

Fixed submission:
import collections
def a():return input()#s
def ai():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
l = []
f = 0
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")
a = ai()
x = lma()
k = [0]*a
s = 0
t = 0
for i in range(a):
    if i%2==0:
        k[s] = x[-1-i]
        s+=1
    else:
        k[-t-1] = x[-1-i]
        t+=1
s = str(k[0])
for i in range(1,a):
    s+=" "+str(k[i])
print(s)

Buggy submission (verdict: Runtime Error):
a = ai()
x = lma()
k = [0]*a
s = 0
t = 0
for i in range(a):
    if i%2==0:
        k[s] = x[-1-i]
        s+=1
    else:
        k[-t-1] = x[-1-i]
        t+=1
print(k)
Problem p03674 (python)

Fixed submission:
mod = 10**9+7
N = int(input())
A = [int(x) for x in input().split()]
se = []
c = sum(A) - N * (N + 1) / 2
for i in range(len(A)):
    if A[i] == c:
        se.append(i)
l = se[0]
r = se[1]
import math

print(N)

factorial = [1]
inverse = [1]
for i in range(1, N + 2):
    factorial.append(factorial[-1] * i % mod)
    inverse.append((pow(factorial[-1], mod - 2, mod)))


def nCr(n, r):
    if n < r or n == 0 or r == 0:
        return 0
    return factorial[n] * inverse[r] * inverse[n - r] % mod



for i in range(2,N+2):
    k = nCr(N+1, i)
    
    t = nCr(l+N-r,i-1)
    res  = k -t
    print(res % mod)

Buggy submission (verdict: Runtime Error):
 class BigCombination(object):
    __slots__ = ["mod", "factorial", "inverse"]

    def __init__(self, mod= 10**9+7, max_n = 10**6):
        fac, inv = [1], []
        fac_append, inv_append = fac.append, inv.append

        for i in range(1, max_n+1):
            fac_append(fac[-1] * i % mod)

        inv_append(pow(fac[-1], mod-2, mod))

        for i in range(max_n, 0, -1):
            inv_append(inv[-1] * i % mod)

        self.mod, self.factorial, self.inverse = mod, fac, inv[::-1]

    def get_combination(self, n, r):
        if n < r or n == 0 or r == 0:
            return 0
        return self.factorial[n] * self.inverse[r] * self.inverse[n-r] % self.mod

    def get_permutation(self, n, r):
        return self.factorial[n] * self.inverse[n-r] % self.mod

N = int(input())
A = [int(x) for x in input().split()]
se = []
c = sum(A) - N * (N + 1) / 2
for i in range(len(A)):
    if A[i] == c:
        se.append(i)
l = se[0]
r = se[1]
import math

print(N)
Big = BigCombination()

for i in range(2,N+2):
    k = Big.get_combination(N+1, i)
    
    t = Big.get_combination(l+N-r,i-1)
    res  = k -t
    print(res)

Buggy submission (verdict: Runtime Error):
class BigCombination(object):
    __slots__ = ["mod", "factorial", "inverse"]

    def __init__(self, mod: int  10**9+7, max_n: int  10**6):
        fac, inv = [1], []
        fac_append, inv_append = fac.append, inv.append

        for i in range(1, max_n+1):
            fac_append(fac[-1] * i % mod)

        inv_append(pow(fac[-1], mod-2, mod))

        for i in range(max_n, 0, -1):
            inv_append(inv[-1] * i % mod)

        self.mod, self.factorial, self.inverse = mod, fac, inv[::-1]

    def get_combination(self, n, r):
        return self.factorial[n] * self.inverse[r] * self.inverse[n-r] % self.mod

    def get_permutation(self, n, r):
        return self.factorial[n] * self.inverse[n-r] % self.mod

N = int(input())
A = [int(x) for x in input().split()]
se = []
c = sum(A) - N * (N + 1) / 2
for i in range(len(A)):
    if A[i] == c:
        se.append(i)
l = se[0]
r = se[1]
import math

Big = BigCombination()
print(N)
for i in range(2,N+2):
    k = Big.get_combination(N+1, i) 
    t = Big.get_combination(l+N-r,i-1)
    print(l+N-r,i-1)
    if l+N-r == 0 :t = 0
    res  = k -t
    print(res)
Problem p03681 (python)

Fixed submission:
import math
def a():return input()#s
def ai():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
a,b = ma()
mod = 10**9 + 7
m = max(a,b)
n = min(a,b)
k=math.factorial(n)
if abs(a-b)>1:print(0)
elif m!=n:
    print(((k**2)*m)%mod)
else:
    print(((k**2)*2)%mod)

Buggy submission (verdict: Runtime Error):
import math
a,b = ma()
mod = 10**9 + 7
m = max(a,b)
n = min(a,b)
k=math.factorial(m)
if m!=n:
    print(((k**2)*m)%mod)
else:
    print(((k**2)*2)%mod)
Problem p03695 (python)

Fixed submission:
n=input()
l=list(map(int,input().split()))
c=[0]*8
ma=0
for i in l:
    if i<3200:c[i//400]=1
    else:ma+=1
mi=sum(c)
print(max(mi,1),mi+ma)

Buggy submission (verdict: Runtime Error):
#C Colorful
import numpy as np
a = int(input())
x = list(map(int,input().split()))
x.sort()
x = x[::-1]
n =0
k = [0,0,0,0,0,0,0]
for i in x:
    if i > 3199:
        n +=1
    elif i < 400:
        k[0] = 1
    elif i < 800:
        k[1] = 1
    elif i < 1200:
        k[2] = 1
    elif i < 1600:
        k[3] = 1
    elif i < 2000:
        k[4] = 1
    elif i < 2400:
        k[5] = 1
    elif i < 2800:
        k[6] = 1
    elif i < 3200:
        k[7] = 1

c = np.array(k)
s = ss= c.sum()

if s < 8:
    ss += n
    if ss > 8:
        ss = 8
print (s)
print (ss)
Problem p03699 (python)

Fixed submission:
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0

for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        s += i
    else:
        k.append(i)
k.sort()
c = np.array(k)
l = c.sum()
if l%10==0 and len(k) !=0:
    l = l - c[0]
    s = s + l
elif len(k) == 0:
    s = 0
else:
    s = s + l
print(s)

Buggy submission (verdict: Runtime Error):
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0

for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        s += i
    else:
        k.append(i)
k.sort()
c = np.array(k)
l = c.sum()
if l%10==0 and len(k) !=0:
    l = l - c[0]
    s = s + l
elif:len(k) == 0
    s = 0
else:
    s = s + l
print(s)

Buggy submission (verdict: Runtime Error):
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0

for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        s += i
    else:
        k.append(i)
k.sort()
c = np.array(k)
l = c.sum()
if l%10==0 and len(k) !=0:
    l = l - c[0]
    s = s + l
elif:l == 0
    s = 0
else:
    s = s + l
print(s)

Buggy submission (verdict: Runtime Error):
#C Bugged
import numpy as np
a = int(input())
k   = []
k10 = []
s = 0

for j in range(a):
    i = int(input())
    if i % 10 == 0:
        k10.append(i)
        ll = ll + i
    else:
        k.append(i)
c = np.array(k)
s += c.sum()
if s%10==0 and len(k) !=0:
    s = s - k[0]
    s = s + ll
elif s%10 ==0:
    s = 0
    s = s + ll
print(s)
Problem p03712 (python)

Fixed submission:
h,w = map(int,input().split())
s = []
for i in range(h):
    s.append("#"+input()+"#")
print("#"*(w+2))
for i in s:
    print(i)
print("#"*(w+2))

Buggy submission (verdict: Runtime Error):
a , b = map(int,input().split())
print("#"*(3+2))
for i in range(1,b):
    tmp = input()
    print("#"+tmp+"#")
print("#"*(3+2))
Problem p03720 (python)

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

v = collections.Counter(k)
for i in range(a):
    print (v[i+1])

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

v = collections.Counter(k)
for i in range(a):
    print (v.most_common()[i][1])
Problem p03760 (python)

Fixed submission:
a = input()
b = input()
s = ""
for i in range(len(a)+len(b)):
    if i%2==0:
        s+=a[i//2]
    else:
        s+=b[i//2]
print(s)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
s = ""
for i in range(len(a)+len(b)):
    if i%2==0:a
        s+=a[i//2]
    else:
        s+=b[i//2]
print(s)
Problem p03779 (python)

Fixed submission:
a = int(input())
s = 0
if a < 3:print(a)
else:
    for i in range(1,a):

        s+=i
        if s-i < a <= s:
            print(i)
            break

Buggy submission (verdict: Runtime Error):
a = int(input())
s = 0
if i < 3:print(a)
else:
    for i in range(1,a):

        s+=i
        if s-i < a <= s:
            print(i)
            break
Problem p03800 (python)

Fixed submission:
a = int(input())
b = input()

t = ["SS","SW","WS","WW"]
l = []
for j in range(4):
  if t[j][0] == "S" and b[0] == "o":
    l.append("S" if t[j][1] == "S" else "W")
  elif t[j][0] == "S" and b[0] == "x":
    l.append("S" if t[j][1] == "W" else "W")
  elif t[j][0] == "W" and b[0] == "x":
    l.append("S" if t[j][1] == "S" else "W")
  elif t[j][0] == "W" and b[0] == "o":
    l.append("S" if t[j][1] == "W" else "W")
  for i in range(1,a):
    if t[j][i] == "S" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "S" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    elif t[j][i] == "W" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "W" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    else:
      t[j] = -1
      break
s = -1
if all(i == -1 for i in t):
  print(-1)
else:
  for j,k in enumerate(t):
    # print(j,k)
    # if k !=-1:
    #   if t[j][-1] == "S" and b[-1] == "o" and t[j][0] == "S":
    #     s = t[j]
    #   elif t[j][-1] == "S" and b[-1] == "x" and t[j][0] == "W":
    #     s = t[j]
    #   elif t[j][-1] == "W" and b[-1] == "x" and t[j][0] == "S":
    #     s = t[j]
    #   elif t[j][-1] == "W" and b[-1] == "o" and t[j][0] == "W":
    #     s = t[j]
    if k !=-1:
      if k[-1] ==  k[0] :
        if k[-2] ==l[j]:
          s = k
  if s == -1:print(-1)
  else:print(s[:-1])

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

t = ["SS","SW","WS","WW"]

for j in range(4):
  for i in range(1,a):
    if t[j][i] == "S" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "S" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    elif t[j][i] == "W" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "W" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    else:
      t[j] = -1
      break
s = -1
if all(i == -1 f
Problem p03807 (python)

Fixed submission:
a = int(input())
x= list(map(int, input().split()))
s=0
for i in x:
    if i%2!=0:
        s+=1
if s%2==0:
    print("YES")
else:print("NO")

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

for i in x:
    if i%2!=0:
        s+=1
if s%2==0:
    print("YES")
else:print("NO")
Problem p03808 (python)

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

K = sum(A) / sum(range(1, N+1))
D = []
for i in range(-1,N-1):
    D.append(A[i+1] - A[i] - K )

for d in D:
    if not (d <= 0 and d % N == 0):
        print("NO")
        break
else:
    print("YES")

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

K = sum(A) / sum(range(1, N+1))
for i in range(-1,N-1):
    D = A[i+1] - A[i] - K 

for d in D:
    if not (d <= 0 and d % N == 0):
        print("NO")
        break
else:
    print("YES")
Problem p03844 (python)

Fixed submission:
a ,b,c= map(str, input().split())
if b =="+":
    print(int(a)+int(c))
elif b =="-":
    print(int(a)-int(c))

Buggy submission (verdict: Runtime Error):
a ,b,c= map(str, input().split())
if b =="+":
    print(int(a)+int(b))
elif b =="-":
    print(int(a)-int(b))
Problem p03848 (python)

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

A.sort()
B = [abs(a-b) for a,b in zip(range(N-1,-1,-1),range(N))]
B.sort()

if A==B:
    print(pow(2,N//2,10**9+7))
else:
    print(0)

Buggy submission (verdict: Runtime Error):

a = int(input())
x = list(map(int, input().split()))
x.sort()
t =[2]
x = x[::-1]
if a == 1:
  if x[0] == 0:print(1)
  else:print(0)
else:
  if a %2 == 0:
    for i in range(1,a,2):
      if not i == x[-1] and i ==x[-2]:
        print(0)
        break
      x.pop()
      x.pop()
    else:print(2**(a//2))
  else:
    if x.pop() != 0:
      print(0)
      exit()
    for i in range(0,a,2):
      if not i == x[-1] and i ==x[-2]:
        print(0)
        break
      x.pop()
      x.pop()
    else:print(2**(a//2))

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int, input().split()))
x.sort()
t =[2]
x = x[::-1]
if a == 1:
  if x[0] == 0:print(1)
  else:print(0)
else:
  if a %2 == 0:
    print(t[3])
    for i in range(1,a,2):
      if not i == x[-1] and i ==x[-2]:
        x.pop()
        x.pop()
        print(0)
        break
    else:print(2**(a//2))
  else:
    if x.pop() != 0:
      print(0)
      exit()
    for i in range(0,a,2):
      if not i == x[-1] and i ==x[-2]:
        x.pop()
        x.pop()
        print(0)
        break
    else:print(2**(a//2))

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int, input().split()))
x.sort()
x = x[::-1]
if a %2 == 0:
  for i in range(1,a,2):
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))
else:
  for i in range(0,a,2):
    x.pop()
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int, input().split()))
x.sort()
x = x[::-1]
if a %2 == 0:
  for i in range(1,a,2):
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))
else:
  for i in range(0,a,2):
    x.pop()
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))
Problem p03919 (python)

Fixed submission:
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(M):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(W):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(int, input().split()))
  for j in range(W):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]))
Problem p03938 (python)

Fixed submission:
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+t[x[i-1]])
print(*A)
print(*B)

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = [range(1,a+1)]
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+t[x[i-1]])
print(*A)
print(*B)

Buggy submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = [range(1,a+1)]
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+tpx[i-1]])
print(*A)
print(*B)
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
print(int((a+b)*c/2))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print((a+b)*h/2)
Problem p03998 (python)

Fixed submission:
s={i:list(input()) for i in "abc"}
x="a"
while s[x]:
    x=s[x].pop(0)
print(x.upper())

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

l = list(a)
m = list(b)
n = list(c)
if len(l)>0:
    t = a.pop()
k = 'a'
while len(l) >0 and len(m) > 0 and len(n) > 0:
    k = t
    if t == 'a':
        t = l.pop()
    elif t == 'b':
        t = m.pop()
    elif t == 'c':
        t = n.pop()
print(k)

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

l = []
m = []
n = []
t = a.pop()
k = 'a'
while len(l) >0 and len(m) > 0 and len(n) > 0:
    k = t
    if t == 'a':
        t = a.pop()
    elif t == 'b':
        t = b.pop()
    elif t == 'c':
        t = c.pop()
print(k)
Problem p04006 (python)

Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, x = map(int, input().split())
a = np.array(map(int, input().split()))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy submission (verdict: Runtime Error):

import numpy as np
N, x = map(int, input().split())
a = np.array(map(int, input().split()))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy submission (verdict: Runtime Error):
def inpl(): return [int(i) for i in input().split()]
import numpy as np
N, x = inpl()
a = np.array(inpl())
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)
Problem p04020 (python)

Fixed submission:
a = int(input())
s = 0
p =[int(input()) for _ in range(a)]
p.append(0)
for i in range(a):
    s +=p[i]//2
    if p[i+1] >=1 and p[i]%2 == 1:
        s +=1
        p[i+1] -=1
    
print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
s = 0
p =[int(input()) for _ in range(a)]
p.append(0)
def cal(n,k,s):
    #print(n,k,s,p[n])
    if n== a:return s
    s +=p[n]//2
    c = p[n]%2
    if p[n+1] >=1 and k == 1:
        s +=1
        p[n+1] -=1
        return cal(n+1,c,s)
    else:return cal(n+1,c,s)
    
print(cal(0,0,0))
Problem p04026 (python)

Fixed submission:
s = input()
t = s[1:]+" "
r = s[2:]+"  "
for n,(i,j,k) in enumerate(zip(s,t,r)):
    if i == j :
        print(n+1,n+2)
        exit()
    elif i == k:
        print(n+1,n+3)
        exit()
print(-1,-1)

Buggy submission (verdict: Runtime Error):
print(2 3)