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

Fixed submission:
import math
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する

a_distant = a - x
b_distant = b - x
if a_distant < 0:
    a_distant = a_distant*(-1)
if b_distant < 0:
    b_distant = b_distant*(-1)
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
import math
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する
a_distant = math.sqrt((a - x)^2)
b_distant = math.sqrt((b - x)^2)
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
#x a bを設定する
x,a,b = map(int,input().split())
#x からaまでの距離とxからbまでの距離を計算する
a_distant = (a - x)^2
b_distant = (b - x)^2
#aまでとbまでを比較して短い方を出力する
if a_distant > b_distant:
    print("B")
if b_distant > a_distant
    print("A")
Problem p03657 (python)

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

Buggy submission (verdict: Runtime Error):
m, n = map(int, input().split())
M = list(map(int, input().split()))
M.sort()
M.reverse()
A = []
for i in range(n):
    A.append(M[i])
print(sum(A))
Problem p03671 (python)

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

#お店にあるベルは 3 種類で、それぞれ a円、 b円、 c円です。
#この 3 つのうち、異なる 2 つのベルを選んで買うときの、値段の合計の最小値を求めて下さい。

x = input().split()
#x = [700, 600, 780]

y =[int(x[0]), int(x[1]), int(x[2])]

z = sorted(y)

ans = z[0] + z[1]

print(ans)

Buggy submission (verdict: Runtime Error):
 a,b,c = map(int,raw_input().split())
 print(a+b+c-max(a,b,c))

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

Buggy submission (verdict: Runtime Error):
 a,b,c = map(int,raw_input().split())
print(min(a+b,b+c,a+c))

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

d = a + b
e = b  + c
f = a + c
print(min(d,e,f))
Problem p03605 (python)

Fixed submission:
N = str(input())

if '9' in N:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
import sys
from itertools import permutations
 
def read_int_list():
    return list(map(int, input().split()))
 
 
def main():
    def floyd_warshall():
        for k in range(n):
            for i in range(n):
                for j in range(n):
                    dd = d[i][k] + d[k][j]
                    if dd < d[i][j]:
                        d[i][j] = dd
 
    n, m, r = read_int_list()
    v = read_int_list()
    v = [x - 1 for x in v]
    d = [[float('inf')] * n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    for i in range(m):
        a, b, c = read_int_list()
        a -= 1
        b -= 1
        d[a][b] = c
        d[b][a] = c
    floyd_warshall()
    res = float('inf')
    for p in permutations(v):
        s = 0
        for i in range(r - 1):
            s += d[p[i]][p[i + 1]]
        if s < res:
            res = s
    print(res)
 
 
main()
Problem p03606 (python)

Fixed submission:
N = int(input())
ans = 0
for i in range(N):
	j,k = map(int,input().split())
	ans += k - j + 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
ans = 0
for i in range(N):
	j,k = map(int,input().split())
	ans += r - l + 1
print(ans)
Problem p03609 (python)

Fixed submission:
def hourglass():
    X, t = list(map(int, input().split(" ")))
    if X - t <= 0:
        print(0)
    else:
        print(X - t)
        
 
hourglass()

Buggy submission (verdict: Runtime Error):
def oddOut():

s = str(input())
print(s[::2])
        
 
pddOut()
Problem p03611 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
res = [0] * 100000
 
for i in a:
	res [i] += 1
	
print(max(map(sum,zip(res , res [1:], res [2:]))))

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

res = [0] * 100000

for i in a:
	list[i] += 1
	
print(max(map(sum,zip(list, list[1:], list[2:]))))
Problem p03600 (python)

Fixed submission:
import numpy as np
N = int(input())
A = [np.array(input().split(), dtype=np.int64) for _ in [0]*N]
inf = 10**10
for i in range(N):
    A[i][i] = inf
 
result = 0
for i in range(N-1):
    for j, d1 in enumerate(A[i][i+1:], start=i+1):
        d2 = np.min(A[i]+A[j])
        if d1 >= d2:
            if d1 > d2:
                print(-1)
                exit()
        else:
            result += d1
print(result)

Buggy submission (verdict: Runtime Error):
import numpy as np

def read_data():
    try:
        LOCAL_FLAG
        import codecs
        import os

        lines = []
        file_path = os.path.join(os.path.dirname(__file__), 'data.dat')
        with codecs.open(file_path, 'r', 'utf-8') as f:
            n_lines = int(f.readline())
            for i in range(n_lines):
                lines.append(f.readline().rstrip("\r\n"))

    except NameError:
        lines = []
        n_lines = int(input())
        for i in range(n_lines):
            lines.append(input())
    return lines



MAX = 10000000000

raw_data = read_data()
tarray = []
for each in raw_data:
    tarray.append(each.split())
A = np.array(tarray, dtype='int32')
B = np.zeros(A.shape, dtype='int32')

N = A.shape[0]

def distance2(i, j, done=[]):
    if(i == j):
        return 0

    min_dis = MAX
    min_index = -1
    for n in range(N):
        if((B[i][n] == 1)and(n not in done)and(n != j)):
            temp_dis = distance2(i, n, [i, j]) + distance2(n, j, [i, j])

            if(temp_dis < min_dis):
                min_index = n
                min_dis = temp_dis

    if(B[i][j] == 1)and(A[i][j] < min_dis):
        return A[i][j]
    else:
        return min_dis


def Restoring_Road_Network():

        # todo = list(range(N))
    min_dis_all = A[A.nonzero()].min()
    try:
        LOCAL_FLAG
        print("min value is", min_dis_all)
    except:
        pass

    for i in range(0, N):
        row = A[i]
        np.argmin(A[i])
        # print(row)
        min = MAX
        min_index = -1

        for j in range(0, N):
            if(row[j] == 0):
                continue
            elif(row[j] < min_dis_all*2):
                B[i][j] = 1
                B[j][i] = 1

            if(row[j] < min):
                min = row[j]
                min_index = j
        #
        # print(min)
        # print(min_index)
        B[i][min_index] = 1
        B[min_index][i] = 1


    distance_array = A*B
    not_available = False
    for i in range(N):
        for j in range(N):
            temp = distance2(i,j)
            # print(temp, " ", end='')
            if(temp != A[i][j]):
                not_available = True
        # print()

    try:
        LOCAL_FLAG
        print(B)
    except:
        pass

    if(not_available):
        print(-1)
    else:
        print(int(distance_array.sum(dtype=np.int64)/2))



# Sugar_water()
Restoring_Road_Network()
Problem p03609 (python)

Fixed submission:
import numpy as np
import sys
import itertools
import time

# # A - Sandglass2
# #
# #
def A_Sandglass2():
    try:
        LOCAL_FLAG
        X = 100
        t = 170
    except NameError:
        X, t = list(map(int, input().split()))

    R = X - t
    if R > 0:
        print(R)
    else:
        print("0")

start = time.time()
A_Sandglass2()
elapsed_time = time.time() - start
try:
    LOCAL_FLAG
    print ("elapsed_time: {0}".format(elapsed_time) + "[sec]")
except NameError:
    pass

Buggy submission (verdict: Runtime Error):
def A_Sandglass2():
    try:
        LOCAL_FLAG
        X = 100
        t = 170
    except NameError:
        X, t = list(map(int, input().split()))

    R = X - t
    if R > 0:
        print(R)
    else:
        print("0")

start = time.time()
A_Sandglass2()
elapsed_time = time.time() - start
try:
    LOCAL_FLAG
    print ("elapsed_time: {0}".format(elapsed_time) + "[sec]")
except NameError:
    pass
Problem p03597 (python)

Fixed submission:
N = int(input())
A = int(input())

print(N*N-A)

Buggy submission (verdict: Runtime Error):
N = input()
A = input()

print(N*N-A)

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

print ((n * n) - a)

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

print ((n * n) - a)

Buggy submission (verdict: Runtime Error):
N = input()
A = input()

print (str(N * N - A))

Buggy submission (verdict: Runtime Error):
N = input()
A = input()

print str(N * N - A)

Buggy submission (verdict: Runtime Error):
N = input()
A = input()

print (N * N - A)

Buggy submission (verdict: Runtime Error):
N = imput()
A = imput()

print (N * N - A)

Buggy submission (verdict: Runtime Error):
N = imput()
A = imput()

print (N * N - A)
Problem p03610 (python)

Fixed submission:
input_line1 = str(input())
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
print(p)

Buggy submission (verdict: Runtime Error):
input_line1 = raw_input()
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
print(p)

Buggy submission (verdict: Runtime Error):
input_line1 = raw_input()
c = 1
p = ""
for v in input_line1:
    if c == 1:
        p += v
        c = 0
    else:
        c += 1
Problem p03597 (python)

Fixed submission:
import sys

# utils
def read_numbers():
    return [int(num) for num in sys.stdin.readline().split()]
def read_string():
    return sys.stdin.readline().rstrip('\r\n')
def list2str(*array):
    return ' '.join([str(i) for i in array])

def main(N, A):
    return N*N - A

def parse_stdin():
    # N = read_numbers()
    # data = []
    # for i in range(N):
    #    data.append(read_numbers())
    N = read_numbers()[0]
    A = read_numbers()[0]
    return N, A

def test_main():
    """run pytest stdin.py to test"""
    #assert main([1,2], 'hi') == '3 hi'
    pass

if __name__ == '__main__':
    N, A = parse_stdin()
    result = main(N, A)
    print(result)

Buggy submission (verdict: Runtime Error):
import sys

# utils
def read_numbers():
    return [int(num) for num in sys.stdin.readline().split()]
def read_string():
    return sys.stdin.readline().rstrip('\r\n')
def list2str(*array):
    return ' '.join([str(i) for i in array])

def main(N, A):
    return N*N - A

def parse_stdin():
    # N = read_numbers()
    # data = []
    # for i in range(N):
    #    data.append(read_numbers())
    N = read_numbers()[0]
    A = read_numbers()[0]
    return N, A

def test_main():
    """run pytest stdin.py to test"""
    #assert main([1,2], 'hi') == '3 hi'
    pass

if __name__ == '__main__':
    N, A = parse_stdin()
    result = main(nums, line)
    print(result)
Problem p03693 (python)

Fixed submission:
x,y,z = map(int, input().split())
S = x * 100 + y * 10 + z
if S % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
B = set()
C = []
for i in A:
    if 1<= i <= 399:
        B.add("grey")
    elif 400 <= i <= 799:
        B.add("brown")
    elif 800 <= i <= 1199:
        B.add("green")
    elif 1200 <= i <= 1599:
        B.add("sky")
    elif 1600 <= i <= 1999:
        B.add("blue")
    elif 2000 <= i <= 2399:
        B.add("yellow")
    elif 2400 <= i <= 2700:
        B.add("orange")
    elif 2800 <= i <= 3199:
        B.add("red")
    else:
        C.append("X")

if C:
    S = len(B)
    if S == 0:
        S = 1
    T = len(B) + len (C)
    if T > 8:
        T = 8
    print(str(S) + " " + str(T))
else:
    print(str(len(B)) + " " + str(len(B)))
Problem p03697 (python)

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

Buggy submission (verdict: Runtime Error):
import heapq
N,A,B = map(int, input().split())
H = []
for i in range(N):
 heapq.heappush(H,  - int(input()))

cnt = 0
def atack(H):
 global cnt
 H = list(map(lambda x:x+B, H))
 h = heapq.heapreplace(H, H[0] + A - B)
 cnt += 1
 return H

while H[0] < 0:
 H = atack(H)

print(str(cnt))

Buggy submission (verdict: Runtime Error):
import heapq
N,A,B = map(int, input().split())
H = []
for i in range(N):
 heapq.heappush(H,  - int(input()))

cnt = 0
def atack(H):
 global cnt
 H = list(map(lambda x:x+B, H))
 h = heapq.heapreplace(H, H[0] + A - B)
 cnt += 1
 return H

while H[0] < 0:
 H = atack(H)

print(str(cnt))
Problem p03719 (python)

Fixed submission:
list = list(map(int, input().split()))
if list[2] >= list[0] and list[2] <= list[1]:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
# N,Mの把握
l = list(map(int, input().split()))
N = l[0]
M = l[1]

#list(map(str, input().split()))をM回くりかえし、１つのリストにまとめる。

c = []
for i in range(M):
	c = c + list(map(int, input().split()))

# リストを指定の番号で検索して、項目数を返す関数
def r(x):
	y = str(c.count(x))
	return y

#都市番号1からNまでリストを検索し、出力
dic = {}
for i in range(1,N+1):
	print(r(i))
Problem p03721 (python)

Fixed submission:
# N,Kの把握
l1 = list(map(int, input().split()))
N = l1[0]
K = l1[1]

#リストをすぐに作成するのが悪手。数値と回数をセット作成
dic = {}
for i in range(N):
	l2 = list(map(int, input().split()))
	a = l2[0]
	b = l2[1]
	if a in dic:
		dic[a] += b #既に存在する数値であればそのまま回数を＋
	else:
		dic.update({a: b}) #新規の数値であれば追加

dic = sorted(dic.items(), key=lambda x:x[0])

x = 0
for key, value in dic: #回数値を足していき、総回数＞＝Kとなったときの数値を出力する。
	x += value
	if x >= K:
		print(str(key))
		break

Buggy submission (verdict: Runtime Error):
# N,Kの把握
l1 = list(map(int, input().split()))
N = l1[0]
K = l1[1]

#空リストを作成。a,bを把握し、リストにaを追加、b回。これをN回くりかえし
l3 = []
for i in range(N):
	l2 = list(map(int, input().split()))
	a = l2[0]
	b = l2[1]
	if b <= K:
		for j in range(b):
			l3.append(a):
	else
		for j in range(K):
			l3.append(a)

# リストをソートし、K番目を出力
l3.sort()
print(str(l3[K-1]))
Problem p03731 (python)

Fixed submission:
#N,Tの取得
l = list(map(int, input().split()))
N = l[0]
T = l[1]

#秒のリストを取得
tl = list(map(int, input().split()))

sw = 0 #スイッチオンオフの管理
bt = 0 #直前のスイッチを押した時間
gt = 0 #秒数総和
for i, t in enumerate(tl):
    if sw == 1 and t - bt > T:
        sw = 0 #全快スイッチを押してからT秒経過していたら、スイッチオフ
    if sw == 0:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt  #スイッチがオンのとき、前回からの経過時間を加算
    bt = t
    sw = 1 #スイッチオン。
        

print(str(gt))

Buggy submission (verdict: Runtime Error):
#N,Tの取得
N,M = map(int, input().split())
#秒のリストを取得
tl = list(map(int, input().split()))

bt = 0 #直前のスイッチを押した時間
gt = T #秒数総和
for t in tl(1:):
    if t - bt > T:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt #スイッチがオンのとき、前回からの経過時間を加算
    bt = t

print(str(gt))

Buggy submission (verdict: Runtime Error):
#N,Tの取得
N,T = map(int, input().split()))

#秒のリストを取得
tl = list(map(int, input().split()))

bt = 0 #直前のスイッチを押した時間
gt = T #秒数総和
for t in tl(1:):
    if t - bt > T:
        gt += T #スイッチオフの時はT秒追加
    else:
        gt += t - bt #スイッチがオンのとき、前回からの経過時間を加算
    bt = t

print(str(gt))
Problem p03737 (python)

Fixed submission:
s1, s2, s3 =map(str, input().split())
print(s1[0].upper() + s2[0].upper() + s3[0].upper())

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:
 print("GREATER")
elif a==b:
 print("EQUAL")
else:
 print("LESS")
Problem p03671 (python)

Fixed submission:
x,y,z = map(int, input().split())
a = []
a.append(x)
a.append(y)
a.append(z)
a.sort()
print((a[0]+a[1]))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))
Problem p03673 (python)

Fixed submission:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Buggy submission (verdict: Runtime Error):
N = int(input())
char = input().split()
out = []
cnt = 0
while cnt <= N:
    out.append(char[x])
    out.reverse()
    cnt += 1
print(" ".join(out))
Problem p03601 (python)

Fixed submission:
# coding:utf-8

input=raw_input()
list=input.split(" ")
for i in range(len(list)):
    list[i]=int(list[i])

e=list[4]
f=list[5]

# 1 2 10 20 15 200
# 17 19 22 26 55 2802

# xが取り得る値
listx=[]
a=list[0]
b=list[1]

i=0
while True:
   if i*a*100>f:
       break
   j=0
   while True:
      x=i*a*100+j*b*100
      if x>f:
          break;
      if x==0:
          j+=1
          continue;
      if x not in listx:
          listx.append(int(x))
      j+=1 
   i+=1 

# yが取り得る値
listy=[]
c=list[2]
d=list[3]

# yが水に溶け切れる最大値
f2=f*e/(100.0+e)

i=0
while True:
   if i*c>f2:
       break
   j=0
   while True:
      y=i*c+j*d
      if y>f2:
          break;
      if y not in listy:
          listy.append(int(y))
      j+=1 
   i+=1 

# 全てのxとyの組み合わせについてfを超えないか、および溶け切れるかを調べる
lengthx=len(listx)
lengthy=len(listy)

xy_max=0
y_max=0
noudo_max=0

for i in range(lengthx):
    for j in range(lengthy):
        x=listx[i]
        y=listy[j]
        if x+y>f:
            continue
        if float(y)*100/float(x)<=e:
            noudo=float(y)/(x+y)
            if noudo>=noudo_max:
                xy_max=x+y
                y_max=y
                noudo_max=noudo

message=str(xy_max)+" "+str(y_max)
print message

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

input=raw_input()
list=input.split(" ")
for i in range(len(list)):
    list[i]=int(list[i])

f=list[5]

# xが取り得る値
listx=[]
a=list[0]
b=list[1]

i=0
while True:
   if i*a*100>f:
       break
   j=0
   while True:
      x=i*a*100+j*b*100
      if x > f:
          break;
      if x not in listx:
          listx.append(int(x))
      j+=1 
   i+=1 

# yが取り得る値
listy=[]
c=list[2]
d=list[3]

# yが水に溶け切れる最大値
f2=f*e/(100.0+e)

i=0
while True:
   if i*c>f2:
       break
   j=0
   while True:
      y=i*c+j*d
      if y > f:
          break;
      if y not in listy:
          listy.append(int(y))
      j+=1 
   i+=1 

# 全てのxとyの組み合わせについてfを超えないか、および溶け切れるかを調べる
lengthx=len(listx)
lengthy=len(listy)

xy_max=0
y_max=0
noudo_max=0
for i in range(lengthx):
    for j in range(lengthy):
        x=listx[i]
        y=listy[j]
        if x+y>f:
            continue
        noudo=float(y)/(x+y)
        if noudo>noudo_max:
            xy_max=x+y
            y_max=y
            noudo_max=noudo

print xy_max
print " "
print y_max
Problem p03683 (python)

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

mod=10**9+7

def kaijo(n):
    result=1
    for i in range(2,n+1):
        result*=i
        if result>mod:
            result=result%mod
    return result
    
def count(n,m):
    return kaijo(n)*kaijo(m)

if n-m==-1 or n-m==1:
    result=count(n,m)
    amari=result%mod
    print amari
elif n-m==0:
    result=count(n,m)
    result*=2
    amari=result%mod
    print amari
else:
    print 0

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

n,m=map(int,raw_input().split())

def kaijo(n):
    if n==1:
        return 1
    return n*kaijo(n-1)

# 引数として、nかmのうちの小さい方の数字を受け取る
def count(n,m):
    return kaijo(n)*kaijo(m)

if n-m==-1 or n-m==1:
    result=count(n,m)
    amari=result%(10**9+7)
    print amari
elif n-m==0:
    result=count(n,m)
    result*=2
    amari=result%(10**9+7)
    print amari
else:
    print "0"

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

n,m=map(int,raw_input().split())

def kaijo(n):
    if n==1:
        return 1
    return n*kaijo(n-1)

# 引数として、nかmのうちの小さい方の数字を受け取る
def count(n,m):
    return kaijo(n)*kaijo(m)

if n-m==-1 or n-m==1:
    result=count(n,m)
    print result
elif n-m==0:
    result=count(n,m)
    result*=2
    print result
else:
    print "0"

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

n,m=map(int,raw_input().split())

def kaijo(n):
    if n==1:
        return 1
    return n*kaijo(n-1)

# 引数として、nかmのうちの小さい方の数字を受け取る
def count(n,m):
    print kaijo(n)*kaijo(m)

if n-m==-1 or n-m==1:
    count=count(n,m)
elif n-m==0:
    count=count(n,m)
    count*=2
else:
    print "0"
Problem p03605 (python)

Fixed submission:
num=str(input())
 
char=list(num)
 
if char[0]=="9":
	print("Yes")
elif char[1]=="9":
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
num=str(input())

char=list(num)

if char[0]=="9":
	print("Yes")
elif char[1]=="9":
	print("Yes"))
else:
	print("No")
Problem p04011 (python)

Fixed submission:
hotel=int(input())
hotel2=int(input())
hotel3=int(input())
hotel4=int(input())

if hotel > hotel2:
	sum1=int(hotel2)*int(hotel3)
	hotel5=int(hotel)-int(hotel2)
	sum2=int(hotel5)*int(hotel4)
	fee=int(sum1)+int(sum2)
else:
  fee=int(hotel)*int(hotel3)
 
print(str(fee))

Buggy submission (verdict: Runtime Error):
hotel=int(input())
hotel2=int(input())
hotel3=int(input())
hotel4=int(input())

sum1=int(hotel)*int(hotel2)
sum2=int(hotel39*int(hotel4)
fee=int(sum1)+int(sum1)

print(str(fee))
Problem p03632 (python)

Fixed submission:
s = input().split()
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])

if c>=b or d<=a:
    print(0)
else:
    if a<=c and b<=d:
        print(b-c)
    elif a<=c and b>d:
        print(d-c)
    elif a>c and b<=d:
        print(b-a)
    else:
        print(d-a)

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

if c>=b or d<=a:
    print(0)
else:
    if a<=c and b<=d:
        print(b-c)
    elif a<=c and b>d:
        print(d-c)
    elif a>c and b<=d:
        print(b-a)
    else:
        print(d-a)

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

if c>=b or d<=a:
    print(0)
else:
    if a<=c and b<=d:
        print(b-c)
    elif a<=c and b>d:
        print(d-c)
    elif a>c and b<=d:
        print(b-a)
    else:
        print(d-a)
Problem p03605 (python)

Fixed submission:
n = input()
found = 0
for i in n:
        if i == "9":
                print("Yes")
                found = 1
                break

if(not found):
        print("No")

Buggy submission (verdict: Runtime Error):
n = input()
found = 0
for i in n:
        if i == "9":
                print("Yes")
                found = 1
                break

if(!found):
        print("No")
Problem p03737 (python)

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

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

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

"""
a + b
a + c
b + c
"""

if(a + b == c):
    print("Yes")
elif(a + c == b):
    print("Yes")
elif(b + c == a):
    print("Yes")
else:
    print("No")

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

if((arr[0] + arr[1] + arr[2]) % 2 == 0):
    print("Yes")
else:
    print("No")

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

if((arr[0] + arr[1] + arr[2]) % 3 == 0):
    print("Yes")
else:
    print("No")
Problem p03605 (python)

Fixed submission:
N = int(input())
if int(N/10)==9:
    print("Yes")
elif int(((N-9)%10)) == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if int(N/10)==9:
        print("Yes")
    elif int(((N-9)%10)) == 0:
        print("Yes")
    else:
        print("No")
Problem p03605 (python)

Fixed submission:
a = int(input())
b = a // 10
c = a % 10

if b == 9 or c == 9 :
	print("Yes")
else :
	print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for i in range(N)]
n = N
for i in range(N-1):
	j = i + 1
	while j <= N-1:
		if a[i] != a[j]:
			j += 1
		else:
			n -= 2
			break		
print(n)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = a // 10
c = a % 10

if b == 9 or c == 9
 print("yes")
 else
  print("no")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = a // 10
c= a % 10

if b == 9 or c == 9
 print("Yes")
 else
  print("No")
Problem p03605 (python)

Fixed submission:
a=int(raw_input())
ichi_kurai=a/10
jyu_kurai=a%10

if ichi_kurai == 9 or jyu_kurai == 9:
    print "Yes"
else:
    print "No"

Buggy submission (verdict: Runtime Error):
import numpy as np
N=input()
x=[]
dict={}
for i in range(N):
    a=raw_input()
    if a in dict:
        dict[a]+=1
    else:
        dict[a]=1

print np.sum(np.array(dict.values())%2)