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

Fixed submission:
if __name__=='__main__':
    in_src = input()
    in_str = in_src.split(' ')
    in_num = []
    for i in in_str:
        in_num.append(int(i))
    if in_num[0]%3==0:
        print('Possible')
    elif in_num[1]%3==0:
        print('Possible')
    elif (in_num[0]+in_num[1])%3==0:
        print('Possible')
    else:
        print('Impossible')

Buggy submission (verdict: Runtime Error):
if __name__=='__main__':
    alls = int(input())
    num_src = input().split(' ')
    num_cards = []
    ans = 0
    for i in num_src:
        num_cards.append(int(i))
        ans += abs(int(i))
    x = 0
    y = 0
    for i in range(0,alls-1):
        x=0
        y=0
        for j in range(0,alls):
            if j <= i:
                x += num_cards[j]
            else:
                y += num_cards[j]
        if y<x:
            tmp = abs(x-y)
        else:
            tmp = abs(y-x)
        if tmp < ans:
            ans = tmp
    print(ans)
Problem p03657 (python)

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

A, B = map(int, input().split())

C = A + B

if A%3 == 0:
    print('Possible')
elif B%3 == 0:
    print('Possible')
elif C%3 == 0:
    print('Possible')
else:
    print('Impossible')

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

A, B = map(int, input().split())

C = A + B

if A%3 == 0:
    print('Possible')
else if B%3 == 0:
    print('Possible')
else if C%3 == 0:
    print('Possible')
else:
    print('Impossible')
Problem p03658 (python)

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

N, K = map(int, input().split())
l = list(map(int, input().split()))

l.sort()
s = 0
for i in range(K):
    s += l[N-K+i]

print(s)

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

N, K = map(int, input().split())
l = list(map(int, input().split()))

l.sort()

X = range(K, -1, -1)

s = 0
for i in range(K, K-N+1, -1):
    s += l[i]

print(l, s, X)

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

N, K = map(int, input().split())
l = list()
for i in range(N):
    l.append( map( int, input().split() ) )

l.reverse()

for i in range(K)
    sum += a[i]

print(sum)
Problem p03697 (python)

Fixed submission:
#coding:utf-8

l = map(int, raw_input().split())

if l[0] + l[1] >= 10:
	print 'error'

else:
	print l[0] + l[1]

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

input_line1 = raw_input()
input_line2 = raw_input()

if input_line1 + input_line2 >= 10:
	print 'error'

else:
	print input_line1 + input_line2
Problem p03719 (python)

Fixed submission:
i = input().split()
if int(i[0]) <= int(i[2]) <= int(i[1]):
 print("Yes")
else:
 print("No")

Buggy submission (verdict: Runtime Error):
i = int(raw_input().split())
if i[0] <= i[2] <= i[1]:
 print("Yes")
else:
 print("No")

Buggy submission (verdict: Runtime Error):
i = raw_input().split()
if i[0] <= i[2] <= i[1]:
 print("Yes")
else:
 print("No")

Buggy submission (verdict: Runtime Error):
i = int(input().split())
if (i[0] <= i[2]) and (i[1] >= i[2]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
i = int(input().split())
if (i[0] <= i[2]) && (i[1] >= i[2]):
    print("Yes")
else:
    print("No")
Problem p03659 (python)

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

right_list=[] #右に進む
left_list=[] #左に進む
diff_list=[] #差分

right_list.append(l[0])
left_list.append(l[n-1])

for i in range(1,n):
    right_list.append(right_list[i-1]+l[i])
    left_list.append(left_list[i-1]+l[n-1-i])

left_list.reverse()

for i in range(0,n-1):
    diff_list.append(abs(right_list[i]-left_list[i+1]))

print(min(diff_list))

Buggy submission (verdict: Runtime Error):
right_list=[] #右に進む
left_list=[] #左に進む
diff_list=[] #差分

right_list.append(l[0])
left_list.append(l[n-1])

for i in range(1,n):
    right_list.append(right_list[i-1]+l[i])
    left_list.append(left_list[i-1]+l[n-1-i])

left_list.reverse()

for i in range(0,n-1):
    diff_list.append(abs(right_list[i]-left_list[i+1]))

print(min(diff_list))
Problem p04012 (python)

Fixed submission:
w=list(input())
YN=True
 
for i in w:
  if w.count(i)%2!=0:
    YN=False
    break
 
print("Yes" if YN else "No")

Buggy submission (verdict: Runtime Error):
w=input()
list=w.spilt()
YN="Yes"

for i in list:
  if w.count(i)%2!=0:
    YN="No"
    break

print(YN)
Problem p03684 (python)

Fixed submission:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
 
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
 
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
 
 
class UnionFind:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]
 
    def find(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self.find(self.table[x])
            return self.table[x]
 
    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            if self.table[s1] <= self.table[s2]:
                self.table[s1] += self.table[s2]
                self.table[s2] = s1
            else:
                self.table[s2] += self.table[s1]
                self.table[s1] = s2
            return True
        return False
 
    def subsetall(self):
        a = []
        for i in range(len(self.table)):
            if self.table[i] < 0:
                a.append((i, -self.table[i]))
        return a
 
def main():
    N = I()
    a = []
    b = []
    for i in range(N):
        x,y = LI()
        a.append((x,i))
        b.append((y,i))
    a.sort()
    b.sort()
    t = []
    for i in range(1,N):
        t.append((a[i][0]-a[i-1][0], a[i][1], a[i-1][1]))
        t.append((b[i][0]-b[i-1][0], b[i][1], b[i-1][1]))
    t.sort()
    r = 0
    uf = UnionFind(N)
    for c,d,e in t:
        if uf.union(d,e):
            r += c
 
    return r
 
print(main())

Buggy submission (verdict: Runtime Error):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

class UnionFind:
    def __init__(self, size):
        self.table = [-1 for _ in range(size)]

    def find(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self.find(self.table[x])
            return self.table[x]

    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 != s2:
            if self.table[s1] <= self.table[s2]:
                self.table[s1] += self.table[s2]
                self.table[s2] = s1
            else:
                self.table[s1] = s2
                self.table[s2] += self.table[s1]
            return True
        return False

N = ni()
a = []
b = []
for i in range(N):
    x, y = na()
    a.append((x, i))
    b.append((y, i))

a.sort()
b.sort()
t = []
for i in range(1, N):
    t.append((a[i][0]-a[i-1][0], a[i][1], a[i-1][1]))
    t.append((b[i][0]-b[i-1][0], b[i][1], b[i-1][1]))

t.sort()
ans = 0
uf = UnionFind(N)
for c, d, e in t:
    if uf.union(d,e):
        ans += c

print(ans)
Problem p03693 (python)

Fixed submission:
import sys

r, g, b = map(int, input().split())
if ((r*100+g*10+b)%4==0):
    print ("YES")
else:
    print ("NO")

Buggy submission (verdict: Runtime Error):
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
a = na()
f = [0]*8
sp = 0
for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1

print(sum(f))
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))
Problem p03661 (python)

Fixed submission:
N = int(input())
As = [int(x) for x in input().split()]
S = sum(As)

ans = None
subsum = 0
for i in range(1,N):
    subsum += As[i-1]
    temp = abs(2 * subsum - S)
    if ans is None or temp < ans:
        ans = temp
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
As = [int(x) for x in input().split()]
S = sum(As)

print(S)
for i in range(1,N):
    subs = sum(As[:i])
    temp = abs(2 * subs - S)
    if ans is None or temp < ans:
        ans = temp
print(ans)
Problem p03671 (python)

Fixed submission:
a, b, c = map(int, input().split())
li = [a,b,c]
li.sort()
print(li[0] + li[1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
print(" ".join(map(str, b)))
Problem p03666 (python)

Fixed submission:
import sys

def diff(N,A,B,C,D):
    mini = (B+(N-1)*D-A)/(C+D)
    for i in range(int(mini), N-1):
        lower_bound = A + i*C - (N-i-1)*D
        upper_bound = A + i*D - (N-i-1)*C
        #print(lower_bound, upper_bound)
        if lower_bound <= B and B <= upper_bound:
            return True
        elif B < lower_bound:
            return False

str = sys.stdin.readline().strip() #"491995 412925347 825318103 59999126 59999339"
N,A,B,C,D = map(int,str.strip().split(" "))
print("YES" if diff(N,A,B,C,D) else "NO")

Buggy submission (verdict: Runtime Error):
import sys

def diff(N,A,B,C,D):
    mini = (B+(N-1)*D-A)/(C+D)
    for i in xrange(mini, N-1):
        lower_bound = A + i*C - (N-i-1)*D
        upper_bound = A + i*D - (N-i-1)*C
        print(lower_bound, upper_bound)
        if lower_bound <= B and B <= upper_bound:
            return True
        elif B < lower_bound:
            return False

str = sys.stdin.readline().strip() #"491995 412925347 825318103 59999126 59999339"
N,A,B,C,D = map(int,str.strip().split(" "))
print("YES" if diff(N,A,B,C,D) else "NO")
Problem p03951 (python)

Fixed submission:
N = int(input())
s = input()
t = input()

k = 0
for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = input()
t = input()

for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)
Problem p03962 (python)

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

Buggy submission (verdict: Runtime Error):
s = {input() for i in range(3)}
N = len(s)
print(N)
Problem p04043 (python)

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

Buggy submission (verdict: Runtime Error):
s = input().split()
s5 = s.count("5")
s7 = s.count("7")

if s5 == 2:
  if s7 == 1:
    print("YES")
    else:
      print("NO")
else:
    print("NO")

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

Fixed submission:
s = input()

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = s[0:len(s)//2], s[len(s)//2:len(s)]
    if s1 == s2:
        print(len(s1)*2)
        break

    s = s[:-2]

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

s = s[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = zip(*[iter(s)]*2)
    if s1 is s2:
        print(s1)
        break

    s = s[:-2]

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

s = a[:-1]
if len(s) % 2 != 0:
    s = s[:-1]


while(True):
    s1, s2 = zip(*[iter(s)]*2)
    if s1 is s2:
        print(s1)
        break

    s = s[:-2]
Problem p03737 (python)

Fixed submission:
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]

Buggy submission (verdict: Runtime Error):
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]

Buggy submission (verdict: Runtime Error):
l = raw_input().split()
w1 =  l[0].upper()
w2 =  l[1].upper()
w3 =  l[2].upper()
print w1[:1] + w2[:1] + w3[:1]
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
	print "EQUAL"
elif A < B:
	print "LESS"
else:
	print "GREATER"

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
	print "GREATER"
elif A < B:
	print "LESS"
else:
	print "EQUAL"
Problem p03671 (python)

Fixed submission:
data=list(map(int,input().split()))
data.sort()
print(data[1]+data[0])

Buggy submission (verdict: Runtime Error):
b=10**9+7
num = [-1]*(n+1)
temp=1
temp2=1
for i in range(len(a)):
        if num[a[i]] != -1:
                p1,p2=num[a[i]],i
        num[a[i]]=i
for k in range(1,len(a)+1):
        if k == 1:
                print(n)
        
        elif k == len(a):
                print(1)
        else:
                for l in range(k): 
                        temp=temp*(n+1-l)/(k-l) 
                        if k-l-1 > 0: 
                                temp2=temp2*(n-p2+p1-l)/(k-l-1) 
                print(int((temp-temp2)%b)) 
                temp = 1        
                temp2 =1
Problem p03679 (python)

Fixed submission:
l = list(map(int, input().split()))
border = l[1] - l[2]
if border < 0:
    if l[0] >= abs(border):
        print("safe")
    else:
        print("dangerous")
else:
    print("delicious")

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
if l[1]+l[2] < l[0]:
    print("delicious")
else:
    if l[2]-l[1] <= l[0]:
        print("safe")
    else:
        print("dangerous")
c
Problem p03737 (python)

Fixed submission:
S = input()
out = ""
for s in S.split():
    out += s[0].upper()
print(out)

Buggy submission (verdict: Runtime Error):
import itertools

def sign(num):
    if num < 0:
        return -1
    elif num > 0:
        return 1
    else:
        return 0

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

signs = [-1,1]
a_sum = 0
changes_1 = 0
for i, a in enumerate(a_i):
    a_sum += a
    if sign(a_sum) != signs[i%2]:
        changes_1 += abs(a_sum) + 1
        a_sum = signs[i%2]

signs = [1,-1]
a_sum = 0
changes_2 = 0
for i, a in enumerate(a_i):
    a_sum += a
    if sign(a_sum) != signs[i%2]:
        changes_2 += abs(a_sum) + 1
        a_sum = signs[i%2]

print(min(changes_1,changes_2))

Buggy submission (verdict: Runtime Error):
import itertools

def sign(num):
    if num < 0:
        return -1
    elif num > 0:
        return 1
    else:
        return 0

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

# a_sum = [a_i[0]]
# for i, a in enumerate(a_i[1:]):
#     i += 1
#     a_sum.append(a_sum[-1]+a)
#
# signs = [1, -1]
# changes = 0
#
# for i, sum_i in enumerate(a_sum):
#     if sum_i != 0:
#         signs[i%2] = sign(sum_i)
#         signs[i%2+1] = -sign(sum_i)
#         break

signs = [sign(a_i[0]), -sign(a_i[0])]

a_sum = 0
changes = 0
for i, a in enumerate(a_i):
    a_sum += a
    if sign(a_sum) != signs[i%2]:
        changes += abs(a_sum) + 1
        a_sum = signs[i%2]
print(changes)

#
# for i, sum_i in enumerate(a_sum):
#     if i == 0:
#         signs = [sign(sum_i), -sign(sum_i)]
#     elif sign(sum_i) != signs[i%2]:
#         a_sum[i:] = [num + (abs(sum_i) + 1) * signs[i%2] for num in a_sum[i:]]
#         changes += abs(sum_i) + 1
#     # print(a_sum)
# print(changes)
Problem p03761 (python)

Fixed submission:
n = int(input())
alphabet_histgram = [[0 for _ in range(n)] for _ in range(26)]
ord_a = ord("a")

for i in range(n):
    S = input()
    for c in S:
        alphabet_histgram[ord(c) - ord_a][i] += 1

ret = ""
for i, hist_c in enumerate(alphabet_histgram):
    ret += chr(ord_a + i) * min(hist_c)

print(ret)

Buggy submission (verdict: Runtime Error):
n = int(input())
alphabet_histgram = [[0 for _ in range(n)] for _ in range(25)]
ord_a = ord("a")

for i in range(n):
    S = input()
    for c in S:
        alphabet_histgram[ord(c) - ord_a][i] += 1

ret = ""
for i, hist_c in enumerate(alphabet_histgram):
    ret += chr(ord_a + i) * min(hist_c)

print(ret)
Problem p03722 (python)

Fixed submission:
# Bellman-Ford
n, m = map(int, raw_input().split())
a, b, c = [], [], []
for i in xrange(m):
    at, bt, ct = map(int, raw_input().split())
    a.append(at - 1)
    b.append(bt - 1)
    c.append(ct)
# step1 : initialize
point = [-1e9 * m - 1] * n
point[0] = 0
# step2 : relaxation
for i in xrange(n+1):
    for j in xrange(m):
        if point[b[j]] < point[a[j]] + c[j]:
            point[b[j]] = point[a[j]] + c[j]
# step3 : check
looped = [False] * n
for i in xrange(n):
    for j in xrange(m):
        if point[b[j]] < point[a[j]] + c[j]:
            looped[b[j]] = True
        if looped[a[j]] == True:
            looped[b[j]] = True
if looped[n-1]:
    print("inf")
else:
    print(point[n-1])

Buggy submission (verdict: Runtime Error):
# Bellman-Ford
n, m = map(int, raw_bellman-input().split())
a, b, c = [], [], []
for i in xrange(m):
    at, bt, ct = map(int, raw_input().split())
    a.append(at - 1)
    b.append(bt - 1)
    c.append(ct)
# step1 : initialize
point = [-1e9 * m - 1] * n
point[0] = 0
pointl = [None] * n
# step2 : relaxation
for i in xrange(n-1):
    for j in xrange(m):
        if point[b[j]] < point[a[j]] + c[j]:
            point[b[j]] = point[a[j]] + c[j]
            pointl[b[j]] = a[j]
        print point
# step3 : check
flag = True
for j in xrange(m):
    if point[a[j]] + c[j] > point[b[j]]:
        flag = False
        break
if flag:
    print(point[n-1])
else:
    print("inf")
Problem p03970 (python)

Fixed submission:
s = raw_input()
st = "CODEFESTIVAL2016"
count = 0
for (sl, stl) in zip(s, st):
    if sl != stl:
        count += 1
print count

Buggy submission (verdict: Runtime Error):
w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(int(raw_input()))
for i in xrange(h):
    q.append(int(raw_input()))

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8)
q.append(10 ** 8)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost
Problem p03972 (python)

Fixed submission:
w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(int(raw_input()))
for i in xrange(h):
    q.append(int(raw_input()))

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8 + 1)
q.append(10 ** 8 + 1)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost

Buggy submission (verdict: Runtime Error):
w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(int(raw_input()))
for i in xrange(h):
    q.append(int(raw_input()))

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8)
q.append(10 ** 8)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost

Buggy submission (verdict: Runtime Error):
w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(raw_input())
p = map(int, p)
for i in xrange(h):
    q.append(raw_input())
q = map(int, q)

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8)
q.append(10 ** 8)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost

Buggy submission (verdict: Runtime Error):
# import time


w, h = map(int, raw_input().split())
p = []
q = []
for i in xrange(w):
    p.append(raw_input())
p = map(int, p)
for i in xrange(h):
    q.append(raw_input())
q = map(int, q)
start = time.time()

wl = w
hl = h

cost = 0

p.sort()
q.sort()

p.append(10 ** 8)
q.append(10 ** 8)

pc = 0
qc = 0

while(wl + hl - pc - qc> 0):
    if p[pc] < q[qc]:
        cost += (hl - qc + 1) * p[pc]
        pc += 1
    else:
        cost += (wl - pc + 1) * q[qc]
        qc += 1

print cost

# print time.time() - start
Problem p03759 (python)

Fixed submission:
l = list(map(int, input().split()))
 
a=l[0]
b=l[1]
c=l[2]
 
A=b-a
B=c-b
 
if A==B:
    print('YES')
else:
    print('NO')

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

a=l[0]
b=l[1]
c=l[2]

A=b-a
B=c-b

if A==B:
    print('Yes')
else:
    print('No')

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

a=l[0] # A
b=l[1] # B
c=l[2] # C

A=b-a
B=c-b

if A==B:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())
a=l[0] # A
b=l[1] # B
c=l[2] # C

A=b-a
B=c-b

if A==B:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())
a-l[0] # A
b=l[1] # B
c=l[2] # C

A=b-a
B=c-b

if A==B:
    print('Yes')
else:
    print('No')
Problem p03777 (python)

Fixed submission:
l = input().split()
A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')

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

A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')

Buggy submission (verdict: Runtime Error):
#l = raw_input().split()
A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')

Buggy submission (verdict: Runtime Error):
#l = map(str, raw_input().split())

A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')

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

A=l[0]
B=l[1]

if A=='H' and B=='H':
    print('H')

elif A=='H'and B=='D':
    print('D')

elif A=='D' and B=='H':
    print('D')
else:
    print('H')
Problem p03778 (python)

Fixed submission:
L = input().split()

w=int(L[0])
a=int(L[1])
b=int(L[2])

if a<b:
    if a+w<b:
        move=abs(a+w-b)
        print(move)
    else:
        print(int(0))

elif a>b:
    if b+w<a:
        m=abs(b+w-a)
        print(m)
    else:
        print(int(0))

else:
    print(int(0))

Buggy submission (verdict: Runtime Error):
l = input().split()

a=l[1]
b=l[2]

X=abs(a-b)
print(X)
Problem p03673 (python)

Fixed submission:
N = input()
a=(map(str, raw_input().split()))

odd=a[1::2]
even=a[0::2]

if N%2==0:
    print ' '.join(reversed(odd))+' '+' '.join(even)
else:
    print ' '.join(reversed(even))+' '+' '.join(odd)

Buggy submission (verdict: Runtime Error):
N = input()
a=(map(str, raw_input().split()))

odd=a[1::2]
even=a[0::2]

if N%2==0:
    print ' '.join(reversed(odd))+' '+' '.join(even)
else:
    print ' '.join(reversed(even))+' '+' '.join(odd)
~
Problem p03693 (python)

Fixed submission:
l = raw_input().split(" ")
num=int(l[0])*100+int(l[1])*10+int(l[2])

if num%4==0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
l = raw_input().split(" ")
num=int(l[0])*100+int(l[1])*10+int(l[2])

if num%4==0:
    print("YES")
else:
    print("NO")
Problem p04029 (python)

Fixed submission:
n = int(input())
print(sum(range(1,n+1)))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from operator import mul

n = int(input())
print(reduce(mul, map(range(1,n+1))))