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

Fixed submission:
S=list(input())
K=int(input())
SS=S*2
F=S[0]
if len(S)==1:
	P=int(K//2)
elif S==[F]*len(S):
	P=int((len(S))*K//2)
else:
	for G in range(1,len(S)):
		if S[G-1]==S[G]:
			S[G]="O"
		else:
			continue
	A=S.count("O")
	for J in range(1,len(SS)):
		if SS[J-1]==SS[J]:
			SS[J]="O"
		else:
			continue
	B=SS.count("O")
	P=A+(B-A)*(K-1)
print(P)

Buggy submission (verdict: Runtime Error):
S=list(input())
K=int(input())
SS=S*2
F=S[1]

if len(S)==1:
	P=int(K//2)
elif S==[F]*len(S):
	P=int((len(S))*K//2)
else:
	for G in range(1,len(S)):
		if S[G-1]==S[G]:
			S[G]="O"
		else:
			continue
	A=S.count("O")
	for J in range(1,len(SS)):
		if SS[J-1]==SS[J]:
			SS[J]="O"
		else:
			continue
	B=SS.count("O")
	P=A+(B-A)*(K-1)
print(P)

Buggy submission (verdict: Runtime Error):
S=list(input())
K=int(input())
#基本は文字列一単位内でひっくり返す×単位数ですが、文字列が一つの場合と文字列の両端が同じ場合を考慮してね。
P=0
if len(S)==1:
	P=K//2
else:
	for G in range(1,len(S):
		B=S[G-1]
		if S[G] in B:
			S[G]='O'
			P+=1
		else:
			continue
	P=P*K
	if S[0]==S[len(S)-1]:
		P+=K-1
print(P)
S=list(input())
K=int(input())
P=0
if len(S)==1:
	P=K//2
else:
	for G in range(1,len(S)):
		B=S[G-1]
		if S[G] in B:
			S[G]='O'
			P+=1
		else:
			continue
	P=P*K
	if S[0]==S[len(S)-1]:
		P+=K-1
print(P)

Buggy submission (verdict: Runtime Error):
S=list(input())
K=int(input())
#基本は文字列一単位内でひっくり返す×単位数ですが、文字列が一つの場合と文字列の両端が同じ場合を考慮してね。
P=0
if len(S)==1:
	P=K//2
else:
	for G in range(1,len(S):
		B=S[G-1]
		if S[G] in B:
			S[G]='O'
			P+=1
		else:
			continue
	P=P*K
	if S[0]==S[len(S)-1]:
		P+=K-1
print(P)
Problem p02793 (python)

Fixed submission:
from sys import stdin, stdout
 
ii = lambda: int(stdin.readline())
mi = lambda: map(int, stdin.readline().strip().split())
li = lambda: list(mi())

mod = int(1e9) + 7

def GCD(x, y): 
   while(y): 
       x, y = y, x % y 
   return x 

N = ii()
A = li()
lcm = A[0]
for i in range(1, len(A)):
	lcm = (lcm // GCD(lcm, A[i])) * A[i]

ans = 0
for i in range(0, len(A)):
	ans = (ans + (lcm // A[i]))

ans %= mod

print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
from math import gcd
 
ii = lambda: int(stdin.readline())
mi = lambda: map(int, stdin.readline().strip().split())
li = lambda: list(mi())

mod = int(1e9) + 7

N = ii()
A = li()
lcm = A[0]
for i in range(1, len(A)):
	lcm = (lcm // gcd(lcm, A[i])) * A[i]

ans = 0
for i in range(0, len(A)):
	ans = (ans + (lcm // A[i])) % mod

print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin, stdout
from math import gcd
 
ii = lambda: int(stdin.readline())
mi = lambda: map(int, stdin.readline().strip().split())
li = lambda: list(mi())

mod = int(1e9) + 7

N = ii()
A = li()
lcm = A[0]
for i in range(1, len(A)):
	lcm = (lcm // gcd(lcm, A[i])) * A[i]

ans = 0
for i in range(0, len(A)):
	ans = (ans + (lcm // A[i])) % mod

print(ans)
Problem p02627 (python)

Fixed submission:
s = input()

if(s.islower()):
    print("a")
elif(s.isupper()):
    print("A")

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

if(s.islower):
    print("a")
else:
    print("A")

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

if(s.islower):
    print("a")
else:
    print("A"
Problem p03208 (python)

Fixed submission:
N,K=map(int,raw_input().split())
P=[]
m=0;

for i in range(N):
  P.append(int(raw_input()))
  
P.sort()


print min(P[i+K-1]-P[i] for i in range(N-K+1))

Buggy submission (verdict: Runtime Error):
N,K=map(int,raw_input().split())
P=[]
minus=1000000
save=0

for i in range(N):
  P.append(raw_input())
  
P.sort();
K-=1;

for i in range(N):
  if i+K>N:
    break
  save=int(P[i+K])-int(P[i])
  if minus>save:
    minus=save
  
print minus
Problem p03327 (python)

Fixed submission:
i=int(input())
if i<1000:
  print('ABC')
else:
  print('ABD')

Buggy submission (verdict: Runtime Error):
i=input()
if i<1000:
  print('ABC')
else:
  print('ABD')
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

if a != 1 and b != 1:
    print(1)
elif a != 2 and b != 2:
    print(2)
else:
    print(3)

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

if a != 1 and b != 1:
    print(1)
elif a != 2 and b != 2:
    print(2)
else:
    print(3)

Buggy submission (verdict: Runtime Error):


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

if a != 1 and b != 1 :
    print(1)
elif a != 2 and b != 2 :
    print(2)
else :
    print(3)

Buggy submission (verdict: Runtime Error):
a,b  = map(int,input.split())
  
if a != 1 and b != 1 :
	print(1)
elif a != 2 and b != 2 :
	print(2)
else :
print(3)
Problem p02627 (python)

Fixed submission:
s=input()
if s.islower():
  print("a")
else:
  print("A")

Buggy submission (verdict: Runtime Error):
s=input()
if s.lowercase():
  print("A")
else:
  print("a")
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a > 3199:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
a = input()
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
Problem p02984 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
        if i % 2 == 0:
                ans += A[i]
        else:
                ans -= A[i]
tmp = []
tmp.append(ans)
for j in range(1,N + 1):
        tmp.append(A[j - 1] * 2 - tmp[j - 1])

for i in range(len(tmp) -1 ):
        print(tmp[i])

Buggy submission (verdict: Runtime Error):
5
3 8 7 5 5
Problem p03042 (python)

Fixed submission:
S = input()
S_bef = int(S[:2])
S_aft = int(S[-2:])

is_bef_yy = False
is_bef_mm = False
is_aft_yy = False
is_aft_mm = False

if S_bef >= 1 and S_bef <= 12:
    is_bef_mm = True
if S_bef >= 0:
    is_bef_yy = True
if S_aft >= 1 and S_aft <= 12:
    is_aft_mm = True
if S_aft >= 0:
    is_aft_yy = True

if is_bef_yy and is_bef_mm and is_aft_yy and is_aft_mm:
    print('AMBIGUOUS')
elif is_bef_yy and is_aft_mm:
    print('YYMM')
elif is_aft_yy and is_bef_mm:
    print('MMYY')
else:
    print('NA')

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

S = input()
S_bef = int(S[:2])
S_aft = int(S[-2:])

is_bef_yy = False
is_bef_mm = False
is_aft_yy = False
is_aft_mm = False

if S_bef >= 1 and S_bef <= 12:
    is_bef_mm = True
if S_bef >= 0:
    is_bef_yy = True
if S_aft >= 1 and S_aft <= 12:
    is_aft_mm = True
if S_aft >= 0:
    is_aft_yy = True

if is_bef_yy and is_bef_mm and is_aft_yy and is_aft_mm:
    print('AMBIGUOUS')
elif is_bef_yy and is_aft_mm:
    print('YYMM')
elif is_aft_yy and is_bef_mm:
    print('MMYY')
else:
    print('NA')
Problem p03075 (python)

Fixed submission:
antenas = [int(input()) for i in range(5)]
k = int(input())
if k == 0:
    print('Yay!')
    exit()
print('Yay!') if max(antenas) - min(antenas) <= k else print(':(')

Buggy submission (verdict: Runtime Error):
X = [list(map(int, input().split())) for i in range(5)]
k = int(input())
print('Yay!') if max(X) - min(X) >= k else print(':(')
Problem p03107 (python)

Fixed submission:
S = list(input())

zero_S = S.count('0')
one_S = S.count('1')

print(min(zero_S, one_S) * 2)

Buggy submission (verdict: Runtime Error):
S = list(input())
cnt = 0
i = 0
while True:
    if S[i] != S[i + 1]:
        del S[i:i+2]
        cnt += 1
        i = 0
        continue
    elif i + 2 == len(S):
        print(cnt * 2)
        exit()
    i += 1
Problem p03135 (python)

Fixed submission:
T,X = map(int, input().split())
print(T/X)

Buggy submission (verdict: Runtime Error):
T,X = map(int, input().split())
print(t/X)
Problem p03250 (python)

Fixed submission:
A,B,C = map(int, input().split())
print(max(A,B,C)*9+A+B+C)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
print(max(A,B,C)*9+sum(A,B,C))
Problem p02835 (python)

Fixed submission:
inp = input()
A = inp.split()
A1 = int(A[0])
A2 = int(A[1])
A3 = int(A[2])
if A1+A2+A3 > 21:
    print("bust ")
else:
    print("win ")

Buggy submission (verdict: Runtime Error):
in=input()
A=in.split()
A1=int(A[0])
A2=int(A[1])
A3=int(A[2])
if A1+A2+A3 > 21:
  print("bust ")
else:
  print("win ")
Problem p02659 (python)

Fixed submission:
A, B = [i for i in input().split(" ")]
B = B.replace(".","")
tmp = int(A) * int(B) // 100

print(tmp)

Buggy submission (verdict: Runtime Error):
A, B = [i for i in input()]
B = int(100 * float(B))
tmp = A * B
print(tmp // 100)
Problem p02627 (python)

Fixed submission:
a = input()
print('A' if a.isupper() else 'a')

Buggy submission (verdict: Runtime Error):
α　= input()
if α.isupper():
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
α　= input('input your favorite alpabet:')
if α.isupper():
    print('A')
elif α.islower:
    print('a')
Problem p02682 (python)

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


"""
print(a)
print(b)
print(c)
print(k)
"""
if a >= k:
    print(k)

elif (a + b) >= k:
    print(a)

else:
    print(a - (k - a - b))

Buggy submission (verdict: Runtime Error):
a, b, c, k = input().split(" ")

"""
print(a)
print(b)
print(c)
print(k)
"""
if a >= k:
    print(a)

elif (a + b) >= k:
    print(a)

else:
    print(a-c)
Problem p02699 (python)

Fixed submission:
s=input()
lis=s.split()
if int(lis[0])>int(lis[1]):
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):
s=input()
for i in map(int, s.split()):
    lis.append(i)
if lis[0]>lis[1]:
    print("safe")
else:
    print("unsafe")
Problem p02682 (python)

Fixed submission:
A,B,C,K = map(int,input().split())
ans=0
if A>=K:
    ans+=K
else:
    K=K-A
    if B>=K:
        ans+=A
    else:
        K=K-B
        ans=A-K
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
S=[]
S.extend([1]*A)
S.extend([0]*B)
S.extend([-1]*C)
print(sum(S[:K]))
Problem p03042 (python)

Fixed submission:
S=input()
s1=int(S[0:2])
s2=int(S[2:5])

if 1<=s1<=12:
    print("AMBIGUOUS" if 1<=s2<=12 else "MMYY")
else:
    print("YYMM" if 1<=s2<=12 else "NA")

Buggy submission (verdict: Runtime Error):
S=input()
s1=int(S[0:2])
s2=int(S[3:5])

if 1<=s1<=12 and (s2>12 or S2==0):
    print("MMYY")
elif (s1>12 or s1==0) and 1<=s2<=12:
    print("YYMM")
elif 1<=s1<=12 and 1<=s2<=12:
    print("AMBIGUOUS")
else:
    print("NA")
Problem p03805 (python)

Fixed submission:
from collections import deque

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

G=[[] for i in range(N+1)]

for i in range(M):
    n,m=map(int,input().split())
    G[n].append(m)
    G[m].append(n)

visited=[0]*(N+1)
ans=0
def dfs(now, num_visited=0):
    global ans
    visited[now] = 1
    num_visited+=1
    
    if num_visited==N:
        ans+=1
    
    for i in G[now]:
        next=i
        if visited[next]!=1:dfs(next,num_visited)

    visited[now] = 0

dfs(1)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

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

G=[[] for i in range(M+1)]

for i in range(M):
    n,m=map(int,input().split())
    G[n].append(m)
    G[m].append(n)

visited=[0]*(N+1)
ans=0
def dfs(now, num_visited=0):
    global ans
    visited[now] = 1
    num_visited+=1
    
    if num_visited==N:
        ans+=1
    
    for i in G[now]:
        next=i
        if visited[next]!=1:dfs(next,num_visited)
        
    visited[now] = 0

dfs(1)
print(ans)
Problem p03834 (python)

Fixed submission:
a,b,c = input().split(",")
print(a+" "+b+" "+c)

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
print(a+" "+b+" "+c)
Problem p02723 (python)

Fixed submission:
s=input()


if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")

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

n=list(s)

if n[2]==n[3] and n[4]==n[5]:
  print("Yes")
else:
  print("No")
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
ans = n*(n-1)//2 + m*(m-1)//2
print(ans)

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

num1=M*(M-1)*0.5
num2=N*(N-1)*0.5

print(num1+num2)

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

num1=M*(M-1)*0.5
num2=N*(N-1)*0.5

print(num1+num2)
Problem p02759 (python)

Fixed submission:
N=int(input())
import math
ans=math.ceil(N/2)
print(ans)

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

math.ceil(N)
Problem p02682 (python)

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

if a >= k:
  print(k)
else:
  if a + b >= k:
    print(a)
  else:
    print(2 * a + b - k)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
a = len(s)

if len(s) > 10 or len(s) < 1:
  print('no')
else:
  if t[0:a] != s:
    print('no')
  else:
    if len(t) == len(s) + 1:
      print('yes')

Buggy submission (verdict: Runtime Error):
def main():
  s = input()
  t = input()
  a = len(s)

  if len(s) > 10 or len(s) < 1:
    print('no')
  else:
    if t[0:a] != s:
      print('no')
    else:
      if len(t) == len(s) + 1:
        print('yes')

main()
Problem p02693 (python)

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy submission (verdict: Runtime Error):
k = int(input())
a,b = int(input().split())
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Buggy submission (verdict: Runtime Error):
x = input()
k = int(x[0,0])
a = int(x[1, 0])
b = int(x[1, 1])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split()
x = x.split(\n)
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split()
x = x.split('\n')
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split()
x = x.split('/')
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split()
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Buggy submission (verdict: Runtime Error):
x = input()
x = x.split()
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')
Problem p02699 (python)

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

if s<=w:
  print('unsafe')
else:
  print('safe')

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

if s<=w:
  print('unsafe')
else:
  print('safe')

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


if s<=w:
  print('unsafe')
else:
  print('safe')

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

if s<=w:
  print('unsafe')
else:
  print('safe')

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

if s<=w:
  print('unsafe')
else:
  print('safe')
Problem p02711 (python)

Fixed submission:
if "7" in input():
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = int(input())
if 7 in s:
  print('yes')
else:
  print('no')

Buggy submission (verdict: Runtime Error):
if 7 in int(input()):
  print('yes')
else:
  print('no')
Problem p02835 (python)

Fixed submission:
x = input()
x = x.split()
if int(x[0]) + int(x[1]) + int(x[2]) >=22:
 print('bust')
else:
 print('win')

Buggy submission (verdict: Runtime Error):
x = input()
a = x.sprit(' ')
if int(a[0]) + int(a[2]) + int(a[4]) >=22:
 print('bust')
else:
 print('win')

Buggy submission (verdict: Runtime Error):
x = input()
if int(x[0]) + int(x[2]) + int(x[4]) >=22:
 print('bust')
else:
 print('win')

Buggy submission (verdict: Runtime Error):
x = input()
if int(x[0]) + int(x[2]) + int(x[4]) >=22 ;
 print('bust')
else;
 print('win')
Problem p02627 (python)

Fixed submission:
letter = input()

if letter.isupper()==True:
  print('A')
else:
  print('a')

Buggy submission (verdict: Runtime Error):
letter = input()
  
if letter.isUpper()==True:
  print('A')
else:
  print('a')
Problem p02723 (python)

Fixed submission:
a,b,c,d,e,f=input()
if c==d and e==f:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,f=input().split()
if c==d and e==f:
  print("Yes")
else:
  print("No")
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
print(n//(a+b)*a+min(a,n%(a+b)))

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
print(n//(a+b)*a+min(a,n//%(a+b)))
Problem p02781 (python)

Fixed submission:
n=input()
k=int(input())
dp=[[[0]*(k+2) for _ in range(2)] for _ in range(len(n)+1)]
dp[0][0][0]=1
for i,c in enumerate(n):
	c=int(c)
	for f in range(2):
		for j in range(k+1):
			for l in range(10*f or c+1):
				dp[i+1][f or l<c][j+(l>0)]+=dp[i][f][j]
print(dp[-1][0][k]+dp[-1][1][k])

Buggy submission (verdict: Runtime Error):
n=input()
k=int(input())
dp=[[[0]*(k+2) for _ in range(2)] for _ in range(len(n)+1)]
dp[0][0][0]=1
for i,c in enumerate(n):
	for f in range(2):
		for j in range(k+1):
			for l in range(10 if f else int(c)+1):
				dp[i+1][f or l<c][j+(l>0)]+=dp[i][f][j]
print(dp[-1][0][k]+dp[-1][1][k])
Problem p02792 (python)

Fixed submission:
n=int(input())
l=[[0]*10for _ in range(10)]
for x in range(1,n+1):l[int(str(x)[0])][int(str(x)[-1])]+=1
print(sum(l[i][j]*l[j][i]for i in range(10)for j in range(10)))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[[0]*10for _ in range(10)]
for x in range(1,n+1):l[a=int(str(x)[0])][b=int(str(x)[-1])]+=1
print(sum(l[i][j]*l[j][i]for i in range(10)for j in range(10)))
Problem p02925 (python)

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

def f(g: list, deg: list):
	l = len(g)
	depth = [0] * l
	ret = []
	q = []
	for i, d in enumerate(deg):
		if not d:
			ret.append(i)
			q.append(i)
	while q:
		cur = q.pop(0)
		for nxt in g[cur]:
			deg[nxt] -= 1
			if not deg[nxt]:
				depth[nxt] = depth[cur] + 1
				ret.append(nxt)
				q.append(nxt)
	if l > len(ret):
		return False
	return max(depth)

def label(a, b, n):
	if a > b:
		a, b = b, a
	return (a - 1) * (2 * n - a) // 2 + b - a - 1


def main():
	n = int(input())
	g = [[] for _ in range(n * (n - 1) // 2)]
	deg = [0] * (n * (n - 1) // 2)
	for i in range(1, n + 1):
		l = list(map(int, input().split()))
		for x, y in zip(l, l[1:]):
			t = label(i, y, n)
			g[label(i, x, n)].append(t)
			deg[t] += 1
	depth = f(g, deg)
	if not depth:
		print(-1)
		exit()
	print(depth + 1)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
from itertools import accumulate

def main():
	input = sys.stdin.readline
	n = int(input())
	d = [list(accumulate(map(int, input().split()))) + [0] for _ in range(n)] + [[0] * (n + 1)]
	for j in range(n):
		for i in range(n - 1):
			d[i + 1][j] += d[i][j]

	def divisors(x):
		ret = []
		for i in range(1, x + 1):
			if i > n:break
			if x % i == 0 and x // i <= n:
				ret += [(i - 1, x // i - 1)]
		return ret

	ref = [0 if not divisors(z) else max(d[i + y][j + x] - d[i - 1][j + x] - d[i + y][j - 1] + d[i - 1][j - 1] for x, y in divisors(z) for i in range(n - y) for j in range(n - x)) for z in range(n * n + 1)]
	ref = list(accumulate(ref, max))
	print("\n".join(map(str, [ref[int(input())] for _ in range(int(input()))])))

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

Fixed submission:
n = int(input())
dli = list(map(int,input().split()))
dli.sort()
print(dli[n//2]-dli[(n-1)//2])

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

mod = 10**9 + 7
n,k = map(int,input().split())

def cmb(n,r,mod):
  if r==0 or n==r:return 1
  r = min(n-r,r)
  ue = reduce(mul, range(n, n-r, -1))
  shita = reduce(mul, range(1,r+1))
  return (ue//shita)%mod

for i in range(1,k+1):
  try:print(cmb(n-k+1,i,mod)*cmb(k-1,k-i,mod)%mod)
  except:print(0)
Problem p02990 (python)

Fixed submission:
from operator import mul
from functools import reduce

mod = 10**9 + 7
n,k = map(int,input().split())

def cmb(n,r,mod):
  if r==0 or n==r:return 1
  r = min(n-r,r)
  ue = reduce(mul, range(n, n-r, -1))
  shita = reduce(mul, range(1,r+1))
  return (ue//shita)%mod

for i in range(1,k+1):
  try:print(cmb(n-k+1,i,mod)*cmb(k-1,k-i,mod)%mod)
  except:print(0)

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

mod = 10**9 + 7
n,k = map(int,input().split())

def cmb(n,r,mod):
  if r==0 or n==r:return 1
  r = min(n-r,r)
  ue = reduce(mul, range(n, n-r, -1))
  shita = reduce(mul, range(1,r+1))
  return (ue//shita)%mod

for i in range(1,k+1):
  print(cmb(n-k+1,i,mod)*cmb(k-1,k-i,mod)%mod)

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

mod = 10**9 + 7
n,k = map(int,input().split())

def cmb(n,r,mod):
  if r==0 or n==r:return 1
  r = min(n-r,r)
  ue = reduce(mul, range(n, n-r, -1))
  shita = reduce(mul, range(1,r+1))
  return (ue//shita)%mod

for i in range(1,k+1):
  print(cmb(n-k+1,i,mod)*cmb(k-1,k-i,mod))
Problem p03011 (python)

Fixed submission:
p,q,r = map(int,input().split())
print(min([p+q,q+r,r+p]))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
mod = 10**9+7
dp1=0;dp2=1
for i in range(n):
	dp1,dp2=dp2,(dp1+dp2)*(not i+1 in a)
	if dp1==dp2==0:
		print(0);exit()
print(dp2%mod)

Buggy submission (verdict: Runtime Error):
p,q,r = map(int,input().split())
print(min[p+q,q+r,r+p])
Problem p03012 (python)

Fixed submission:
n = int(input())
wli = list(map(int,input().split()))
cand = []
for i in range(n-1):
  cand.append(abs(sum(wli[:i+1])-sum(wli[i+1:])))
print(min(cand))

Buggy submission (verdict: Runtime Error):
n=input()
w=sorted(list(map(int,input().split())))
s=sum(w)//2
for i,j in enumerate(w):
  s-=j
  if s<0:
    print(j-w[i-1]);break
  elif s==0:
    print(min(j-w[i-1],w[i+1]-j);break