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

Fixed submission:
s = input()
print(s[:4]+' '+s[4:])

Buggy submission (verdict: Runtime Error):
n = input()
s = list(input())
a = {}
for i in range(1,int(n)+1):
    a[i] = int(s[2*i-2])

result = 0
for i in range(1,int(n)+1):
    if a[a[i]] == i:
        result = result+1
result = int(result/2)
print(result)

Buggy submission (verdict: Runtime Error):
s = input()
print(s[:4]+' '+s[4:]+'\n')

Buggy submission (verdict: Runtime Error):
s = input()
print(s[:4]+' '+s[4:])
Problem p03992 (python)

Fixed submission:
str = raw_input()

str1 = str[0:4]
str2 = str[4:len(str)]

print str1 +" " + str2

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
a = map(int, raw_input().split(" "))
b = [-1]
a = b + a
#print a
count = 0
for i in range(1,N+1):
    #print a.index(a[int(a[i])])
    if i == a[a[i]] and a.index(a[a[i]]) == a[i]:
        count +=1
        a[i] = 0
        a[(a[i])] = 0

print count
Problem p03992 (python)

Fixed submission:
s = input()
print (s[0:4], end=' ')
print(s[4:12])

Buggy submission (verdict: Runtime Error):
s=input()
list=[]
k=int(input())
for i in range(len(s)-1):
    if (ord(s[i])+k)>122:
        list.append('a')
        k=k-(123-ord(s[i]))
    else:
        list.append(s[i])
list.append(chr(ord(s[len(s)])+k))
for i in range(len(s)):
    print(list[i], end='')
Problem p03992 (python)

Fixed submission:
s = raw_input()
print s[:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
s = list(raw_input())
k = int(raw_input())

for i in range(len(s)):
    numChanges = ord('z') - ord(s[i]) + 1
    if s[i] != 'a' and numChanges <= k:
        s[i] = 'a'
        k -= numChanges

    if i == len(s) - 1:
        s[i] = chr(ord(s[i]) + (k % 26))

print ''.join(s)

Buggy submission (verdict: Runtime Error):
s = list(raw_input())
k = int(raw_input())

for i in range(len(s)):
    numChanges = ord('z') - ord(s[i]) + 1
    if s[i] != 'a' and numChanges <= k:
        s[i] = chr(ord(s[i]) - 26 + numChanges)
        k -= numChanges

    elif i == len(s) - 1 and numChanges > k:
        s[i] = chr(ord(s[i]) + k)

print ''.join(s)
Problem p03992 (python)

Fixed submission:
# -*- coding: utf-8 -*-
s = raw_input()
print s[:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
s = raw_input
print s[:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
def cod(s):
    return s[:4] + ' ' + s[4:]
k = sys.argv[1]
cod(k)

Buggy submission (verdict: Runtime Error):
s = sys.argv[1]
print s[:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
print s[:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
import sys
def codefestival(s):
    return s[4:] + ' ' + s[4:]
codefestival(sys.argv[1])

Buggy submission (verdict: Runtime Error):
print s[:4] + ' ' + s[4:]

Buggy submission (verdict: Runtime Error):
return s[:4] + " " + s[4:]
Problem p03992 (python)

Fixed submission:
s = raw_input()
print("{} {}".format(s[:4], s[4:]))

Buggy submission (verdict: Runtime Error):
s = raw_input()
k = int(raw_input())

opreq = [(ord('z') - ord(c) + 1) % 26 for c in s]

s_ = []

if len(s) > 1:
    i = 0
    while k > 0 and i < len(s) - 1:
        if opreq[i] < k:
            k = k - opreq[i]
            s_.append('a')
        else:
            s_.append(s[i])
        i += 1

# Last character
last_c = chr((k + ord(s[-1]) - ord('a')) % 26 + ord('a'))
s_.append(last_c)

print("".join(s_))
Problem p03992 (python)

Fixed submission:
code_festival = input()

code = code_festival[:4]
festival = code_festival[4:]

code_festival = code + " " + festival
print (code_festival)

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

sum_of_pairs = 0
for i,rabbit in enumerate(like_rabbits_list):
    if like_rabbits_list[rabbit - 1] == (i+1):
        sum_of_pairs += 1

print (int(sum_of_pairs / 2))
Problem p03994 (python)

Fixed submission:
s=input()
k=int(input())
d = dict()
alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(alphabet)):
    d[alphabet[i]]=i
    
def f(s,k):
    s = [s[i] for i in range(len(s))]
    res = s
    L = 0
    for i in range(len(s)):
        l = max((26 - d[s[i]]) % 26, 0)
        if i==len(s)-1:
            res[i] = alphabet[(d[s[i]] + (k-L)) % 26]
        else:
            if L + l <= k:
                res[i] = "a"
                L += l
            else:
                continue
    return(''.join(res))
print(f(s,k))

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
d = dict()
for i in range(len(alphabet)):
    d[alphabet[i]]=i
    
def f(s,k):
    s = [s[i] for i in range(len(s))]
    res = s
    L = 0
    for i in range(len(s)):
        l = max(26 - d[s[i]],0)
        if L + l < k:
            res[i] = "a"
            L += l
        else:
            if i==len(s)-1:
                res[i] = alphabet[(d[s[i]] + (k-L)) % 26]
            continue
    return(''.join(res))
print(f(s,k))

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
d = dict()
for i in range(len(alphabet)):
    d[alphabet[i]]=i
    
def f(s,k):
    s = [s[i] for i in range(len(s))]
    res = s
    L = 0
    for i in range(len(s)):
        l = max(26 - d[s[i]],0)
        if L + l < k:
            res[i] = "a"
            L += l
        else:
            if i==len(s)-1:
                res[i] = alphabet[(d[s[i]] + (k-L)) % 26]
            continue
    return(''.join(res))
f(s,k)
Problem p03992 (python)

Fixed submission:
S = raw_input()

print S[0:4] + " " + S[4:12]

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

print S[0:4] + " " + s[4:12]
Problem p03994 (python)

Fixed submission:
s = raw_input()
K = input()

alpha = [chr(i) for i in range(97,97+26)]

i = 0
while K>=26 and i<len(s)-1:
	if alpha.index(s[i]) != 0:
		K = K - (26 - alpha.index(s[i]))
		s = s[:i] + 'a' + s[i+1:]
	i=i+1

for moji in range(i, len(s)):
	if alpha.index(s[moji]) != 0:
		if K >= 26-alpha.index(s[moji]):
			K = K - (26-alpha.index(s[moji]))
			s = s[:moji] + 'a' + s[moji+1:] 

if K>0:
	last_char = alpha[ alpha.index(s[-1]) + (K % 26) ]
	s = s[:-1] + last_char

print s

Buggy submission (verdict: Runtime Error):
s = raw_input()
K = input()

alpha = [chr(i) for i in range(97,97+26)]

for moji in range(1, len(s)+1):
	if alpha.index(s[moji-1]) != 0:
		if K >= 26-alpha.index(s[moji-1]):
			K = K - (26-alpha.index(s[moji-1]))
			s = s[:moji-1] + 'a' + s[moji:] 

if K>0:
	last_char = alpha[ alpha.index(s[-1]) + (K % 26) ]
	s = s[:-1] + last_char

print s
Problem p04047 (python)

Fixed submission:
n = int(raw_input())
l = map(int, raw_input().split())

l.sort()
sum = 0
for i in l[::2]:
	sum += i

print sum

Buggy submission (verdict: Runtime Error):
n, x = map(int, raw_input().split())

def cal(n):
	return n + 1 + (n - 2)*2

if n % x == 0:
	l = cal(n) - cal(x)
else:
	l = cal(n)

print l
Problem p03993 (python)

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

pairs = []

for i in range(len(A)):
    if A[A[i] - 1] == i + 1:
        pairs.append(1)

print(len(pairs) // 2)

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

pairs = []

for i in range(len(A)):
    if A[A[i] - 1] == i + 1:
        pairs.append(1)

print(len(pairs) // 2)

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

pairs = []

for i in A:
    if A[A[i] - 1] = i + 1:
        pairs.append(1)

print(len(pairs) // 2)
Problem p04033 (python)

Fixed submission:
import sys

def main():
    l = input().split()
    a = int(l[0])
    b = int(l[1])

    if a <= 0 and b >= 0:
        print("Zero")
    elif a > 0:
        print("Positive")
    elif b < 0:
        if (b - a) % 2 != 0:
            print("Positive")
        else:
            print("Negative")

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    a = int(sys.argv[1])
    b = int(sys.argv[2])

    temp = 1
    for i in range(a, b+1):
        temp *= i
    else:
        if temp == 0:
            print("Zero")
        elif temp > 0:
            print("Positive")
        else:
            print("Negative")


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    a = int(sys.argv[1])
    b = int(sys.argv[2])

    if a <= 0 and b >= 0:
        print("Zero")
        quit()

    temp = 1
    for i in range(a, b+1):
        temp *= i
    else:
        if temp > 0:
            print("Positive")
        else:
            print("Negative")


if __name__ == '__main__':
    main()
Problem p03994 (python)

Fixed submission:
#read in input
s = map((lambda x: ord(x) - 96), raw_input())
k = int(raw_input())


for i in range(len(s)):
  sv = s[i]
  if sv == 1 or (27 - sv) > k:
    continue
  s[i] = 1
  k = k - (27 - sv)

s[-1] = (((s[-1] + k) - 1) % 26) + 1

print "".join(map((lambda x: chr(x + 96)), s))

Buggy submission (verdict: Runtime Error):
#read in input
s = map((lambda x: ord(x) - 96), raw_input())
k = int(raw_input())


for i in range(len(s)):
  sv = s[i]
  if sv == 1 || (27 - sv) > k:
    continue
  s[i] = 1
  k = k - (27 - sv)

s[-1] = (((s[-1] + k) - 1) % 26) + 1

print "".join(map((lambda x: chr(x + 96)), s))
Problem p03998 (python)

Fixed submission:
# 入力
SA=list(input())
SB=list(input())
SC=list(input())

# 次に捨てる人（初期値は'A')
x='a'

while True:
  if x=='a':
    # リストの要素が0ならば終了する
    if len(SA)==0:
      print('A')
      exit()

    # 先頭要素を除去してxに代入
    x=SA[0]
    SA.remove(x)
  elif x=='b':
    # リストの要素が0ならば終了する
    if len(SB)==0:
      print('B')
      exit()

    # 先頭要素を除去してxに代入
    x=SB[0]
    SB.remove(x)
  else:
    # リストの要素が0ならば終了する
    if len(SC)==0:
      print('C')
      exit()

    # 先頭要素を除去してxに代入
    x=SC[0]
    SC.remove(x)

Buggy submission (verdict: Runtime Error):
sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)

i = sa.pop(0)

while True : 
    if i =='a':
        if lem(sa) ==0:
            print(sa)
            exit()    
        i = sa.pop(0)

    if i =='b':
        if lem(sb) ==0:
            print(sb)
            exit()    
        i = sb.pop(0)

    if i =='c':
        if lem(sc) ==0:
            print(sc)
            exit()    
        i = sc.pop(0)

Buggy submission (verdict: Runtime Error):
sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)

i = sa.pop(0)

while len(sa) != 0 and len(sb) != 0 and len(sb) != 0 : 
    if i =='a':
        i = sa.pop(0)
        continue    
    elif i =='b':
        i = sb.pop(0)
        continue    
    elif i =='c':
        i = sc.pop(0)
        continue

if len(sa) == 0:
    print('A')
elif len(sb) == 0:
    print('B')
elif  len(sc) == 0:
    print('C')

Buggy submission (verdict: Runtime Error):
sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)

i = sa.pop(0)

while len(sa) != 0 and len(sb) != 0 and len(sb) != 0 : 
    print(sa,sb,sc,i)
    if i =='a':
        i = sa.pop(0)
        continue    
    elif i =='b':
        i = sb.pop(0)
        continue    
    elif i =='c':
        i = sc.pop(0)
        continue

if len(sa) == 0:
    print('A')
elif len(sb) == 0:
    print('B')
elif  len(sc) == 0:
    print('C')

Buggy submission (verdict: Runtime Error):
sa, sb, sc = [input() for i in range(3)]
sa, sb, sc = list(sa),list(sb),list(sc)

i = sa.pop(0)

while len(sa) != 0 and len(sb) != 0 and len(sb) != 0 : 
    if i =='a':
        i = sa.pop(0)
    if i =='b':
        i = sb.pop(0)
    if i =='c':
        i = sc.pop(0)

if len(sa) == 0:
    print('A')
elif len(sb) == 0:
    print('B')
elif  len(sc) == 0:
    print('C')
Problem p04011 (python)

Fixed submission:
n, k, x, y = map(int, [input() for i in range(4)])

if k <= n:
    total = k*x + (n-k)*y
else :
    total = n*x

print(total)

Buggy submission (verdict: Runtime Error):
import itertools

n,a = map(int,input().split())
x = list(map(int, input().split()))

cnt = 0

for i in range(n+1):
    for v in itertools.combinations(x,i+1):
        if sum(v) == a*(i+1): #組み合わせのカードの平均がaと等しいならば
            cnt = cnt + 1

print(cnt)
Problem p04045 (python)

Fixed submission:
n,k = map(int,input().split()) #入力
a = list(map(int,input().split())) #使用不可の数字
b = {0,1,2,3,4,5,6,7,8,9}-set(a) #使用可能な数字の集合
while set([int(i) for i in list(str(n))])-b !=set() : # 使用可能な数字のみでなければ
    n += 1
print(n)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split()) #入力
a = list(map(int,input().split())) #使用不可の数字
b = {0,1,2,3,4,5,6,7,8,9}-set(a) #使用可能な数字の集合
n = [int(i) for i in list(str(n))] #価格(int)をリストに分解

while set([int(i) for i in list(str(n))])-b !={} : # 使用可能な数字のみでなければ
    n += 1

print(n)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split()) #入力
a = list(map(int,input().split())) #使用不可の数字
n2 = [int(i) for i in list(str(n))] #価格を分解
for i in n2:
    while n2[i] in a :#使用不可ならば
        n2[i] += 1
        if n2[i]>=10:
            n2[i] =1

print("".join([str(i) for i in n2]))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split()) #入力
a = list(map(int,input().split())) #使用不可の数字
b = list({0,1,2,3,4,5,6,7,8,9}-set(a)) #使用可能な数字のリスト
n2 = [int(i) for i in list(str(n))] #価格を分解

for i in n2:
    while n2[i] in a :#使用不可ならば
        n2[i] += 1

print("".join([str(i) for i in n2]))
Problem p04012 (python)

Fixed submission:
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
u = 0
for i in range(0, len(t)):
    u = u + t[i]
if u == 26:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
u = 0
for i in range(0, len(s)):
    u = u + t[i]
if u == 26:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
u = 1
for i in range(0, len(s)):
    u = u * t[i]
if u == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
print(t)
u = 1
for i in range(0, len(s)):
    u = u * t[i]
if u == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[i] = t[ord(s[i]) - 97] * (-1)
u = 1
for i in range(0, len(s)):
    u = u * t[i]
if u == 1:
    print('Yes')
else:
    print('No')
Problem p04029 (python)

Fixed submission:
s=int(input())
n=0
while(s>0):
  n=n+s
  s=s-1
print(n)

Buggy submission (verdict: Runtime Error):
import ita
s=int(input())
n=0
while(s>0):
  n=n+s
  s=s-1
print(n)

Buggy submission (verdict: Runtime Error):
s=print(int(input()))
n=0
while(s>0):
  n=n+1
  s=s-1
return(n)

Buggy submission (verdict: Runtime Error):
s = print(int(input()))
n = 0
for i in range(0, s):
  n = n + 1
return(n)

Buggy submission (verdict: Runtime Error):
s = print(int(input()))
n = 0
for i in range(1, s):
  n = n + 1
return(n)
Problem p04031 (python)

Fixed submission:
import statistics as st
import math
int(input())
s = list(map(int, input().split()))
md = math.floor(st.mean(s))
mu = md + 1
sd = 0
su = 0
for i in range(0, len(s)):
    sd = sd + (s[i] - md) ** 2
    su = su + (s[i] - mu) ** 2
print(min(sd, su))

Buggy submission (verdict: Runtime Error):
import statistics as st
import math
int(input())
s = list(map(int, input().split()))
md = math.floor(st.mean(s))
mu = avedown + 1
sd = 0
su = 0
for i in range(0, len(s)):
    sd = sd + (s[i] - md) ** 2
    su = su + (s[i] - mu) ** 2
print(min(sd, su))
Problem p03997 (python)

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

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
h = input()
print((a+b)*h/2)

Buggy submission (verdict: Runtime Error):
(a+b)*h/2

Buggy submission (verdict: Runtime Error):
return (a+b)*h/2
Problem p03998 (python)

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

i = "a"
player = {"a":a,"b":b,"c":c}

while True:
    if len(player[i])==0:
        print(i.upper())
        break
    l = player[i][0]
    player[i] = player[i][1:]
    i = l

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

player = a
while True:
  l = player[0]
  player = player[1:]
  if len(player) == 0
  	print(player)
  player = l
Problem p04029 (python)

Fixed submission:
n = int (input())
result =0
for i in range(1,n+1):
    result =result +i
print (result)

Buggy submission (verdict: Runtime Error):
n = int (input())
resilt =0
for i in range(1,n):
    result =result +i
print (result)

Buggy submission (verdict: Runtime Error):
n = int (input())
resilt =0
for i in range(1,n):
  result =result +i
print result

Buggy submission (verdict: Runtime Error):
n = int (input())
for i in range(1,n):
  result =result + i
print result

Buggy submission (verdict: Runtime Error):
n = int (input())
print (n*(n+1)/2))
Problem p04043 (python)

Fixed submission:
a, b, c = map(int,input().split())
if a == 7:
    if b==5 and c ==5:
        print ("YES")
    else:
        print ("NO")
elif b != 7 and c !=7:
    print ("NO1")
elif b ==7:
    if a==5 and c ==5:
        print ("YES")
    else:
        print ("NO")
elif a==5 and b ==5:
    print ("YES")
else:
    print ("NO")

Buggy submission (verdict: Runtime Error):
a,b,c= input().split()
if len(a) == 7:
  if len (b) ==5 and len(c) == 5:
    print "YES"
  else:
    print "NO"
else:
  if len(b) =! 7 and len(c)=!7:
    print "NO"
  else:
    if len(b) ==7 and len (c) ==5:
      print "YES"
    else:
      if len(b) ==5 and len(c) ==7:
        print "YES"
      else:
        print "NO"
Problem p03997 (python)

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

print(int((a+b)*h/2))

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = 0
d = a + b
d = d * c / 2
print(d)

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

d = 0
d = a + b
d = d * c / 2
Problem p03997 (python)

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

print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
a = int.print(a)
b = int.print(b)
h = int.print(h)

d = (a+b)*h/2
print(d)
Problem p03997 (python)

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

s = ((a + b) * h ) / 2
print(int(s))

Buggy submission (verdict: Runtime Error):
class board:
    def __init__(self, h, w):
        self.h = h
        self.w = w
        self.pieces = self.make_pieces()
        self.results = dict()

    def make_pieces(self):
        pieces = []
        for i in range(self.h):
            for j in range(self.w):
                pieces.append(0)
        return pieces

    def draw(self, i, j):
        i -= 1; j-= 1

        index = j + i * self.w
        print(index)
        self.pieces[index] = 1

    def start_scan(self):
        for i in range(self.w - 2):
            print(i)
            for j in range(self.h - 2):
                print(j)
                num = 0
                for x in range(i, i+3):
                    for y in range(j, j+3):
                        index = x + y * self.w
                        v = self.pieces[index]
                        print("v = {0}".format(v))
                        if v == 1:
                            num += 1
                self.results[num] = num

    def searched_box(self, num):
        return self.results.get(num, 0)
        

if __name__ == '__main__':
    args = input().split(' ')
    board_h = int(args[0])
    board_w = int(args[1])
    n       = int(args[2])

    board = board(board_h, board_w)
    for _ in range(n):
        args = input().split(' ')
        i = int(args[0])
        j = int(args[1])
        board.draw(i, j)

    board.start_scan()
    for i in range(10):
        print(board.searched_box(i))
Problem p03999 (python)

Fixed submission:
def SumIndicatedPoint(pcandid):
	point = list(str(pcandid))
	conNum = nums[0]
	count = 1
	sum = 0
	for p in point:
		if p == '0':
			conNum = conNum + nums[count]
		elif p == '1':
			sum = sum + int(conNum)
			conNum = nums[count]
		count = count + 1
	sum = sum + int(conNum)
	#print(str(sum))	
	return sum
	
if __name__ == '__main__':	
	nums = list(input())
	#nums.reverse()
	ALLSUM = 0
	pcandidstr = '0' + str(len(nums) - 1) + 'b'
	pcandid = 0
	if len(nums) > 1:
		maxcandid = int('1' * (len(nums) - 1),2)
		#add = format(1,pcandidstr)
		while pcandid <= maxcandid:
			ALLSUM = ALLSUM + SumIndicatedPoint(format(pcandid,pcandidstr))
			pcandid = pcandid + 1
	elif len(nums) == 1:
		ALLSUM = int(nums[0])
	print(str(ALLSUM))

Buggy submission (verdict: Runtime Error):
def SumIndicatedPoint(pcandid):
	point = list(str(pcandid))
	conNum = nums[0]
	count = 1
	sum = 0
	for p in point:
		if p == '0':
			conNum = conNum + nums[count]
		elif p == '1':
			sum = sum + int(conNum)
			conNum = nums[count]
		count = count + 1
	sum = sum + int(conNum)
	#print(str(sum))	
	return sum
	
if __name__ == '__main__':	
	nums = list(input())
	#nums.reverse()
	pcandidstr = '0' + str(len(nums) - 1) + 'b'
	pcandid = 0
	maxcandid = int('1' * (len(nums) - 1),2)
	#add = format(1,pcandidstr)
	ALLSUM = 0
	while pcandid <= maxcandid:
		ALLSUM = ALLSUM + SumIndicatedPoint(format(pcandid,pcandidstr))
		pcandid = pcandid + 1
	print(str(ALLSUM))
Problem p03997 (python)

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

Buggy submission (verdict: Runtime Error):
s={}
for i in range(3):
    s[chr(97+i)]=input()
turn="a"
while True:
    if not s[turn]:
        break
    else:
        turn=s[turn][0]
        s[turn]=s[turn][1:]
print(turn.upper())

Buggy submission (verdict: Runtime Error):
s={}
for i in range(3):
    s[chr(97+i)]=input()
turn="a"
while True:
    if not s[turn]:
        break
    else:
        turn=s[turn][0]
        s[turn]=s[turn][1:]
print(turn.upper())
Problem p03998 (python)

Fixed submission:
s={}
for i in range(3):
    s[chr(97+i)]=input()
turn="a"
while True:
    if not s[turn]:
        break
    else:
        t=s[turn][0]
        s[turn]=s[turn][1:]
        turn=t
print(turn.upper())

Buggy submission (verdict: Runtime Error):
s={}
for i in range(3):
    s[chr(97+i)]=input()
turn="a"
while True:
    if not s[turn]:
        break
    else:
        turn=s[turn[0]]
        s[turn]=s[turn][1:]
print(turn.upper())
Problem p04001 (python)

Fixed submission:
dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    b=bin(i)[2:].zfill(len(s)-1)
    for j in range(len(s)-1):
        val+=s[j]+dp[int(b[j])]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)

Buggy submission (verdict: Runtime Error):
dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    for j in range(len(s)-1):
        val+=s[j]
        val+=dp[int(bin(i)[j+2])]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)

Buggy submission (verdict: Runtime Error):
dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    for j in range(len(s)-1):
        val+=s[j]
        val+=dp[bin(i)[j+2]]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)

Buggy submission (verdict: Runtime Error):
dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    for j in range(len(s)-1):
        val+=s[j]+dp[bin(i)[j+2]]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)
Problem p04019 (python)

Fixed submission:
temp = input()
s = temp.count("S")
n = temp.count("N")
e = temp.count("E")
w = temp.count("W")

if (s == n):
 if (e>=1 & w >= 1):
  print ("Yes")
 else:
  print ("No")
elif (e == w):
 if (s >= 1 & n >= 1):
  print ("Yes")
 else:
  print ("No")
else:
 print ("No")

Buggy submission (verdict: Runtime Error):
s = input()
a = s.count("S") - s.count("N")
b = s.count("E") - s.count("W")
if (a == 0 && a == b):
 print ("Yes")
else:
 print ("No")