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

Fixed submission:
A,B = list(map(int,input().split()))
if A > B:
    tmp = A
    A = B
    B = tmp

if (B-A)%2 == 0:
    print(B-(B-A)//2)
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
def main():  
    S = list(input())
    S.pop()
    length=len(S)
    dp = [0]*13
    dp[0]=1
    mul=1
    mod=1000000007
    for i in range(1,length+1):
        next_dp = [0]*13
        for j in range(13):
            if S[length-i] == "?":
                for k in range(10):
                    j_sub=(j+k*mul)%13
                    next_dp[j_sub]+=dp[j]
                    next_dp[j_sub]%=mod
            else:
                j_sub=(j+int(S[length-i])*mul)%13
                next_dp[j_sub]+=dp[j]
                next_dp[j_sub]%=mod
        dp=next_dp
        mul=mul*10
    print(dp[5]%1000000007, "d")
if __name__ == "__main__":
    main()
Problem p02960 (python)

Fixed submission:
import sys
input = sys.stdin.readline
def main():  
    S = list(input())
    S.pop()
    length=len(S)
    dp = [0]*13
    dp[0]=1
    mul=1
    mod=1000000007
    for i in range(1,length+1):
        next_dp = [0]*13
        for j in range(13):
            if S[length-i] == "?":
                for k in range(10):
                    j_sub=(j+k*mul)%13
                    next_dp[j_sub]+=dp[j]
                    next_dp[j_sub]%=mod
            else:
                j_sub=(j+int(S[length-i])*mul)%13
                next_dp[j_sub]+=dp[j]
                next_dp[j_sub]%=mod
        dp=next_dp
        mul=mul*10%13
    print(dp[5]%1000000007)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
def main():  
    S = list(input())
    length=len(S)
    dp = [[0]*13 for _ in range(length)]
    dp[0][0]=1
    mul=1
    for i in range(1,length):
        for j in range(13):
            if dp[i-1][j] != 0:
                if S[length-i-1] == "?":
                    for k in range(10):
                        dp[i][(j+k*mul)%13]+=dp[i-1][j]
                else: 
                    dp[i][(j+S[length-i-1]*mul)%13]+=dp[i-1][j]
        mul=mul*10
    print(dp[length-1][5]%1000000007, "d")
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
    
S = list(input())
length=len(S)
dp = [[0 for _ in range(13)] for _ in range(length)]
dp[0][0]=1
for i in range(length-1):
    if S[length-i-2] == "?":
        for k in range(10):
            for j in range(13):
                j_sub = j-k*10**i%13
                if j_sub < 0: j_sub+= 13
                dp[i+1][j]+=dp[i][j_sub]
    else:
        for j in range(13):
            j_sub = j-int(S[length-i-2])*10**i%13
            if j_sub < 0: j_sub+= 13
            dp[i+1][j]+=dp[i][j_sub]
print(dp[length-1][5]%1000000007)
for j in range(13):
Problem p02972 (python)

Fixed submission:
import sys
input = sys.stdin.readline

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

b=[]
M = 0
count = [0 for _ in range(N+1)]
for i in reversed(range(1,N+1)):
    if count[i]%2 == a[i-1]: continue
    else:
        for j in range(1,int(i**0.5)+1):
            if i%j==0:
                count[j]+=1
                if j!=i//j:
                    count[i//j]+=1
        M+=1
        b.append(i)
print(M)
if M!=0:
    print(*b)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

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

b=[]
M = 0
count = [0 for _ in range(N)]
for i in reversed(range(1,N+1)):
    if count[i-1]%2 == a[i-1]: continue
    else:
        for j in range(1,int(i**0.5)+1):
            if i%j==0:
                count[j]+=1
                if j!=i//j:
                    count[i//j]+=1
        M+=1
        b.append(i)
print(M)
if M!=0:
    print(*b)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

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

b=[]
M = 0
count = [0 for _ in range(N)]
for i in reversed(range(1,N+1)):
    if count[i-1]%2 == a[i-1]: continue
    else:
        for j in range(1,int(i**0.5)+1):
            if i%j==0:
                count[j]+=1
                if j!=i//j:
                    count[i//j]+=1
        M+=1
        b.append(i)
print(M)
if M!=0:
    print(*b)
Problem p02995 (python)

Fixed submission:
import fractions
A,B,C,D = list(map(int, input().split()))
a=(A-1)//C
b=B//C
c=(A-1)//D
d=B//D
g = C*D//fractions.gcd(C,D)
e=(A-1)//(g)
f=B//(g)

print(B-A+1 - (b-a) - (d-c) + (f-e))

Buggy submission (verdict: Runtime Error):
import fanctions
A,B,C,D = list(map(int, input().split()))
a=(A-1)//C
b=B//C
c=(A-1)//D
d=B//D
g = C*D//fanctions.gcd(C,D)
e=(A-1)//(g)
f=B//(g)

print(B-A+1 - (b-a) - (d-c) + (f-e))

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = list(map(int, input().split()))
a=(A-1)//C
b=B//C
c=(A-1)//D
d=B//D
g = C*D//math.gcd(C,D)
e=(A-1)//(g)
f=B//(g)

print(B-A+1 - (b-a) - (d-c) + (f-e))
Problem p03044 (python)

Fixed submission:
import sys
input = sys.stdin.readline

sys.setrecursionlimit(1000000)

def main(): 

    N=int(input())
    to=[[] for _ in range(N+1)]
    ans=[0]*(N+1)

    for i in range(N-1):
        u,v,w=map(int,input().split())
        to[u].append([v,w])
        to[v].append([u,w])
    
    def dfs(chil, par):
        for v,l in to[chil]:
            if v == par: continue
            if (ans[chil] == 1 and l%2==0) or (ans[chil] == 0 and l%2==1):
                ans[v]=1
            dfs(v,chil)
    
    #ans[1] = 1
    dfs(1,-1)
    for i in ans[1:]:
        print(i)
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

import math

def main(): 

    N=int(input())
    to=[[] for _ in range(N+1)]
    ans=[0]*(N+1)

    for i in range(N-1):
        u,v,w=map(int,input().split())
        print(u,v,w)
        to[u].append([v,w])
        to[v].append([u,w])
    
    def dfs(chil, par):
        for v,l in to[chil]:
            if v == par: continue
            if (ans[chil] == 1 and l%2==0) or (ans[chil] == 0 and l%2==1):
                ans[v]=1
            dfs(v,chil)
    
    ans[1] = 1
    dfs(1,-1)
    print(*ans[1:])
if __name__ == "__main__":
    main()
Problem p03061 (python)

Fixed submission:
import sys
input = sys.stdin.readline
#import math
import fractions #fractions.gcd()
sys.setrecursionlimit(1000000)

def main(): 

    N = int(input())
    A = list(map(int,input().split()))
    A_gcd_for=[]
    A_gcd_for.append(A[0])
    A_gcd_af=[]
    A_gcd_af.append(A[-1])
    for i in range(1,N):
        A_gcd_for.append(fractions.gcd(A_gcd_for[-1], A[i]))
        A_gcd_af.append(fractions.gcd(A_gcd_af[-1], A[N-i-1]))
    ans=0
    for i in range(N):
        if i==0: a = A_gcd_af[N-i-2]
        elif i==N-1: a = A_gcd_for[i-1]
        else: a = fractions.gcd(A_gcd_for[i-1], A_gcd_af[N-i-2])
        if a > ans:
            ans=a
    print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import math

sys.setrecursionlimit(1000000)

def main(): 

    N = int(input())
    A = list(map(int,input().split()))
    A_gcd_for=[]
    A_gcd_for.append(A[0])
    A_gcd_af=[]
    A_gcd_af.append(A[-1])
    for i in range(1,N):
        A_gcd_for.append(math.gcd(A_gcd_for[-1], A[i]))
        A_gcd_af.append(math.gcd(A_gcd_af[-1], A[N-i-1]))
    ans=0
    for i in range(N):
        if i==0: a = A_gcd_af[N-i-2]
        elif i==N-1: a = A_gcd_for[i-1]
        else: a = math.gcd(A_gcd_for[i-1], A_gcd_af[N-i-2])
        if a > ans:
            ans=a
    print(ans)

if __name__ == "__main__":
    main()
Problem p03128 (python)

Fixed submission:
import sys
input = sys.stdin.readline

#import fractions #fractions.gcd() python~3.4
sys.setrecursionlimit(1000000)

N, M = map(int,input().split())
A = list(map(int, input().split()))
INF = 1e+10
def f(x):
    if x == 1:
        return 2
    if x == 2:
        return 5
    if x == 3:
        return 5
    if x == 4:
        return 4
    if x == 5:
        return 5
    if x == 6:
        return 6
    if x == 7:
        return 3
    if x == 8:
        return 7 
    if x == 9:
        return 6

A.sort(reverse=True)

dp=[-INF]*(N+1)
dp[0] = 0
for i in range(1,N+1):
    for j in range(M):
        if i-f(A[j]) >= 0:
            dp[i] = max(dp[i],dp[i-f(A[j])]+1)
 
ans = ""
remain = dp[N]
match = N

while match > 0:
    for i in range(M):
        if match - f(A[i]) >=0 and dp[match - f(A[i])] == remain - 1:
            ans += str(A[i])
            match -= f(A[i])
            remain -= 1
            
            break
            
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

#import fractions #fractions.gcd() python~3.4
sys.setrecursionlimit(1000000)

N, M = map(int,input().split())
A = list(map(int, input().split()))
INF = 1e+10
def f(x):
    if x == 1:
        return 2
    if x == 2:
        return 5
    if x == 3:
        return 5
    if x == 4:
        return 4
    if x == 5:
        return 5
    if x == 6:
        return 6
    if x == 7:
        return 3
    if x == 8:
        return 7 
    if x == 9:
        return 6

A.sort(reverse=True)

dp=[-INF]*(N+1)
dp[0] = 0
for i in range(1,N+1):
    for j in range(M):
        if i-f(A[j]) >= 0:
            dp[i] = max(dp[i],dp[i-f(A[j])]+1)
 
ans = ""
remain = dp[N]
match = N

while match > 0:
    for i in range(M):
        if dp[match - f(A[i])] == remain - 1:
            ans += str(A[i])
            match -= f(A[i])
            remain -= 1
            break
            
print(ans)
Problem p03166 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)

N,M=map(int,input().split())

to = [[]*(N+1) for _ in range(N+1)]
for i in range(M):
    x,y=map(int,input().split())
    to[x].append(y)

dp = [-1]*(N+1)

def saiki(v):
    if dp[v]!=-1: return dp[v]
    res = 0
    for u in to[v]:
        res=max(res,saiki(u)+1)
    dp[v]=res
    return res

ans=0
for i in range(1,N+1):
    ans = max(ans,saiki(i))
print(max(dp))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
xy = [list(map(int, input().split())) for _ in range(M)]
to = [[]*(N+1) for _ in range(N+1)]
for i in range(M):
    x,y=xy[i]
    to[x].append(y)

dp = [0]*(N+1)

def saiki(v):
    for u in to[v]:
        if dp[u] < dp[v]+1:
            dp[u]=dp[v]+1
            saiki(u)

count = [True]*(N+1)
count[0] = False
for i in range(M):
    count[xy[i][1]] = False

for i in range(1,N+1):
    if count[i]:
        saiki(i)
print(max(dp))
Problem p03239 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
INF = 100000
ans = INF
for i in range(N):
    if ct[i][1] > T: continue
    ans = min(ans,ct[i][0])
if ans == INF:
    ans="TLE"
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N, T = map(int,input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
ans = 10000
for i in range(N):
    if cn[i][1] > T: continue
    ans = min(ans,cn[i][0])
print(ans)
Problem p03262 (python)

Fixed submission:
import sys
input = sys.stdin.readline

import fractions

N,X=map(int,input().split())
x= list(map(int, input().split()))
x.append(X)
x.sort()
dis = []
for i in range(1, N+1):
    dis.append(x[i]-x[i-1])

tmp=dis[0]
for i in range(1,N):
    tmp = fractions.gcd(tmp,dis[i])
print(tmp)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

import math

N,X=map(int,input().split())
x= list(map(int, input().split()))
x.append(X)
x.sort()
dis = []
for i in range(1, N+1):
    dis.append(x[i]-x[i-1])

tmp=dis[0]
for i in range(1,N):
    tmp = math.gcd(tmp,dis[i])
print(tmp)
Problem p03361 (python)

Fixed submission:
row = list(map(int, input().split()))
s = [input().split() for i in range(row[0])]
for i in range(row[0]):
    s[i] = list(s[i][0])
dx = [0, -1, 1, 0]
dy = [-1, 0, 0, 1]
Flag = True
for i in range(row[0]):
    for j in range(row[1]):
        if s[i][j] == "#":
            flag = False
            for d in range(4):
                nx = i + dx[d]
                ny = j + dy[d]
                if 0 <= nx < row[0] and 0<= ny < row[1]:
                    if s[nx][ny] == "#":
                        flag = True
                        break
            if flag == False:
                Flag = False
                break
    if Flag == False:
        print("No")
        break
if Flag:
    print("Yes")

Buggy submission (verdict: Runtime Error):
row = list(map(int, input().split()))
s = [input().split() for i in range(row[0])]
for i in range(row[0]):
    s[i] = list(s[i][0])
dx = [0, -1, 1, 0]
dy = [-1, 0, 0, 1]
for i in range(row[0]):
    for j in range(row[1]):
        if s[i][j] == "#":
            Flag = False
            for d in range(4):
                nx = i + dx[d]
                ny = j + dy[d]
                if 0 <= nx < row[0] and 0<= ny < row[1]:
                    if s[nx][ny] == "#":
                        Flag = True
                        break
            if Flag != True:
                break
    if Flag != True:
        print("No")
        break
if Flag:
    print("Yes")
Problem p03436 (python)

Fixed submission:
from collections import deque
H,W = list(map(int, input().split()))
s = [input().split() for i in range(H)]
for i in range(H):
    s[i] = list(s[i][0])
black = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            black += 1
queue = deque([])
dist = [[-1 for i in range(W)] for j in range(H)]
dist[0][0] = 0
queue.append([0,0])
place_w = [0, 1, 0, -1]
place_h = [1, 0, -1, 0]
Flag = False
while len(queue) > 0:
    vh,vw = queue.popleft()
    for m in range(4):
        nvh = vh+place_h[m]
        nvw = vw+place_w[m]
        if 0<=nvh<H and 0<=nvw<W and dist[nvh][nvw] == -1 and s[nvh][nvw] == ".":
            queue.append([nvh,nvw])
            dist[nvh][nvw] = dist[vh][vw]+1
if dist[H-1][W-1] == -1:
    print(-1)
else:
    print(W*H-dist[H-1][W-1]-black-1)

Buggy submission (verdict: Runtime Error):
from collections import deque
H,W = list(map(int, input().split()))
s = [input().split() for i in range(H)]
for i in range(H):
    s[i] = list(s[i][0])
black = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            black += 1
queue = deque([])
dist = [[-1 for i in range(W)] for j in range(H)]
dist[0][0] = 0
queue.append([0,0])
place_w = [0, 1, 0, -1]
place_h = [1, 0, -1, 0]
Flag = False
while True:
    vh,vw = queue.popleft()
    for m in range(4):
        nvh = vh+place_h[m]
        nvw = vw+place_w[m]
        if 0<=nvh<H and 0<=nvw<W and dist[nvh][nvw] == -1 and s[nvh][nvw] == ".":
            queue.append([nvh,nvw])
            dist[nvh][nvw] = dist[vh][vw]+1
            if nvh == H-1 and nvw == W-1:
                Flag = True
                break
    if Flag:
        break
print(W*H-dist[H-1][W-1]-black-1)
Problem p03471 (python)

Fixed submission:
row = list(map(int, input().split()))
N = row[0]
Y = row[1]
Flag = 0
for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if Y == x*10000 + y*5000 + z*1000 and z >= 0:
            print(x, y, z)
            Flag = 1
            break
    if Flag == 1:
        break
if Flag == 0:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
ow = list(map(int, input().split()))
N = row[0]
Y = row[1]

order = []
order.append(int(Y/1e+4))
Y -= int(Y/1e+4) * 1e+4
order.append(int(Y/5e+3))
Y -= int(Y/5e+3) * 5e+3
order.append(int(Y/1e+3))
if sum(order) > N:
    print("-1 -1 -1")
else:
    print(order[0], order[1], order[2])
Problem p03729 (python)

Fixed submission:
import sys
input = sys.stdin.readline

A,B,C = input().split()
A=list(A)
B=list(B)
C=list(C)

if A[-1]==B[0] and B[-1]==C[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
row = list(map(int, input().split()))
Flag = False
for i in range(1000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")
Problem p02885 (python)

Fixed submission:
a,b= map(int,input().split())
c= a - b*2
if c > 0:
    print(c)
else:
    print (0)

Buggy submission (verdict: Runtime Error):
a,b= map(int,input().split())
c= a - b*2
if c > 0:
  print(c)
else:
  print 0
Problem p03060 (python)

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=0
for i in range(n):
    if v[i]>c[i]:
        a+=v[i]-c[i]
print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
print([v[i]-c[i] if v[i]-c[i]>0 for i in range(n)])
Problem p03085 (python)

Fixed submission:
b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print('C')

Buggy submission (verdict: Runtime Error):
b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print(C)

Buggy submission (verdict: Runtime Error):
b=input()
if b == 'A':
    print('T')
    elif b == 'T':
        print('A')
        elif b == 'C':
            print('G')
            else:
                print(C)
Problem p03210 (python)

Fixed submission:
n = int(input())
if n==3 or n==5 or n==7:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n==3 or n==5 or n==7:
Problem p03316 (python)

Fixed submission:
import sys

def solve(n):
    a = 0
    for s in str(n):
        a += int(s)
    if n%a == 0:
        return("Yes")
    else:
        return("No")

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a] = line.split(' ')
    return (int(str_a))

def main():
    a = readQuestion()
    answer = solve(a)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def solve(n):
    a = 0
    for s in str(n):
        a += int(s)
    if n%a == 0:
        return("Yes")
    else:
        return("No")

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a] = line.split(' ')
    return (int(str_a)

def main():
    a = readQuestion()
    answer = solve(a)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03474 (python)

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a,b,c):
    if len(c) == a+b+1:
        if  c.count("-")!=1:
            return "No"
        elif c[a]==("-"):
            return "Yes"
        else:
            return "No"
    else:
        return "No"
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve( lst_a, lst_b,n):
    if n.count("-")>=2:
        return "No"
    else:
        N,NN=n.split("-")
        if lst_a == len(N) and lst_b == len(NN):
            answer = "Yes"
        else:
            answer = "No"
    return answer
# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    [str_n, str_i] = line1.split(' ')
    line2 = sys.stdin.readline().rstrip()
    return (int(str_n), int(str_i), line2)

def main():
    n, i, s = readQuestion()
    answer = solve(n, i, s)
    print(answer)
    
if __name__ == '__main__':
    main()
Problem p03729 (python)

Fixed submission:
a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
##N T
#t1 t2 ... tN
N, T = map(int,input().split())
a = list(map(int, input().split()))
b = []
"""
for i in range(N):
    set1 = set()
    for j in range(T):
        set1.add(a[i] + j)
    b.append(set1)
d = set()
for n in range(len(b)):
    d = d | b[n]
"""
d = set()
for i in range(N):
    d = d | set(range(a[i], a[i] + T))


print(len(d))
Problem p03731 (python)

Fixed submission:
##N T
#t1 t2 ... tN
N, T = map(int,input().split())
a = list(map(int, input().split()))
b = []
zo  = [0, T]
leng = T
"""
d = set()
for i in range(N):
    d = d | set(range(a[i], a[i] + T))
"""
for i in range(N):
    if  a[i] + T <= zo[1]:
        pass
    elif a[i] <= zo[1] and zo[1] <= a[i] + T:
        leng += a[i] + T - zo[1]
        zo[1] = a[i] + T
    elif zo[1] <= a[i]:
        zo[0] = a[i]
        zo[1] = a[i] + T
        leng += T






print(leng)

Buggy submission (verdict: Runtime Error):
##N T
#t1 t2 ... tN
N, T = map(int,input().split())
a = list(map(int, input().split()))
b = []
"""
for i in range(N):
    set1 = set()
    for j in range(T):
        set1.add(a[i] + j)
    b.append(set1)
d = set()
for n in range(len(b)):
    d = d | b[n]
"""
d = set()
for i in xrange(N):
    d = d | set(xrange(a[i], a[i] + T))


print(len(d))
Problem p03737 (python)

Fixed submission:
a, b, c = input().split()
d = ""
d += a.upper()[0]
d += b.upper()[0] 
d += c.upper()[0]
print(d)

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
if abs(x-y)<=1:
    print("Brown")
else:
    print("Alice")

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
d = ""
d += a.upper()[0]
d += b.upper()[0] j
d += c.upper()[0]
print(d)
Problem p02885 (python)

Fixed submission:
import fileinput

def process(A, B):
    if A <= B*2:
        return 0
    else:
        return A - B*2

for line in fileinput.input():
    print(process(*map(int, line.split())))

Buggy submission (verdict: Runtime Error):
import fileinput

def process(A, B):
	if A <= B*2:
      return 0
    else:
      return A - B*2

for line in fileinput.input():
    print(process(map(int, line.split()))

Buggy submission (verdict: Runtime Error):
import fileinput

def process(A, B):
	if A =< B*2:
      return 0
    else:
      return A - B*2

for line in fileinput.input():
    print(process(map(int, line.split()))
Problem p02887 (python)

Fixed submission:
length = int(input())
li = list(input())
i = 0
for n in li[:]:
    if i + 1 == len(li):
        print(len(li))
        break
    if li[i] == li[i + 1]:
       del (li[i + 1])
    else:
        i = 1 + i
        continue

Buggy submission (verdict: Runtime Error):
N = int(input())
l = list(input())
h = []
for i, s in enumerate(l):
    if i + 1 == N:
        h.append(s)
        print(len(h))
    if s != l[i + 1]:
        h.append(s)

Buggy submission (verdict: Runtime Error):
length = int(input())
li = list(input())
li2 = []
i = 0
for str in li[:]:
    i = 1 + i
    if i + 1 == len(li):
        li2.append(li[i])
        print(len(li2))
        break
    if li[i] != li[i + 1]:
        li2.append(li[i])
        continue