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

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

i = input().split()
if i[1] == '+':
    print(int(i[0])+int(i[2]))
if i[1] == '-':
    print(int(i[0])-int(i[2]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N=int(input())
T=input().split()
X=[]
for i in range(int(input())):
    X.append(input().split()[1])
    
T=list(map(int,T))
X=list(map(int,X))
for y in range(len(X)):
    T_tmp = T
    X_tmp = X
    T_tmp[y] = X_tmp[y]
    print(sum(T_tmp))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N=int(input())
T=input().split()
X=[]
for i in range(int(input())):
    X.append(input().split()[1])
    
T=list(map(int,T))
X=list(map(int,X))
for y in range(len(X)):
    T[y]=X[y]
    print(sum(T))
Problem p03945 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

S = list(input())
L = len(S)
b = S.count("B")
w = S.count("W")

def f(i, result):
  if S[i] == S[i-1]:
    if i == 1:
      print(result)
      exit()
    else:
      f(i-1, result)
  else:
    if i == 1:
      result += 1
      print(result)
      exit()
    else:
      result += 1
      f(i-1, result)
      
if L == 1:
  result = 0
  print(result)
  exit()
elif b == L or w == L:
  result = 0
  print(result)
  exit()
else:
  f(L-1, 0)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**5)

S = list(input())
L = len(S)
b = S.count("B")
w = S.count("W")

def f(i, result):
  if S[i] == S[i-1]:
    if i == 1:
      print(result)
      exit()
    else:
      f(i-1, result)
  else:
    if i == 1:
      result += 1
      print(result)
      exit()
    else:
      result += 1
      f(i-1, result)
      
if L == 1:
  result = 0
  print(result)
  exit()
elif b == L or w == L:
  result = 0
  print(result)
  exit()
else:
  f(L-1, 0)

Buggy submission (verdict: Runtime Error):
S = list(input())
L = len(S)
b = S.count("B")
w = S.count("W")

def f(i, result):
  if S[i] == S[i-1]:
    if i == 1:
      print(result)
      exit()
    else:
      f(i-1, result)
  else:
    if i == 1:
      result += 1
      print(result)
      exit()
    else:
      result += 1
      f(i-1, result)
      
if L == 1:
  result = 0
  print(result)
  exit()
elif b == L or w == L:
  result = 0
  print(result)
  exit()
else:
  f(L-1, 0)

Buggy submission (verdict: Runtime Error):
S = list(input())
L = len(S)

def f(i, result):
  if S[i] == S[i-1]:
    if i == 1:
      print(result)
      exit()
    else:
      f(i-1, result)
  else:
    if i == 1:
      result += 1
      print(result)
      exit()
    else:
      result += 1
      f(i-1, result)
      
if L == 1:
  result = 0
  print(result)
  exit()
else:
  f(L-1, 0)
Problem p03946 (python)

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

B = []
Amin = A[0]

for i in range(1, N):
  if A[i] < Amin:
    Amin = A[i]
  else:
    B.append(A[i] - Amin)

result = B.count(max(B))
print(result)

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

N, T = map(int, input().split())
A = list(map(int, input().split()))

D = [0]

def f(a):
  if a <= N:
    M = max(A[a:N+1])
    Mi = A.index(M)
    m = min(A[a-1:Mi])
    d = M - m
    if D[-1] == d:
      D.append(d)
    elif D[-1] < d:
      D.clear()
      D.append(d)
    f(Mi+2)
  else:
    pass

f(1)

result = len(D)
print(result)

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

N, T = map(int, input().split())
A = list(map(int, input().split()))

D = [0]

def f(a):
  if a <= N:
    M = max(A[a:N+1])
    Mi = A.index(M)
    m = min(A[a-1:Mi])
    d = M - m
    if D[-1] == d:
      D.append(d)
    elif D[-1] < d:
      D.clear()
      D.append(d)
    f(Mi+2)
  else:
    pass

f(1)

result = len(D)
print(result)

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

D = [0]

def f(a):
  if a <= N:
    M = max(A[a:N+1])
    Mi = A.index(M)
    m = min(A[a-1:Mi])
    d = M - m
    if D[-1] == d:
      D.append(d)
    elif D[-1] < d:
      D.clear()
      D.append(d)
    f(Mi+2)
  else:
    pass

f(1)

result = len(D)
print(result)

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

D = []

def f(a):
  if a <= N:
    M = max(A[a:N+1])
    Mi = A.index(M)
    m = min(A[a-1:Mi])
    D.append(M - m)
    f(Mi+2)
  else:
    pass

f(1)

result = D.count(max(D))
print(result)
Problem p04014 (python)

Fixed submission:
import math

n = int(input())
s = int(input())

b = -1

def keisan(k, w):
  l = []
  while k >= w:
    l.append(k % w)
    k = k // w
  else:
    l.append(k)
  return (sum(l))

if n == s:
  b = n + 1
  print(b)
  exit()
  
if n < s:
  b = -1
  print(b)
  exit()

n_r = math.floor(math.sqrt(n))

for i in range(2, n_r+1):
  if keisan(n, i) == s:
    b = i
    print(b)
    exit()

b_list = []    
    
for i in range(1, n_r+1):
  w = n - s
  syou = w // i
  amari = w % i
  if amari == 0:
    b_kouho = syou + 1
    b_list.append(b_kouho)
#    print(b_list)

b_kansei = []

for b in b_list:
  b_ = keisan(n, b)
  if b_ == s:
    b_kansei.append(b)
#    print("b_kanseiは" + str(b_kansei))

if b_kansei != []:
  print(min(b_kansei))
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
s = int(input())

b = -1

def keisan(k, w):
  l = []
  while k >= w:
    l.append(k % w)
    k = k // w
  else:
    l.append(k)
  return (sum(l))

if n == s:
  b = n + 1
  print(b)
  exit()
  
if n < s:
  b = -1
  print(b)
  exit()

n_r = math.floor(math.sqrt(n))

for i in range(2, n_r+1):
  if keisan(n, i) == s:
    b = i
    print(b)
    exit()

for i in range(1, n_r+1):
  w = n - s
  syou = w // i
  amari = w % i
  if syou > n_r-1 and amari == 0:
    b_list = []
    b_kouho = syou + 1
    b_list.append(b_kouho)
  
if b_list != []:
  print(min(b_list))
else:
  print(-1)
Problem p03852 (python)

Fixed submission:
c = input()
if c == "a" or c == "e" or c == "i" or c == "o" or c == "u":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c=="a" or c=="e" or c=="i" or c=="o" or c=="u" :
print("vowel")
else:
print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c==a or c==e or c==i or c==o or c==u :
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c==a or c==e or c==i or c==o or c==u :
print("vowel")
else:
print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c=a or c=e or c=i or c=o or c=u :
print("vowel")
else:
print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c=a or c=e or c=i or c=o or c=u
print("vowel")
else
print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c=a or c=e or c=i or c=o or c=u
print("vowel")
else
print("constant")
Problem p04043 (python)

Fixed submission:
# coding:utf-8
 
x, y, z = list(map(int, input().split()))
if x == 5 and y == 7 and z == 5:
  print("YES")
elif x == 7 and y == 5 and z == 5:
  print("YES")
elif x == 5 and y == 5 and z == 7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
# coding:utf-8
 
x, y, z = [int(i) for i in input().split()]
if x = 5 and y = 7 and z = 5:
  print("YES")
elif x = 7 and y = 5 and z = 5:
  print("YES")
elif x = 5 and y = 5 and z = 7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
# coding:utf-8

x, y, z = list(map(int, input().split()))
if x = 5 and y = 7 and z = 5:
  print("YES")
elif x = 7 and y = 5 and z = 5:
  print("YES")
elif x = 5 and y = 5 and z = 7:
  print("YES")
else:
  print("NO")
Problem p03861 (python)

Fixed submission:
a = input().split()
i = int(a[0])
d = int(a[1])
x = int(a[2])
rd = d // x
ri = (i - 1) // x
if (ri < 0):
	ri = -1
print(rd - ri)

Buggy submission (verdict: Runtime Error):
        a = input().split()
        i = int(a[0])
        d = int(a[1])
        x = int(a[2])
        rd = d / x
        ri = (i - 1) / x
        if (ri < 0):
          ri = -1
        print(rd - ri)

Buggy submission (verdict: Runtime Error):
    a = input()
    a.split()
    i = int(a[0])
    d = int(a[1])
    x = int(a[2])
    rd = d / x
    ri = (i - 1) / x
    if (ri < 0):
      ri = -1
    print(rd - ri)

Buggy submission (verdict: Runtime Error):
a = input()
a.split()
i = (int)a[0]
d = (int)a[1]
x = (int)a[2]
rd = d / x
ri = (i - 1) / x
if (ri < 0):
  ri = -1
print(rd - ri)
Problem p03853 (python)

Fixed submission:
inp = input()
H = int(inp.split()[0])
W = int(inp.split()[1])
l = []
for i in range(H):
    l.append(list(input()))

for i in range(H*2):
    line = ""
    for j in range(W):
        line = line + l[int((i)/2)][j]
    print(line)

Buggy submission (verdict: Runtime Error):
inp = input()
H = int(inp.split()[0])
W = int(inp.split()[1])
l = []
for i in range(H):
    l.append(list(input().split()))

for i in range(H*2):
    line = []
    for j in range(W):
        line = line + l[(i+1)/2][j]
    print(line)

Buggy submission (verdict: Runtime Error):
inp = input()
H = inp.split()[0]
W = inp.split()[1]
l = []
for i in range(H):
    l.append(input().split())

for i in range(H*2):
    line = []
    for j in range(W):
        line = line + l[(i+1)/2][j]
    print(line)

Buggy submission (verdict: Runtime Error):
inp = input()
H = inp.split()[0][0]
W = inp.split()[0][0]
l = []
for i in range(H):
    l.append(inp[i+1])

for i in range(H*2):
    line = []
    for j in range(W):
        line = line + inp[(i+2)/2][j]
    print(line)
Problem p03852 (python)

Fixed submission:
a = ['a','i','u','e','o']
n = str(input())
 
if n in a:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
a = [a,i,u,e,o]
n = str(input())

if n in a:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
i = int(input())
 
if i = a :
    print("vowel")
elif i = i:
    print("vowel")
elif i = u:
        print("vowel")
elif i = e:
        print("vowel")
elif i = o:
    print("vowel")
else:
    print("consonant")

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

if i = a :
    print("vowel")
elif i = i:
    print("vowel")
elif i = u:
        print("vowel")
elif i = e:
        print("vowel")
elif i = o:
    print("vowel")
else:
    print("consonant")
Problem p03852 (python)

Fixed submission:
n = raw_input()
if n in ['a','e','i','o','u']:
    print 'vowel'
else:
    print 'consonant'

Buggy submission (verdict: Runtime Error):
while True:
    n = raw_input()
    if n in ['a','e','i','o','u']:
        print 'vowel'
    else:
        print 'consonant'

Buggy submission (verdict: Runtime Error):
while True:
    n = input()
    if n in ['a','e','i','o','u']:
        print 'vowel'
    else:
        print 'consonant'
Problem p04044 (python)

Fixed submission:
N , L = map(int,input().split())
str = []
for i in range(N):
    str.append(input())
str.sort()
result = ""
for j in str:
    result += j
print(result)

Buggy submission (verdict: Runtime Error):
N , L = map(int,input().sqlit())
S.list()
for i in range(N):
  S.append(input())
S.sort()
for i in range(S):
  print(i)
Problem p04043 (python)

Fixed submission:
L = [int(i) for i in input().split()]

if (L.count(5) == 2 and L.count(7) == 1):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
L = [int(i) for i in input().split()]<
<
if (L.count(5) == 2 and L.count(7) == 1):<
    print("YES")<
else:<
    print("NO")<
Problem p03856 (python)

Fixed submission:
dream, erase = "dream erase".split()

s = input().strip()
while 1:
  if s.startswith(dream):
     s = s[5:]
     if s.startswith("er") and not s.startswith("era"):
       s = s[2:]
  elif s.startswith(erase):
    s = s[5:]
    if s.startswith('r'):
      s = s[1:]
  else:
    break
print("NO" if s else "YES")

Buggy submission (verdict: Runtime Error):
s = input().strip()
strings = "eraser erase dreamer dream".split()
exceptions = "dreameraser dreamerase".split()
while 1:
  for string in strings:
    if s.startswith(string):
      if string == "dreamer":
        for exception in exceptions:
          if startswith(exception):
            s = s[len(exception):]
      else:
s = s[len(string):]
      break
  else:
    break
print("NO" if s else "YES")
Problem p03860 (python)

Fixed submission:
arr = list(input().split())
print(arr[0][0] + arr[1][0] + arr[2][0])

Buggy submission (verdict: Runtime Error):
arr = list(input().split())
print(arr[0].[0] + arr[1].[0] + arr[2].[0])
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):
=int(input())
b=int(input())
h=int(input())

s=(a+b)*h/2

print(int(s))
Problem p04029 (python)

Fixed submission:
val1=int(input())
print(int(val1*(val1+1)/2))

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

print(val1*(val1+1)/)
Problem p04043 (python)

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

if val1.count(5)==2 and val1.count(7)==1:
  print("YES")
else:
  print("NO")

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

val2.sort()
print("".join(val2))

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

val2.sort()
print("".join(val2))
Problem p03963 (python)

Fixed submission:
N,K = map(int,input().split())
print(K * (K-1)**(N-1))

Buggy submission (verdict: Runtime Error):
lst = list(map(int,input().strip()))
N = lst[0]
K = lst[1]
print(K * (N-1)*(K-1))

Buggy submission (verdict: Runtime Error):
lst = list(map(int,input().strip()))
N = lst[0]
K = lst[1]
total = K * (N-1)*(K-1)
Problem p03943 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b == c or b+c == a or c+a == b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
    i = list(map(int, input().split()))
    i.sort()
    if i[2] == i[0]+i[1]:
      print('Yes')
    else:
      print('No')

Buggy submission (verdict: Runtime Error):
l=[int(input() for i in range(3))]
l.sort()
if l[2]==(l[0]+l[1]+l[2])/2:
  print('YES')
else:
  print('NO')
Problem p03962 (python)

Fixed submission:
x,y,z = map(int,input().split())
if x == y and y==z:
  print(1)
elif x == y or y == z or z ==x :
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int, input().split()))
if a==b==c:
  print(1)
elif a==b or b==C or a==c:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int, input().split()))
if a==b==c:
  print(1)
elif (a==b and b != c) or (a!=b and b==C) or (a==c and a!=b):
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
l= [int(input()) for in range(3)]
c = collections.Counter(l)

print(len(c))
Problem p04029 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N=int(input())
s=0
for i in range(N+1):
    s += i
print(s)

Buggy submission (verdict: Runtime Error):
        # -*- coding: utf-8 -*-
        N=int(input())
        for i in range(N+1):
          i+=i
        print(i)

Buggy submission (verdict: Runtime Error):
    # -*- coding: utf-8 -*-
    N=int(input())
    for i in range(N+1):
      i+=i
    print(s)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N=int(input())
for i in range(N+1):
  s+=i
print(s)
Problem p04043 (python)

Fixed submission:
# -*- coding: utf-8 -*-
A_B_C = list(map(int, input().split()))
A_B_C.sort()
if A_B_C == [5,5,7]:
    print('YES')
else:
    print('NO')

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

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

# ソート
l.sort()

# 出力
print(''.join(l))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = []
for i in range(n):
    s.append(input())
print(''.join(sorted(s)))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N,L = list(map(int, input().split()))
l=[]
for i in range(N):
    l.append(input())
    l.sort()
print(l)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N,L = list(map(int, input().split()))
l=[]
s=N*L
for i in range(s):
    l.append(input())
l.sort()
print(l)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N,L = list(map(int, input().split()))
l=[]
for i in range(N*L):
    l.append(input())
l.sort()
print(l)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A_B_C = list(map(int, input().split()))
ABC= A_B_C.soreted()
if A_B_C == [5,5,7]:
    print('YES')
else:
    print('NO')
Problem p03962 (python)

Fixed submission:
a = set(input().split())
print(len(a))

Buggy submission (verdict: Runtime Error):
print(len(a=set(input()))-1)

Buggy submission (verdict: Runtime Error):
print(len(set(input())-1)
Problem p03862 (python)

Fixed submission:
n, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(n-1):
    delta = max(0, a[i] + a[i+1] - x)
    a[i+1] -= delta
    if a[i+1] < 0:
        a[i] += a[i+1]
        a[i+1] = 0
    ans += delta
print(ans)

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

c = 0

if x == 0:
	print(sum(a))
if a[0] > x:
	c += a[i] - (x-1)
	a[i] = x - 1
	
else:
	for i in range(n-1):
		if a[i] + a[i+1] > x:
			if a[i+1] >= a[i]:
				c += (a[i+1] - (x - a[i]))
				a[i+1] -= (a[i+1] - (x - a[i]))
			else:
				c += (a[i+1] - abs(x - a[i]))
				a[i+1] -= (a[i+1] - abs(x - a[i]))              

print(c)
Problem p03862 (python)

Fixed submission:
def minimumNumOfCandies(candies,atmostValue):
  candiesToEat = 0
  for i in range( 0 , len ( candies ) - 1 ) :
    if( candies[i] > atmostValue ) :
      candiesToEat = candiesToEat + ( candies[i] - atmostValue)
      candies[i] = candies[i] - ( candies[i] - atmostValue )
    if( candies[i] + candies[i + 1] > atmostValue ):
      candiesToEat = candiesToEat + ( (candies[i + 1] + candies[i]) - atmostValue )
      candies[i + 1] = candies[i + 1] - ( (candies[i + 1] + candies[i])- atmostValue)
  return candiesToEat
n = list(int(i) for i in input().split())
candies = list( int (i) for i in input().split())
print(minimumNumOfCandies(candies,n[1]))

Buggy submission (verdict: Runtime Error):
def minimumNumOfCandies(candies,atmostValue):
  candiesToEat = 0
  for i in range( 0 , len ( candies ) - 1 ) :
    if( candies[i] > atmostValue ) :
      candiesToEat = candiesToEat + ( candies[i] - atmostValue)
      candies[i] = candies[i] - ( candies[i] - atmostValue )
    if( candies[i] + candies[i + 1] > atmostValue ):
      candiesToEat = candiesToEat + ( candies[i + 1] - atmostValue )
      candies[i + 1] = candies[i + 1] - ( candies[i + 1] - atmostValue)
  return candiesToEat
n = list(int(i) for i in input())
candies = list( int (i) for i in input())
print(minimumNumOfCandies(candies,n[1]))
Problem p04043 (python)

Fixed submission:
a, b, c = map(int, input().split())
if((a+b+c)-17 == 0):
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
n,l=map(int,input().split())
t=sorted([input() for i in range(n)])
print(*t,sep="")
Problem p03860 (python)

Fixed submission:
s = str(raw_input())

b, c, d = map(str, s.split())

print 'A' + c[0] + 'C'

Buggy submission (verdict: Runtime Error):
s = str(raw_input())

b, c, d = map(str, raw_input().split())

print 'A' + c[0] + 'C'
Problem p03861 (python)

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

i = a
count = 0
count_b = 0
count_a = 0

count_b = b/x
count_a = (a-1)/x


print count_b - count_a

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

i = a
count = 0
while i < b + 1:
    if x%i == 0:
        count = count + 1
    i = i + 1

print count

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

i = a
count = 0
while i < b + 1:
    if x%i == 0:
        count = count + 1

print count

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

i = a
count = 0
for i in i < b + 1:
    if x%i == 0:
        count = count + 1

print count

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

i = a
count = 0
for i in i < b + 1:
    if x%i == 0:
        count++

print count
Problem p03998 (python)

Fixed submission:
sa = str(raw_input())
sb = str(raw_input())
sc = str(raw_input())

n = 'a'
h = ''
while True:
    if n == 'a':
        if len(sa) < 1:
            break
        h, sa = sa[0], sa[1:]
        n = h
    elif n == 'b':
        if len(sb) < 1:
            break
        h, sb = sb[0], sb[1:]
        n = h
    elif n == 'c':
        if len(sc) < 1:
            break
        h, sc = sc[0], sc[1:]
        n = h

print str.upper(n)

Buggy submission (verdict: Runtime Error):
sa = str(raw_input())
sb = str(raw_input())
sc = str(raw_input())

n = 'a'
h = ''
while True:
    if n = 'a':
        if len(sa) < 1:
            break
        h, sa = sa[0], sa[1:]
        n = h
    elif n = 'b':
        if len(sb) < 1:
            break
        h, sb = sb[0], sb[1:]
        n = h
    elif n = 'c':
        if len(sc):
            break
        h, sc = sc[0], sc[1:]
        n = h

print n
Problem p03860 (python)

Fixed submission:
input_line1 = raw_input()
input_list = input_line1.split()
output = [x[0] for x in input_list]
print ''.join(output)

Buggy submission (verdict: Runtime Error):
a, b, x= map(int, raw_input().split())
if a%x == 0:
    print b//x - a//x +1
else:
    print  b//x - a//x

Buggy submission (verdict: Runtime Error):
input_list = raw_input.split()
output = x[0] for x in input_list
print ''.join(output)

Buggy submission (verdict: Runtime Error):
input_line1 = raw_input()
input_list = input_line1.split()
output = x[0] for x in input_list
print ''.join(output)

Buggy submission (verdict: Runtime Error):
input_line1 = raw_input()
input_list = input_line1.split()
output = x[0] for x in input_list
print ''.join(output)
Problem p03861 (python)

Fixed submission:
a, b, x= map(int, raw_input().split())
if a%x == 0:
    print b//x - a//x +1
else:
    print  b//x - a//x

Buggy submission (verdict: Runtime Error):
a, b, x= raw_input().split()
if a%3 == 0:
    print b//x - a//x +1
else:
   print  b//x - a//x +1

Buggy submission (verdict: Runtime Error):
a, b, x= raw_input().split()
m = (b-a)//x
if a%x == 0 or b%x == 0:
    print m+1
else:
    print m

Buggy submission (verdict: Runtime Error):
a, b, x= raw_input().split()
m = a//b
if a%x == 0 or b%x == 0:
    print m+1
else:
    print m
Problem p03862 (python)

Fixed submission:
N, x = map(int, raw_input().split())
candies = map(int, raw_input().split())
counter = 0
for i  in range(0, len(candies)-1):
    delta = candies[i+1] + candies[i] - x
    if delta > 0:
        counter += delta
        candies[i+1] = x - candies[i]
        if candies[i+1] < 0:
            candies[i+1] = 0
print counter

Buggy submission (verdict: Runtime Error):
counter = 0
for i  in range(0, len(candies)-1):
    counter += candies[i+1] + candies[i] - x
    candies[i+1] = x - candies[i]
print counter
Problem p04043 (python)

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

flag = bool

if a == '5' and b =='7' and c=='5':
    flag = True
if a =='7' and b=='5' and c == '5':
    flag = True
if a =='5' and b=='5' and c == '7':
    flag = True

if flag == True:
    print('YES')
else:
    print('NO')

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

if a == 5 and b ==7 and c==5:
    flag = True
if a ==7 and b==5 and c == 5:
    flag = True
if a ==5 and b==5 and c == 7:
    flag = True

if flag == True:
    print('YES')
else:
    print('NO')
Problem p03863 (python)

Fixed submission:
s=input();l = len;p = print
if (s[0]==s[-1] and l(s)%2==0) or (s[0]!=s[-1] and l(s)%2==1):
    p("First")
else:
    p("Second")

Buggy submission (verdict: Runtime Error):
s=input();l = len;p = print
if (s[0]==s[-1] * l(s)%2==0) + (s[0]!=s[-1] * l(s)%2==1):
    p("First")
else:
    p("Second")