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

Fixed submission:
name = input()
if name.startswith("YAKI"):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if S.startswith("YAKI"):
  return "Yes"
else:
  return "No"

Buggy submission (verdict: Runtime Error):
S
Problem p03992 (python)

Fixed submission:
t1 = input()
t2 = t1[:4] + " " + t1[4:] 
print(t2)

Buggy submission (verdict: Runtime Error):
t1 = input()
t2 = t1[:4] + " " + t2[4:] + "\n"
print(t2)
Problem p03591 (python)

Fixed submission:
s=str(input())
if s[:4]=="YAKI":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s=str(input())
if s[:4]==YAKI:
    print("yes")
else:
    print("no")
Problem p03591 (python)

Fixed submission:
N = list(input())
m = ""
if len(N)  > 3:
    m = N[0] + N[1] + N[2] + N[3]
if m == 'YAKI':
        print('Yes')
else:
        print('No')

Buggy submission (verdict: Runtime Error):
a = list(input())
b = ""
for i in range(4):
    b += a[i] 
if b == "YAKI":
    print('Yes')
else:
    print('No')
Problem p03623 (python)

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

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

if (abs(x - a) < abs(x - b)):
	print "A"
else:
	print "B"

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

N = input()
A = map(int, raw_input().split())
s = set()
dep = []

for i in A:
	if i in s:
		dep.append(i)
	s.add(i)

dep.sort()
dep.reverse()

if (len(dep) < 2):
	print 0
else:
	print dep[0] * dep[1]

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

N = input()
A = map(int, raw_input().split())
s = set()
dep = []

for i in A:
	if i in s:
		dep.append(i)
	s.add(i)

dep.sort()
dep.reverse()

if (len(dep) < 2):
	print 0
else:
	print dep[0] * dep[1]
Problem p03591 (python)

Fixed submission:
s=input()
if(len(s)>=4) :
	if(s[:4]=="YAKI"): 
		print("Yes")
	else : print("No")
else : print("No")

Buggy submission (verdict: Runtime Error):
s=input()
if(len(s)>=4)
if(s[:4]=="YAKI"): print("YES")
else : print("NO")
Problem p04006 (python)

Fixed submission:
N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
s_cost = a.copy()
cost = sum(s_cost)
for k in range(1,N):
    for i in range(N):
        if s_cost[i] > a[(i-k)%N] :
            s_cost[i] = a[(i-k)%N]
    if cost > k*x + sum(s_cost):
        cost = k*x + sum(s_cost)
    else:
        break

print(cost)

Buggy submission (verdict: Runtime Error):
def solve_():
    import itertools
    N, x = map(int, input().split())
    a = list(map(int, input().split()))
    s_cost = a.copy()
    cost = sum(s_cost)

    for k, i in itertools.product(range(1, N), range(N)):
        s_cost[i] = a[(i - k) % N] if s_cost > a[(i - k) % N] else s_cost[i]
        if i == N - 1 and cost > k*x + sum(s_cost):
            cost = k*x + sum(s_cost)
    
    print(cost)

solve()

Buggy submission (verdict: Runtime Error):
N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
s_cost = a
cost = sum(s_cost)
for k in xrange(0,N):
    s_cost = [min(s_cost[x],a[y]) for (x,y) in zip( list(xrange(N)), list(xrange(N-k,N))+list(xrange(N-k)) )]
    cost = min(cost, k*x + sum(s_cost))

print(cost)

Buggy submission (verdict: Runtime Error):
N, x = list(map(int, input().split()))
a = list(map(int, input().split()))
min_index = a.index(min(a))
index_list = list(range(min_index,N)) + list(range(min_index))
cost = a.copy()
c_count = [0]*N
for i in range(1,N):
    if cost[index_list[i]] => (cost[index_list[i-1]]+x):
        cost[index_list[i]] = cost[index_list[i-1]]+x
        c_count[index_list[i]] = c_count[index_list[i-1]]+1

print(sum(cost) - sum(c_count)*x + max(c_count)*x  )
Problem p04043 (python)

Fixed submission:
A,B,C = list(map(int, input().split()))
if A*B*C ==  175:
    print('YES')
else:
    print('NO')

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

b = []
for i in range(N):
    n = 0
    for j in range(L):
        n = (n*100) + ord( a[i][j])-96
    b.append(n)
ind = b.index(max(b))
print('%s' % str(a[ind]))
Problem p03591 (python)

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

from __future__ import division, print_function
import sys


def main():
    print("Yes" if sys.stdin.readline().strip().startswith("YAKI") else "No")


if __name__ == '__main__':
    main()

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

from __future__ import division, print_function
import sys


def main():
    h, w = map(int, sys.stdin.readline().strip().split(" "))
    aa = ""
    for _ in range(h):
        aa += sys.stdin.readline().strip()
    d = {}
    for c in aa:
        if c in d:
            d[c] += 1
        else:
            d[c] = 1

    # print(d)
    fours = 0
    evens = 0
    odds = 0

    for c, count in d.items():
        fours += count // 4
        evens += (count % 4) // 2
        odds += count % 2

    # print(fours, evens, odds)
    if h % 2 == 0 and w % 2 == 0:
        print("Yes" if odds == 0 and evens == 0 else "No")
    elif h % 2 == 0 and w % 2 == 1:
        print("Yes" if odds == 0 and evens * 2 == h else "No")
    elif h % 2 == 1 and w % 2 == 0:
        print("Yes" if odds == 0 and evens * 2 == w else "No")
    else:
        print("Yes" if odds == 1 and evens * 2 == w + h - 2 else "No")


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

Fixed submission:
import sys 
s = sys.stdin.readline().strip()
c_find = False                                                                                                                                                                                                                        
f_find = False
for c in s:
    if c_find:
        if c == 'F':
            print 'Yes'
            exit(0)
    else:
        if c == 'C':
            c_find = True
print 'No'

Buggy submission (verdict: Runtime Error):
import sys
s = sys.stdin.readline().strip()
c_find = Fasle
f_find = False
for c in s:
    if c_find:
        if c == 'F':
            print 'Yes'
            exit(0)
    else:
        if c == 'C':
            c_find = True
print 'No'

Buggy submission (verdict: Runtime Error):
import sys
def range_union(al,ah,bl,bh):
    cl = max(al,bl)
    ch = min(ah,bh)
    if cl > ch:
        return 0
    else:
        return ch-cl +1

N = int(sys.stdin.readline())
T = map(int,sys.stdin.readline().strip().split())
A = map(int,sys.stdin.readline().strip().split())

p = 1
for i in xrange(1,N-1):
    if T[i-1] < T[i]:
        Tl = T[i]
        Th = T[i]
    elif T[i-1] == T[i]:
        Tl = 1
        Th = T[i]
    else:
        p = 0
        break

    if A[i] > A[i+1]:
        Al = A[i]
        Ah = A[i]
    elif A[i+1] == A[i]:
        Al = 1
        Ah = A[i]
    else:
        p = 0
        break

    r = range_union(Tl,Th,Al,Ah)
    if not r:
        p = 0
        break
    else:
        p = p*r


print p % 1000000007

Buggy submission (verdict: Runtime Error):
import sys
def range_union(al,ah,bl,bh):
    cl = max(al,bl)
    ch = min(ah,bh)
    if cl > ch:
        return 0
    else:
        return ch-cl +1

N = int(sys.stdin.readline())
T = map(int,sys.stdin.readline().strip().split())
A = map(int,sys.stdin.readline().strip().split())

p = 1
for i in xrange(1,N-1):
    if T[i-1] < T[i]:
        Tl = T[i]
        Th = T[i]
    elif T[i-1] == T[i]:
        Tl = 1
        Th = T[i]
    else:
        p = 0
        break

    if A[i] > A[i+1]:
        Al = A[i]
        Ah = A[i]
    elif A[i+1] == A[i]:
        Al = 1
        Ah = A[i]
    else:
        p = 0
        break

    r = range_union(Tl,Th,Al,Ah)
    if not r:
        p = 0
        break
    else:
        p = p*r


print p % 1000000007
Problem p04011 (python)

Fixed submission:
import sys 

N = int(sys.stdin.readline())
K = int(sys.stdin.readline())
X = int(sys.stdin.readline())
Y = int(sys.stdin.readline())

#X* K + Y * (N-K)
# if N > K

#X * K
# if N < K

if N > K : 
    print X* K + Y *(N-K)
else:
    print X*N

Buggy submission (verdict: Runtime Error):
import sys 

N = sys.readline()
K = sys.readline()
X = sys.readline()
Y = sys.readline()

#X* K + Y * (N-K)
# if N > K

#X * K
# if N < K

if N > K : 
        print X* K + Y *(N-K)
else:
        print X*K
Problem p03993 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 19:10:57 2017

@author: taichiNakamura
"""

# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# スペース区切りの整数の入力
a = input().split()

a = list(map(int, a))

favorite = 0
for i,ai in enumerate(a):
    if a[ai-1] == (i+1):
        favorite += 1

print(favorite//2)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 19:10:57 2017

@author: taichiNakamura
"""

# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
# スペース区切りの整数の入力
a = map(int, input().split())

favorite = 0
for i,ai in enumerate(a):
    if a[ai-1] == (i+1):
        favorite += 1

print(favorite//2)
Problem p03597 (python)

Fixed submission:
def get_colored_cells():
    N = int(input())
    A = int(input())
    print(N ** 2 - A)

get_colored_cells()

Buggy submission (verdict: Runtime Error):
def get_colored_cells():
    N = input()
    A = input()
    return N ** 2 - A

get_colored_cells()

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
return N ** 2 - A

Buggy submission (verdict: Runtime Error):
N = input()
A = input()
print(N**2 - A)
Problem p03597 (python)

Fixed submission:
x, y = [int(input()) for i in range(2)]
print(x*x - y)

Buggy submission (verdict: Runtime Error):
x, y = int(input())
print((x*x)-y)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv

print(int(args[0])*int(args[0]) - int(args[1]))
Problem p03598 (python)

Fixed submission:
N = int(input())
K = int(input())
x = [int(i) for i in input().split()]

suml = [0] * N

for i in range(N):
  delta = abs(K-x[i])
  if x[i] < delta:
  	suml[i] = suml[i] + x[i]*2
  else:
  	suml[i] = suml[i] + delta*2

print(sum(suml))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
x = [int(i) for i in input().split()]

suml = [0] * 10

for i in range(N):
  delta = abs(K-x[i])
  if x[i] < delta:
  	suml[i] = suml[i] + x[i]*2
  else:
  	suml[i] = suml[i] + delta*2

print(sum(suml))
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())
print(N**2 - A)

Buggy submission (verdict: Runtime Error):
from itertools import product

A,B,C,D,E,F = map(int, input().split())
num_a = F // (100 * A)
num_b = F // (100 * B) 
num_c = int((F * E / (E + 100)) // C)
num_d = int((F * E / (E + 100)) // D)

def check_w(w_mizu, w_sato, F):
  return w_mizu + w_sato <= F

def check_tokeru(w_mizu, w_sato, E):
  return 100 * w_sato / (w_mizu + w_sato) <= 100 * E / (100 + E)

def culc_density(w_mizu, w_sato):
  return 100 * w_sato / (w_mizu + w_sato)

max = [0, 0, 0]  # total, sato, density
for _a, _b,  in product(range(num_a + 1), range(num_b + 1)): 
  w_mizu = (A * _a + B * _b) * 100
  if w_mizu == 0 or w_mizu >= F:
    continue
    
  for _c, _d in product(range(num_c + 1), range(num_d + 1)):
    w_sato = (C * _c + D * _d)
    if w_sato == 0 or w_sato >= F or (w_mizu + w_sato) > F:
      continue
    
    density = culc_density(w_mizu, w_sato)
  
    if check_w(w_mizu, w_sato, F) and check_tokeru(w_mizu, w_sato, E):
      if max[2] < density:
        max[0] = w_mizu + w_sato
        max[1] = w_sato
        max[2] = density

if max[0]:
  print(max[0], max[1])
else:
  print(F, 0)
Problem p03599 (python)

Fixed submission:
from itertools import product

A,B,C,D,E,F = map(int, input().split())
num_a = F // (100 * A)
num_b = F // (100 * B) 
num_c = int((F * E / (E + 100)) // C)
num_d = int((F * E / (E + 100)) // D)

def check_w(w_mizu, w_sato, F):
  return w_mizu + w_sato <= F

def check_tokeru(w_mizu, w_sato, E):
  return 100 * w_sato / (w_mizu + w_sato) <= 100 * E / (100 + E)

def culc_density(w_mizu, w_sato):
  return 100 * w_sato / (w_mizu + w_sato)

max = [100 * A, 0, 0]  # total, sato, density
for _a, _b,  in product(range(num_a + 1), range(num_b + 1)): 
  w_mizu = (A * _a + B * _b) * 100
  if w_mizu == 0 or w_mizu >= F:
    continue
    
  for _c, _d in product(range(num_c + 1), range(num_d + 1)):
    w_sato = (C * _c + D * _d)
    if w_sato == 0 or w_sato >= F or (w_mizu + w_sato) > F:
      continue
    
    density = culc_density(w_mizu, w_sato)
  
    if check_w(w_mizu, w_sato, F) and check_tokeru(w_mizu, w_sato, E):
      if max[2] < density:
        max[0] = w_mizu + w_sato
        max[1] = w_sato
        max[2] = density

if max[0]:
  print(max[0], max[1])

Buggy submission (verdict: Runtime Error):
from itertools import product

A,B,C,D,E,F = map(int, input().split())
num_a = F // (100 * A)
num_b = F // (100 * B) 
num_c = int((F * E / (E + 100)) // C)
num_d = int((F * E / (E + 100)) // D)

def check_w(w_mizu, w_sato, F):
  return w_mizu + w_sato <= F

def check_tokeru(w_mizu, w_sato, E):
  return 100 * w_sato / (w_mizu + w_sato) <= 100 * E / (100 + E)

def culc_density(w_mizu, w_sato):
  return 100 * w_sato / (w_mizu + w_sato)

max = [0, 0, 0]  # total, sato, density
for _a, _b,  in product(range(num_a + 1), range(num_b + 1)): 
  w_mizu = (A * _a + B * _b) * 100
  if w_mizu == 0 or w_mizu >= F:
    continue
    
  for _c, _d in product(range(num_c + 1), range(num_d + 1)):
    w_sato = (C * _c + D * _d)
    if w_sato == 0 or w_sato >= F or (w_mizu + w_sato) > F:
      continue
    
    density = culc_density(w_mizu, w_sato)
  
    if check_w(w_mizu, w_sato, F) and check_tokeru(w_mizu, w_sato, E):
      if max[2] < density:
        max[0] = w_mizu + w_sato
        max[1] = w_sato
        max[2] = density

if max[0]:
  print(max[0], max[1])
else:
  print(100*a, 0)
Problem p03737 (python)

Fixed submission:
import sys

if __name__ == '__main__':
    string = raw_input().split()

    for strLine in string:
        sys.stdout.write(strLine[0].upper())
    print

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':

    N = input()
    array = raw_input().split()

    ans = 0
    total = int(array[0])

    totalZero = False
    if total == 0:
        totalZero = True
    
    
    flag = False
    if total >= 0:
        flag = True
        
    for a in array[1:]:

        if totalZero == True:
            ans += 1
            if a > 0:
                total = -1
                flag = False
            else:
                total = 1
                flag = True
            totalZero = False
            
        total += int(a)
        
        if total > 0 and flag == True:
            ans += total + 1
            total = -1
                
        elif total < 0 and flag ==False:
            ans += -1 * total + 1
            total = 1
                          
        elif total == 0:
            totalZero = True

        if total > 0:
            flag = True
        elif total < 0:
            flag = False

        
    if totalZero == True:
        ans += 1

    print ans
Problem p03598 (python)

Fixed submission:
N = int(input())
K = int(input())
x = list(map(int, input().split()))
ans = 0
for n in range(N):
    if x[n] * 2 <= K:
        ans += x[n]*2
    else:
        ans += (K - x[n])*2
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
ans = 0
for _ in range(N):
    x = int(input())
    if x*2 =< K:
        asn += x*2
    else:
        ans += (K - x)*2
print(ans)
Problem p03605 (python)

Fixed submission:
N = int(input())
if N+10 >= 100 or (N+1) % 10 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
paper = [0,0,0,0,0,0,0,0,0,0]
N = int(input())
for _ in range(N):
    number = int(input())
    paper[number] += 1
sum = 0
for x in range(10)
    if paper[x] % 2 == 1
        sum += 1
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input.())
if N+10 >= 100 or (N+1) % 10 == 0:
    print("Yes")
else:
    print("No")
Problem p03606 (python)

Fixed submission:
N = int(input())
seat = 0
for _ in range(N):
    l,r = map(int,input().split())
    seat += r - l + 1
print(seat)

Buggy submission (verdict: Runtime Error):
N = input()
seat = 100000
for _ in range(N):
    l,r = map(int,input().split())
     seat -= r - l + 1
print(seat)
Problem p03607 (python)

Fixed submission:
N = int(input())
set = set([])
for _ in range(N):
    p = int(input())
    if p not in set:
        set.add(p)
    else:
        set.remove(p)
print(len(set))

Buggy submission (verdict: Runtime Error):
paper = [0,0,0,0,0,0,0,0,0,0]
N = int(input())
for _ in range(N):
    number = int(input())
    paper[number] += 1
sum = 0
for x in range(10):
    if paper[x] % 2 == 1:
        sum += 1
print(sum)

Buggy submission (verdict: Runtime Error):
paper = [0,0,0,0,0,0,0,0,0,0]
N = int(input())
for _ in range(N):
    number = int(input())
    paper[number] += 1
sum = 0
for x in range(10):
    if paper[x] % 2 == 1
        sum += 1
print(sum)

Buggy submission (verdict: Runtime Error):
paper = [0,0,0,0,0,0,0,0,0,0]
N = int(input())
for _ in range(N):
    number = int(input())
    paper[number] += 1
sum = 0
for x in range(10)
    if paper[x] % 2 == 1
        sum += 1
print(sum)
Problem p03633 (python)

Fixed submission:
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
def lcm(a, b):
	return a * b // gcd (a, b)
if N == 1:
    print(T[0])
else:
    result = lcm(T[0],T[1])

    for x in range(2,N):
        result = lcm(result, T[x])

    print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = []
for _ in range(N):
    T.append(int(input()))

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
def lcm(a, b):
	return a * b // gcd (a, b)

result = lcm(T[0],T[1])

for x in range(2,N):
    result = lcm(result, T[x])

print(result)
Problem p03635 (python)

Fixed submission:
n,m = map(int, raw_input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
num = input()
list = map(int, raw_input().split())
count1 = 0
count4 = 0
for x in list:
    if x % 2 == 1:
        count1 = count1 + 1
    if x % 4 == 0:
        count4 = count4 + 1
if count1 > count4 and num > 3 and count1 + count4 < num:
    print("No")
elif count1 > count4 + 1 and num > 3 and count1 + count4 == num:
    print("No")
elif num == 2 and count4 - count1 < 0:
    print("No")
elif num == 3 and count4 == 0 and count1 > 0:
    print("No") 
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
b,c = map(int, raw_input().split())
s = raw_input()
print a+b+c, " ", s
Problem p03637 (python)

Fixed submission:
num = input()
list = map(int, raw_input().split())
count1 = 0
count4 = 0
for x in list:
    if x % 2 == 1:
        count1 = count1 + 1
    if x % 4 == 0:
        count4 = count4 + 1
if count1 > count4 and num > 3 and count1 + count4 < num:
    print("No")
elif count1 > count4 + 1 and num > 3 and count1 + count4 == num:
    print("No")
elif num == 2 and count4 - count1 < 0:
    print("No")
elif num == 3 and count4 == 0 and count1 > 0:
    print("No") 
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
num = input()
list = map(int, raw_input().split())
count1 = 0
count4 = 0
for x in list:
    if x % 2 == 1:
        count1 = count1 + 1
    if x % 4 == 0:
        count4 = count4 + 1
if count1 > count4 and num > 3:
    print("No")
elif num = = 2 and count4 - count1 >= 0
    print("Yes")
elif num == 3 and count4 > 0 or count1 == 0
    print("Yes") 
else:
    print("Yes")
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
st=list(map(int,input().split()))
len=0
st.sort()
st.reverse()
for x in range(K):
    len=len+st[x]
print(len)
Problem p03598 (python)

Fixed submission:
N = int(input())
K = int(input())
X = list(map(int, input().split()))
Total_dist = 0

#iterate through number of bals
for i in range(N):
	dist = []
	for Rtype in ['A','B']:
		if Rtype == 'A':
			dist.append(abs(X[i] - 0)*2)
		if Rtype == 'B':
			dist.append(abs(X[i] - K)*2)
	Total_dist += min(dist)

print(Total_dist)

Buggy submission (verdict: Runtime Error):
Total_dist = 0

#iterate through number of bals
for i in range(N):
	for Rtype in ['A','B']:
		dist = []
		if Rtype == 'A':
			dist.append(abs(X[i] - 0))
		if Rtype == 'B':
			dist.append(abs(X[i] - K))
	Total_dist += min(dist)

print(Total_dist)

Buggy submission (verdict: Runtime Error):
#get inputs
N = int(input())
K = int(input())
X = map(int, input().split())
Total_dist = 0

#iterate through number of bals
for i in range(N):
	for Rtype in ['A','B']:
		dist = []
		if Rtype == 'A':
			dist.append(abs(X[i] - 0))
		if Rtype == 'B':
			dist.append(abs(X[i] - K))
	Total_dist += min(dist)

print(Total_dist)
Problem p03697 (python)

Fixed submission:
A,B = [int(i) for i in input().split()]
if A+B >= 10:
    print("error")
else:
    print(A+B)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))
X = sum(S)
while X%10 == 0 and X > 0:
    X -= min(S)
    S.remove(min(S))
print(X)
Problem p03759 (python)

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

raw = raw_input()
a = int(raw.split()[0])
b = int(raw.split()[1])
c = int(raw.split()[2])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'

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

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'

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

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'

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

import sys

a = int(sys.argv[1])
b = int(sys.argv[2])
c = int(sys.argv[3])

if (b - a) - (c - b) == 0:
    print 'YES'
else:
    print 'NO'
Problem p03605 (python)

Fixed submission:
N = input()
result = "No"
if N[0] == "9":
    result ="Yes"
if N[1] == "9":
    result = "Yes"
print (result)

Buggy submission (verdict: Runtime Error):
N = int(input())
list = []
for i in range(N):
    number = int(input())
    if number in list:
        list.remove(number)
        #print(list)
    else:
        list.append(number)
        #print(list)
print(len(list))
Problem p03607 (python)

Fixed submission:
N = int(input())
Result = set()
for i in range(N):
    number = int(input())
    if  number in Result:
        Result.remove(number)
    else:
        Result.add(number)
print(len(Result))

Buggy submission (verdict: Runtime Error):
N = int(input())
list = []
for i in range(N):
    number = int(input())
    if  number in list:
        list.append(number)
    else:
        list.remove(number)
print(len(list))
Problem p03609 (python)

Fixed submission:
#砂時計の砂X(秒)をセット #測った時間tをセット
X , t = map(int,input().split())
#残り時間を表示 (X - t)
#X > tのとき
if X > t:
    time = X - t
#X <= tのとき
else:
    time = 0
print(time)

Buggy submission (verdict: Runtime Error):
from collections import Counter
#Nをセットする
N = int(input())
#aiをセットする
a = list(map(int,input().split()))
a_mai = []
a_pura = []
#ai +- 1したものを作る
for i in range(len(a)):
    #+1したもの
    a_pura.append(a[i] + 1)
    #-1したもの
    a_mai.append(a[i] - 1)
#aiそのままの重複の数
count_a = Counter(a)
#ai + 1重複の数
count_a_pura = Counter(a_pura)
#ai - 1の中腹の数
counter_a_mai = Counter(a_mai)
#一番大きい要素を取得
max_a = count_a.most_common()[0][1]
max_a_pura = count_a_pura.most_common()[0][1]
max_a_mai = counter_a_mai.most_common()[0][1]

#3つの最大値を求める
max = max_a
if max_a_pura >= max:
    max = max_a_pura
if max_a_mai >= max:
    max = max_a_mai
print(max)