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

Fixed submission:
S_a, S_b, S_c = map(list, [input() for _ in range(3)])
turn = 'a'
relation = {'a': S_a, 'b': S_b, 'c': S_c}
while True: 
  if turn == 'a' and len(S_a) == 0:
    print('A')
    exit()
  if turn == 'b' and len(S_b) == 0:
    print('B')
    exit()
  if turn == 'c' and len(S_c) == 0:
    print('C')
    exit()
  
  card = relation[turn].pop(0)
  turn = card

Buggy submission (verdict: Runtime Error):
S_a, S_b, S_c = [input() for _ in range(3)]
trun = 'a'
relation = {'a': S_a, 'b': S_b, 'c': S_c}
while True:
  card = relaton[turn].pop(0)
  turn = card
  
  if len(S_a) == 0:
    print('A')
    exit()
  if len(S_b) == 0:
    print('B')
    exit()
  if len(S_c) == 0:
    print('C')
    exit()
Problem p04012 (python)

Fixed submission:
S = input()
S_elements = set(S)
for e in S_elements:
  if S.count(e) % 2 != 0:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
print("Yes" if all([S.count(e) % 2 == 0 for e in set(S)] else "No"))

Buggy submission (verdict: Runtime Error):
S = input()
S_elements = set(s)
for e in S_elements:
  if S.count(e) % 2 != 0:
    print("No")
    exit()
print("Yes")
Problem p04043 (python)

Fixed submission:
s = input()
if s.count("7") == 1 and s.count("5") == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
s = input()
if s.count("7") == 2 and s.count("5") == 1:
  print("YES")
else:
  print("NO)
Problem p04044 (python)

Fixed submission:
print("".join(sorted([input() for _ in range(int(input().split()[0]))])))

Buggy submission (verdict: Runtime Error):
print("".join(sorted([input() for _ in range(input().split()[0]))))
Problem p03416 (python)

Fixed submission:
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis):
    nm = str(i + a)
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis):
    nm = str(i + a)
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
dis = int(b) - int(a)
cnt = 0
for i in range(dis):
    nm = str(i + a)
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
dis = b - a
cnt = 0
for i in range(dis):
    nm = str(i + dis)
    if nm[0] == nm[4]:
        if nm[1] == nm[3]:
            cnt += 1

print(cnt)
Problem p03423 (python)

Fixed submission:
print(int(int(input()) / 3))

Buggy submission (verdict: Runtime Error):
print(int(int(input())num / 3))
Problem p03433 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = int(input())

if n % 500 <= a:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = int(input())

if n % 500 =< a:
    print("Yes")
else:
    print("No")
Problem p03434 (python)

Fixed submission:
n = int(input())
a = input().strip().split()
a = [ int(a[i]) for i in range(len(a)) ]

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])
        
print(alice - bob)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int(input().strip().split())))

a.sorted(reverse=True)

alice = 0
bob = 0
for i in range(n-1):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])
        
print(alice - bob)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int(input().strip().split())))

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n-1):
    if i % 2 is 0:
        alice = alice + int(a[i])
    else:
        bob = bob + int(a[i])

ans = alice - bob
        
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int(input().strip().split())))

a.sort(reverse=True)

alice = 0
bob = 0
for i in range(n-1):
    if i % 2 is 0:
        alice += a[i]
    else:
        bob += a[i]

print(alice - bob)
Problem p03456 (python)

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

import math
if math.sqrt(n) % 1 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n= int("".join(num.split()))

import math
if math.sqrt(n) % 1 == 0:
    print("Yes")
else:
    print("No")
Problem p03457 (python)

Fixed submission:
n = int(input().strip())
p = [ list(map(int, input().split())) for i in range(n) ]
p.insert(0, [0,0,0])

def check(n,p):
    for i in range(n):
        time = p[i+1][0] - p[i][0]
        dist = sum(p[i+1][1:]) - sum(p[i][1:])

        if time % 2 == 0 and dist % 2 == 0 or time % 2 == 1 and dist % 2 == 1:
            if -(time) <= dist <= time:
                pass
            else:
                return ans(1)
        else:
            return ans(1)

    return ans(0)

def ans(num):
    if num == 1: print("No")
    else: print("Yes")

check(n,p)

Buggy submission (verdict: Runtime Error):
n = int(input()strip())
p = [ list(map(int, input().split())) for i in range(n) ]
p.insert(0, [0,0,0])
ans = True

for i in range(n):
    time = p[i+1][0] - p[i][0]
    dist = abs(sum(p[i+1][1:]) - sum(p[i][1:]))

    if time % 2 != dist % 2 or dist > time:
        ans = False
        break

if ans: print("Yes")
else: print("No")
Problem p03636 (python)

Fixed submission:
s = input()
print(s[0] + str(len(s)-2) + s[-1])

Buggy submission (verdict: Runtime Error):
print(S[0] + (S.length()-2) + S[-1])
Problem p03455 (python)

Fixed submission:
print('Even' if any(n % 2 == 0 for n in map(int, input().split())) else 'Odd')

Buggy submission (verdict: Runtime Error):
print('Even' if any(n % 2 == 0 for n in map(int, input().split()) else 'Odd')
Problem p03417 (python)

Fixed submission:
m, n = map(int, input().split())

count = 0
if m > 1 and n > 1:
  count = (m - 2)*(n - 2)
elif m == 1 and n > 1:
  count = n - 2
elif m > 1 and n == 1:
  count = m - 2
elif m == 1 and n == 1:
  count = 1
 
print(count)

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

if n == 1 and m == 1:
  	return 1
  
if n == 1 or m == 1:
	if n == 1:
		return m - 2
	else:
		return n - 2

return (m-2)*(n-2)
Problem p03419 (python)

Fixed submission:
MN=list(map(int, input().split()))
M = MN[0]
N = MN[1]
if N == 1:
  N = MN[0]
  M = MN[1]
if M == 1:
  if N == 1:
    c = 1
  elif N == 2:
    c = 0
  else:
    c = N - 2
else:
  c = (M - 2)*(N - 2)
print(c)

Buggy submission (verdict: Runtime Error):
def flip(B, m, n, M, N):
#  print(m,n)
  for mm in range(m-1,m+2):
    for nn in range(n-1,n+2):
#      print("mm=", mm, "nn=", nn)
      if 0<=mm and mm<M and 0<=nn and nn<N:
        if B[mm][nn] == 0:
          B[mm][nn] = 1
        else:
          B[mm][nn] = 0
#print(input().split())
MN=list(map(int, input().split()))
B = [[0 for i in range(MN[0])] for j in range(MN[1])]
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    flip(B, m, n, MN[0], MN[1])
c = 0
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    c += B[m][n]
#print(B)
print(c)

Buggy submission (verdict: Runtime Error):
def flip(B, m, n, M, N):
#  print(m,n)
  for mm in range(m-1,m+2):
    for nn in range(n-1,n+2):
      print("mm=", mm, "nn=", nn)
      if 0<=mm and mm<M and 0<=nn and nn<N:
        if B[mm][nn] == 0:
          B[mm][nn] = 1
        else:
          B[mm][nn] = 0
#print(input().split())
MN=list(map(int, input().split()))
B = [[0 for i in range(MN[0])] for j in range(MN[1])]
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    flip(B, m, n, MN[0], MN[1])
c = 0
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    c += B[m][n]
#print(B)
print(c)
Problem p03434 (python)

Fixed submission:
input()
a = list(map(int, input().split()))
a.sort(reverse=True)
print(sum(a[::2]) - sum(a[1::2]))

Buggy submission (verdict: Runtime Error):
input()
a = list(map(int, input().split()))
a.sort(reversed=True)
print(sum(a[::2]) - sum(a[1::2]))
Problem p03469 (python)

Fixed submission:
input_line1 = raw_input()
str_list = list(input_line1)
str_list[3]="8"
str_changed = "".join(str_list)
print(str_changed)

Buggy submission (verdict: Runtime Error):
N = input()
a = []
for i in range(N):
    a.append(input())
a= list(set(a))
a.sort()
print len(a)
Problem p03493 (python)

Fixed submission:
x = (input().count('1'))
print(x)

Buggy submission (verdict: Runtime Error):
x = (input().count(1))
print(x)

Buggy submission (verdict: Runtime Error):
x = int(input().count(1))
print(x)
Problem p03423 (python)

Fixed submission:
s = input()
print(int(s)//3)

Buggy submission (verdict: Runtime Error):
s = input()$
return int(s)//3$
Problem p03423 (python)

Fixed submission:
print(int(input())//3)

Buggy submission (verdict: Runtime Error):
n = int(input())
items = set(input().split())
results = {3: 'Three', 4: 'Four'}
if len(items) in results:
    print(results[len(items)])
Problem p03423 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
print (int(N/3))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
print int(N/3)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = input()
print (N/3)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = input()
print N/3
Problem p03423 (python)

Fixed submission:
x = int(input())
y = int(x/3)
print(y)

Buggy submission (verdict: Runtime Error):
int x
raw_input(x)
int y = x%3
print(y)
Problem p03633 (python)

Fixed submission:
N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
def gcd(a,b):
    if b>a:
        a,b=b,a
    while b>0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
T=[]
for i in range(N):
    T.append(int(input()))
import math
def lcm(a,b):
    return a*b//math.gcd(a,b)
if N==1:
    print(T[0])
elif N==2:
    print(lcm(T[0],T[1]))
else:
    l=[T[0]]
    for i in range(N-1):
      l.append(lcm(l[i],T[i+1]))
    print(l[-1])
Problem p03680 (python)

Fixed submission:
N=int(input())
a=[int(input()) for i in range(N)]
b=[]
j=1
k=1
c=1
if 2 not in a:
    print(-1)
else:
    while j in range(1,N+1):
         c += 1
         if a[k-1]==1:
                 print(-1)
                 break
         elif a[k-1]==2:
                 print(c-1)
                 break
         else:
            j += 1
            k = a[k-1]
    if c>=(N+1):
        print(-1)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
b=[]
j=1
def c(j):
    if j==1:
        return 1
    else:
        return a[c(j-1)-1]
if 2 not in a:
    print(-1)
else:
    while j in range(1,N+1):
      if a[c(j)-1] not in b:
         b.append(a[c(j)-1])
         if a[c(j)-1]==2:
            break
         else:
            j += 1 
      else:
          break
    if 2 not in b:
        print(-1)
    else:
        print(len(b))

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
b=[]
j=1
def c(j):
    if j==1:
        return 1
    else:
        return a[c(j-1)-1]
if 2 not in a:
    print(-1)
else:
    while a[c(j)-1] not in b:
        b.append(a[c(j)-1])
        if a[c(j)-1]==2:
            break
        else:
            j += 1
    if 2 not in b:
        print(-1)
    else:
        print(len(b))

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
b=[]
def c(j):
    if j==1:
        return 1
    else:
        return a[c(j-1)-1]
j=1
if 2 not in a:
    print(-1)
else:
    while a[c(j)-1] not in b:
        b.append(a[c(j)-1])
        j += 1
    if 2 not in b:
        print(-1)
    else:
        print(b.index(2)+1)
Problem p03844 (python)

Fixed submission:
A, op, B = map(str,input().split())
if op == "+" :
   print(int(A) + int(B))
else :
   print(int(A) - int(B))

Buggy submission (verdict: Runtime Error):
A, op, B = input().split()
if op == "+" :
   input (int(A) + int(B))
if op == "-" :
   input (int(A) - int(B))
input()
Problem p03423 (python)

Fixed submission:
ip = int(input())

ans = ip / 3
print(int(ans))

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

ans = ip / 3
print(int(ans))
Problem p03423 (python)

Fixed submission:
def main():
    N = int(input().strip())
    ret = N // 3
    return ret
if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
def main():
    N = input()
    S = input().strip().split()

    if len(set(S)) == 3:
        return 'Three'
    else:
        return 'Four'
    
if __name__ == '__main__':
    print(main())
Problem p03423 (python)

Fixed submission:
N = int(input())
print(N/3)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
print(N/3)

Buggy submission (verdict: Runtime Error):
import sys

N=sys.argv[0]
print(int(N/3)
Problem p03424 (python)

Fixed submission:
import sys



N=raw_input()
te=raw_input()

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")

Buggy submission (verdict: Runtime Error):
import sys

#N=sys.argv[1]
#te=sys.argv[2:]

N=raw_input()
te=raw_input()

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")

Buggy submission (verdict: Runtime Error):
import sys

N=sys.argv[1]
te=sys.argv[2:]

flaglist=[]
for i in range(len(te)):
    if te[i]=="P" or te[i]=="p":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="W" or te[i]=="w":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="G" or te[i]=="g":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
    if te[i]=="Y" or te[i]=="y":
        if te[i]  not in flaglist:
            flaglist.append(te[i])
            
if len(flaglist)==3:
    print("Three")
elif len(flaglist)==4:
    print("Four")
Problem p03423 (python)

Fixed submission:
print(int(int(input())/3))

Buggy submission (verdict: Runtime Error):
print(int(input()/3))
Problem p03423 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# 出力
print(int(a/3))

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

def comb1(n, r):
    if n == 0 or r == 0: return 1
    return comb1(n, r-1) * (n-r+1) / r

a = int(input())
# スペース区切りの整数の入力
m_members = []
a_members = []
r_members = []
c_members = []
h_members = []

for i in range(a):
    member = input()
    if(member[0:1] == 'M'):
        m_members.append(member)
    elif(member[0:1] == 'A'):
        a_members.append(member)
    elif(member[0:1] == 'R'):
        r_members.append(member)
    elif(member[0:1] == 'C'):
        c_members.append(member)
    elif(member[0:1] == 'H'):
        h_members.append(member)

member_info = []
count = 0
result = 0

if(len(m_members) != 0):
    member_info.append(len(m_members))
    count += 1
if(len(a_members) != 0):
    member_info.append(len(a_members))
    count += 1
if(len(r_members) != 0):
    member_info.append(len(r_members))
    count += 1
if(len(c_members) != 0):
    member_info.append(len(c_members))
    count += 1
if(len(h_members) != 0):
    member_info.append(len(h_members))
    count += 1

if(count >= 3):
    for i in (list(itertools.combinations(member_info, 3))):
        result += i[0] * i[1] * i[2]
    print(result)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
# スペース区切りの整数の入力
members = input().split()
a = []
count = 0

for member in members:
    if(member not in a):
        a.append(member)
        count += 1
if(count == 3):
    print("Three")
elif(count == 4):
    print("Four")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
# スペース区切りの整数の入力
members = input().split()
a = []
count = 0

for member in members:
    if(member not in a):
        a.append(member)
        count += 1
if(count == 3):
    print("Three")
elif(count == 4):
    print("Four")
Problem p03486 (python)

Fixed submission:
import sys


def main(s, t):
    s_ = ''
    for i in sorted(s):
        s_ += i

    t_ = ''
    for i in sorted(t, reverse=True):
        t_ += i

    if s_ < t_:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    _s = input()
    _t = input()
    ret = main(_s, _t)
    print(ret)

Buggy submission (verdict: Runtime Error):
import sys


def main(lines):
    s, t = lines.split('\n')

    s_ = ''
    for i in sorted(s):
        s_ += i

    t_ = ''
    for i in sorted(t, reverse=True):
        t_ += i

    if s_ < t_:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    lines_ = sys.stdin.readlines()
    ret = main(lines_)
    print(ret)
Problem p04030 (python)

Fixed submission:
a = input()

ret = ""
cnt = 0
for i in a:
    if i == "B":
        ret = ret[:-1:]
    else:
        ret += i
print(ret)

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

 ret = ""
 cnt = 0
 for i in a:
     if i == "B":
         ret = ret[:-1:]
     else:
         ret += i
 print(ret)
Problem p04043 (python)

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

if a == [5,5,7]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = ["" for i in range(N)]
for i in range(N):
    S[i] = input()

S.sort()
result = ""
for i in range(N):
    result += S[i]
print(result)
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = ["" for i in range(N)]
for i in range(N):
    S[i] = input()

S.sort()
result = ""
for i in range(N):
    result += S[i]
print(result)

Buggy submission (verdict: Runtime Error):
3 3
dxx
axx
cxx
Problem p03481 (python)

Fixed submission:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

print(cnt)

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

X, Y = map(int, raw_input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

print(cnt)

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

import math
X, Y = map(int, raw_input().split())
cnt = 0
num = X
while num <= Y:
    cnt += 1
    num = num*2

print(cnt)
Problem p03482 (python)

Fixed submission:
# -*- coding: utf-8 -*-

S = input()
n = len(S)
T = []

for i in range(len(S)-1):
    if S[i] != S[i+1]:
        t = max(i+1, n-i-1)
        T.append(t)
if len(T) == 0:
    print(n)
else:
    print(min(T))

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

S = input()
n = len(S)
T = []

for i in range(len(S)-1):
    if S[i] != S[i+1]:
        t = max(i+1, n-i-1)
        T.append(t)
print(min(T))
Problem p04043 (python)

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

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

if 7 == a[0]:
    if 5 == a[1] and 5 == a[2]:
        print("YES", end="\n")
    else:
        print("NO", end="\n")   

elif 5 == a[0]:
    if (7 == a[1] and 5 == a[2]) or (5 == a[1] and 7 == a[2]):
        print("YES", end="\n")
    else:
        print("NO", end="\n")   
else:
    print("NO", end="\n")

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

a=int(input())
b=int(input())
c=int(input())

if 7 == a:
    if 5 == b and 5 == c:
        print("YES", end="\n")
elif 5 == a:
    if (7 == b and 5 == c) or (5 == b and 7 == c):
        print("YES", end="\n")
else:
    print("NO", end="\n")

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

a=int(input())
b=int(input())
c=int(input())

if 7 == a:
    if 5 == b and 5 == c:
        print("YES", end="\n")
elif 5 == a:
    if (7 == b and 5 == c) or (5 == b and 7 == c):
        print("YES", end="\n")
else:
    print("NO", end="\n")

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

a=int(input())
b=int(input())
c=int(input())

if 7 == a:
    if 5 == b and 5 == c:
        print("YES")
elif 5 == a:
    if (7 == b and 5 == c) or (5 == b and 7 == c):
        print("YES")
else:
    print("NO")

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

a=int(input())
b=int(input())
c=int(input())

if 7 == a:
    if 5 == b and 5 == c:
        print("Yes")
elif 5 == a:
    if (7 == b and 5 == c) or (5 == b and 7 == c):
        print("Yes")
else:
    print("No")
Problem p03480 (python)

Fixed submission:
S = input()

N = len(S)
K = N
for i in range(1, N):
    if S[i-1] != S[i]:
        K = min(K, max(i, N-i))
print(K)

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

import math
N = len(S)
for i in range(math.ceil(N/2), N):
    if S[N-i:i] == '0'*(i-(N-i)) or S[N-i:i] == '1'*(i-(N-i)):
        K = i
print(K)
Problem p03488 (python)

Fixed submission:
s = input()
x, y = map(int, input().split())

fs = s.split('T')
f_num = [len(f) for f in fs]
dir_lst = [[], []]
for i in range(len(f_num)):
    dir_lst[i % 2].append(f_num[i])
x_lst = dir_lst[0]
x -= x_lst[0]
x_lst = x_lst[1:]
y_lst = dir_lst[1]

can_x = False
can_y = False

s = set([0])
for x_ in x_lst:
    s_ = set()
    for e in s:
        s_.add(e+x_)
        s_.add(e-x_)
    s = s_
if x in s:
    can_x = True

s = set([0])
for y_ in y_lst:
    s_ = set()
    for e in s:
        s_.add(e+y_)
        s_.add(e-y_)
    s = s_
if y in s:
    can_y = True

if can_x and can_y:
    print('Yes')
else:
    print('No')

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


def part_sum0(integer_list, target_sum,  i=0, sum_=0):
    if i == len(integer_list):
        return sum_ == target_sum
    if (part_sum0(integer_list, target_sum, i + 1, sum_)):
        return True
    if (part_sum0(integer_list, target_sum, i + 1, sum_ + integer_list[i])):
        return True
    return False


fs = s.split('T')
f_num = [len(f) for f in fs]
dir_lst = [[], []]
for i in range(len(f_num)):
    dir_lst[i % 2].append(f_num[i])
x_lst = dir_lst[0]
y_lst = dir_lst[1]

can_x = False
can_y = False

dx = abs(sum(x_lst)) - abs(x)
if (dx % 2 == 1) or (dx < 0):
    pass
elif dx == 0:
    can_x = True
else:
    if part_sum0(x_lst, dx // 2):
        can_x = True

if can_x:
    dy = abs(sum(y_lst)) - abs(y)
    if (dy % 2 == 1) or (dy < 0):
        pass
    elif dy == 0:
        can_y = True
    else:
        if part_sum0(y_lst, dy // 2):
            can_y = True

if can_y:
    print('Yes')
else:
    print('No')
Problem p03697 (python)

Fixed submission:
a,b = map(int, input().split())
print(a+b if a+b<10 else "error")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().Split())
print(a+b if a+b<10 else "error")

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

if (a + b) >= 10:
  print("error)
else:
  print(a + b)