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

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 8)

n, m = map(int, input().split())
MOD = 1000000007

traps = {}
for i in range(m):
    t = int(input())
    traps[t] = 1

mem = {}

def f(k):
    if k in mem:
        return mem[k]

    if k >= n:
        return 0
    if k == n - 1:
        return 1
    if k == n - 2:
        if n - 1 in traps:
            return 1
        else:
            return 2

    res = 0
    if k + 1 not in traps:
        res += f(k + 1)
    if k + 2 not in traps:
        res += f(k + 2)
    mem[k] = res

    return res % MOD

print(f(0))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
MOD = 1000000007

traps = {}
for i in range(m):
    t = int(input())
    traps[t] = 1

mem = {}

def f(k):
    if k in mem:
        return mem[k]

    if k >= n:
        return 0
    if k == n - 1:
        return 1
    if k == n - 2:
        if n - 1 in traps:
            return 1
        else:
            return 2

    res = 0
    if k + 1 not in traps:
        res += f(k + 1)
    if k + 2 not in traps:
        res += f(k + 2)
    mem[k] = res
    return res % MOD

print(f(0))
Problem p03803 (python)

Fixed submission:
a,b=map(int,input().split())
if a==1:a=14
if b==1:b=14
if a>b:
    print("Alice")
elif a==b:
    print("Draw")
else:
    print("Bob")

Buggy submission (verdict: Runtime Error):
a=(int(input())-2)%13
b=(int(input())-2)%13
print(["Draw","Bob","Alice"][((a==b)+1)*((a<b)-(b<a))])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:
    print("Alice")
elif a=b:
    print("Draw")
else:
    print("Bob")
Problem p03127 (python)

Fixed submission:
import fractions
from functools import reduce


def gcd(numbers):
    return reduce(fractions.gcd, numbers)

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

print(gcd(a))

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


def gcd(numbers):
    return reduce(fraction.gcd, numbers)

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

print(gcd(a))
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int,input().split()))
A.sort()
bc = []
for i in range(M):
    bc.append(list(map(int, input().split())))
bc.sort(key=lambda x:x[1], reverse=True)

ans = 0

BC = bc[0]
bc_i = 0
ans += sum(A)
for i in range(len(A)):
    
    if BC[1] > A[i]:
        ans += BC[1] - A[i]
        BC[0] -= 1
    
    if BC[0] == 0:
        if bc_i == len(bc) - 1:
            break
        else:
            bc_i += 1
            BC = bc[bc_i]
        
print(ans)

Buggy submission (verdict: Runtime Error):
def del_list(L, I):
    diff = 0
    
    for i in I[::-1]:
        diff += L[i]
        del L[i]
    return L, diff

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

A = list(map(int,input().split()))
A.sort()

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

bc.sort(key=lambda x:x[1], reverse=True)

ans = 0
for BC in bc:
    if BC[1] <= A[0]:
#        print('break')
        break
    
    indexes = [i for i, x in enumerate(A) if x < BC[1]]
    
#    print(indexes)
    if len(indexes) > BC[0]:
        A, diff = del_list(A, indexes[0:BC[0]])
        ans += BC[1] * BC[0]

#        del(A[indexes[0:BC[0]]])
    elif len(indexes) == BC[0]:
        A, diff = del_list(A, indexes)
        ans += BC[1] * BC[0]
#        del(A[indexes])
    elif len(indexes) <= BC[0]:
        A, diff = del_list(A, indexes)
        ans += BC[1] * len(indexes)
        
#    print(ans)
#    print(A)

ans += sum(A)
        
print(ans)
Problem p03127 (python)

Fixed submission:
from fractions import gcd

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

g = [0] * (N + 1)
for i in range(N):
    g[i+1] = gcd(g[i], A[i])

print(g[-1])

Buggy submission (verdict: Runtime Error):
import math

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

g = [0] * (N + 1)
for i in range(N):
    g[i+1] = math.gcd(g[i], A[i])

print(g[-1])

Buggy submission (verdict: Runtime Error):
import math

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

g = 0
for i in range(N):
    g = math.gcd(g, A[i])

print(g)

Buggy submission (verdict: Runtime Error):
import math

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

g = math.gcd(A[0], A[1])
for i in range(2, N):
    g = math.gcd(g, A[i])

print(g)
Problem p02987 (python)

Fixed submission:
s = input()

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] !=s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] !=s[2]:
    print('Yes')
else:
    print('No')

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

if s[0] == s[1] and s[2] == s[3] and s[0] ! = s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] ! =s[1]:
        print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] ! =s[2]:
    print('Yes')
else:
    print('No')
Problem p02987 (python)

Fixed submission:
s = input()
ss = list(s)

con = True
for i in ss:
  if ss.count(i) != 2:
    con = False
if con:
  print("Yes")
else:
  print("No")

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

con = True
for i in ss:
  con = False if ss.count(i) != 2 
  
  
if con:
  print("Yes")
else:
  print("No")
Problem p02987 (python)

Fixed submission:
S = input().strip()
listS = list(S)
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[0] != listS[2] and listS[1] != listS[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input().strip()
listS = list(S)
listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3] and listS[0] != listS[2] and l\
istS[1] != listS[3]:
    print("Yes")
else:
    print("No")
Problem p02987 (python)

Fixed submission:
s = input()

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')     
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('Yes')
else:
    print('No')

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

if len(set(s)) == 2 and s. count(s[0]) == 2:
    print('Yes')
 else:
     print('No')
Problem p02987 (python)

Fixed submission:
s = input()

if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[1]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
    print('Yes')
else:
    print('No')

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

if len(set(s)) == 2 and s.count(s[0)) == 2:
    print('Yes')
else:
    print('No')
Problem p02987 (python)

Fixed submission:
s=input()

if len(set(s))==2 and s.count(s[0])==2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
list_a=[]
if len(list_a) !=AABB:
  print('ok')
else:
  print('no')
Problem p02987 (python)

Fixed submission:
S = input()

if len(set(S)) == 2:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)

Buggy submission (verdict: Runtime Error):
if len(set(input()))==2:
  print('Yes')
else
  print('No')

Buggy submission (verdict: Runtime Error):
if len(set(input()))==2:
  print('Yes')
else
  print('No')

Buggy submission (verdict: Runtime Error):
if len(set(list(input())))==2:
  print('Yes')
else
  print('No')

Buggy submission (verdict: Runtime Error):
if set(list(input()))==2:
  print('Yes')
else
  print('No')

Buggy submission (verdict: Runtime Error):
if set(S) !== 2:
  print(No)
Problem p02989 (python)

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

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

l.sort()
print(l[n/2]-l[n/2-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))
 
L.sort()
 
target_num = int(N/2)
if L[target_num-1] = L[target_num]:
	ans = 0
else:
  	ans= L[target_num]-L[target_num-1]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = int(N/2)
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	print(0)
else:
  	print(L_sorted[target_num]-L_sorted[target_num-1]-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	print(0)
else:
  	print(L_sorted[target_num]-L_sorted[target_num-1])

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

L_sorted= L.sort()

target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]
	print(0)
else:
  	print(L_sorted[target_num]-L_sorted[target_num-1])
Problem p02990 (python)

Fixed submission:
def comb(n, r):
    if n == 0 or r == 0:
        return 1
    if n < r:
        return 0
    a = b = 1
    r = min(n-r, r)
    for i in range(n-r+1,n+1):
        a*=i
    for i in range(1,r+1):
        b*=i
    
    return a//b
 
N, K = map(int, input().split())
MOD = int(1e9)+7
 
for i in range(1, K+1):
    temp = comb(N-K+1, i) * comb(K-1, i-1)
    print(int(temp % MOD))

Buggy submission (verdict: Runtime Error):
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def tyou(n, r):
    return combinations_count(n + r - 1, r)


N,K=list(map(int,input().split()))
aka=N-K
for i in range(1,k+1):
    if(K-i>=0 and aka-(i-1)>=0):
        p=tyou(i,K-i)*tyou(i+1,aka-(i-1))
        ans=p%(10**9+7)
        print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def tyou(n, r):
    return combinations_count(n + r - 1, r)


N,K=list(map(int,input().split()))
r=N-K
for i in range(1,k+1):
    if(K-i>=0 and r-(i-1)>=0):
        p=tyou(i,K-i)*tyou(i+1,r-(i-1))
        ans=p%(10**9+7)
        print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def tyou(n, r):
    return combinations_count(n + r - 1, r)


n,k=list(map(int,input().split()))
r=n-k
for i in range(1,k+1):
    if(k-i>=0 and r-(i-1)>=0 and k>=i and r>=i-1):
        p=tyou(i,k-i)*tyou(i+1,r-(i-1))
        ans=p%(10**9+7)
        print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def tyou(n, r):
    return combinations_count(n + r - 1, r)


n,k=list(map(int,input().split()))
r=n-k
for i in range(1,k+1):
    if(k-i>=0 and r-(i-1)>=0):
        p=tyou(i,k-i)*tyou(i+1,r-(i-1))
        ans=p%(10**9+7)
        print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def tyou(n, r):
    return combinations_count(n + r - 1, r)


n,k=list(map(int,input().split()))
r=n-k
for i in range(1,k+1):
    if(k-i>=0 and r-(i-1)>=0):
        p=tyou(i,k-i)*tyou(i+1,r-(i-1))
        ans=p%(10**9+7)
        print(ans)
Problem p02987 (python)

Fixed submission:
S=input()
hantei=False
SS=sorted(S)
if(len(set(S))==2):
    if(SS[0]==SS[1] and SS[0]!=SS[2]):
        hantei=True
    else:
        hantei=False
else:
    hantei=False


if(hantei==True):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

S=input()
hantei=False
if(len(set(S))==2):
    if(SS[0]==SS[1] and SS[0]!=SS[2]):
        hantei=True
    else:
        hantei=False
else:
    hantei=False
SS=sorted(S)

if(hantei==True):
    print("Yes")
else:
    print("No")
Problem p02987 (python)

Fixed submission:
s = [n for n in input()];r = len(set(s)) == 2 and ((s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]));print("Yes" if r else "No")

Buggy submission (verdict: Runtime Error):
v = [n for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")

Buggy submission (verdict: Runtime Error):
v = [int(n) for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")
Problem p02987 (python)

Fixed submission:
y=input()
 
if y[0]==y[1] and y[2]==y[3]:
    if y[1]==y[2]:
        print("No")
    else:
        print("Yes")
elif y[0]==y[2] and y[1]==y[3]:
    if y[1]==y[2]:
        print("No")
    else:
        print("Yes")
elif y[0]==y[3] and y[1]==y[2]:
    if y[0]==y[2]:
        print("No")
    else:
        print("Yes")   
    
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
z = list(map(int,input().split()))
i = 1
num = 0
while i+1 < x:
    if z[i-1] < z[i] < z[i+1]:
        num += 1
    elif z[i+1] < z[i] < z[i-1]:
        num += 1
    i += 1
print(num)
Problem p02987 (python)

Fixed submission:
s=input()
d={}
for ss in s:
  d[ss]=0
for ss in s:
  d[ss]+=1
if len(d.keys())==2:
  f=True
  for k in d:
    if d[k]!=2:
      f=False
  if f :
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])
Problem p02989 (python)

Fixed submission:
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])

Buggy submission (verdict: Runtime Error):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[n/2]-s[n/2-1])
Problem p03774 (python)

Fixed submission:
N, M = map(int, input().split())
st = []
ch = []

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

for i in range(M):
    ch.append(list(map(int, input().split())))

for i in range(N):
    x = float('inf')
    c = 0
    
    for j in range(M):
        if abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1]) < x:
            x = abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1])
            c = j+1
    
    print(c)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
st = []
ch = []

for i in range(N):
    st.append([*map(int, input().split())])

for i in range(M):
    ch.append([*map(int, input().split())])

for i in range(N):
    x = float('inf')
    c = 0
    
    for j in range(M):
        if abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1]) < x:
            x = abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1])
            c = j+1
    
    print(c)
Problem p03315 (python)

Fixed submission:

S = input()
#print(S)
i = 0
for e in S:
    if e=="+":
        i=i+1
    if e=="-":
        i=i-1
print(i)

Buggy submission (verdict: Runtime Error):
S = input()
#print(S)
#i = 0
for e in S:
    if e=="+":
        i=+1
    else:
        i-=1
print(i)
Problem p02990 (python)

Fixed submission:
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    if n + 1 - k - i >= 0:
        print((C(i - 1, k - 1, mod) * C(i, n - k + 1, mod)) % mod)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    print((C(i - 1, k - 1, mod) * C(n - k - i + 1, n - k + 1, mod))%mod)

Buggy submission (verdict: Runtime Error):
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    print(C(i - 1, k - 1, mod) * C(n - k - i + 1, n - k + 1, mod))

Buggy submission (verdict: Runtime Error):
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    print(C(i - 1, k - 1, mod) * C(i, n - k + 1, mod))
Problem p02987 (python)

Fixed submission:
input_str = input()
items = set(list(input_str))
print('Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No')

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
  s = comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) / (factorial(n-k-i+1, exact=True) * factorial(i, exact=True)))
  print(int(s) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial

try:
  n, k = tuple(map(int, input().split(' ')))
  for i in range(1, k+1):
    print(comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) // (factorial(n-k-i+1, exact=True) * factorial(i, exact=True))) % (10 ** 9 + 7))
except Exception as e:
  print(e)

Buggy submission (verdict: Runtime Error):
input_str = input()
items = set(list(input_str)
return 'Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No'
Problem p02990 (python)

Fixed submission:
from scipy.misc import comb

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
    # 青玉k個をi個の群に分割する。これはk個の青玉の間のk-1箇所のいずれかからi-1個を選んで仕切りとすることで可能
    # これはk-1Ci-1
    # その上で、できたi個の群の前後i+1箇所に赤玉を埋めていく
    # はじめに、i個の群の内側であるi-1箇所には必ず1つ以上赤玉が存在しなければならないので、予めi-1個の赤玉を配置したものとみなす
    # 結局、n-k-(i-1)=n-k-i+1個の赤玉をi+1箇所のどこかにおいていくことと同値
    # これはn-k-i+1個の赤玉とi個の仕切りの並べ方であるので、(n-k+1)Ci
    # 以上より、求める答えはk-1Ci-1 * (n-k+1)Ci
    s = comb(k-1, i-1, exact=True) * comb(n-k+1, i, exact=True)
    print(int(s) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial

print(input())
print(comb(3, 1, exact=True))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial

print(input())
print(comb(3, 1, exact=True)

Buggy submission (verdict: Runtime Error):
# this is a test for investigating why runtime error has happen
def comb(x, y, exact=False):
  return x + y

def factorial(x, y, exact=False):
  return x + y

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
  s = comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) / (factorial(n-k-i+1, exact=True) * factorial(i, exact=True)))
  print(int(s) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
  s = comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) / (factorial(n-k-i+1, exact=True) * factorial(i, exact=True)))
  print(int(s) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial
 
try:
  n, k = tuple(map(int, input().split(' ')))
  for i in range(1, k+1):
    print(comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) // (factorial(n-k-i+1, exact=True) * factorial(i, exact=True))) % (10 ** 9 + 7))
except Exception as e:
  print(e)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb, factorial

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
    print(comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) // (factorial(n-k-i+1, exact=True) * factorial(i, exact=True))) % (10 ** 9 + 7))
Problem p02987 (python)

Fixed submission:
S = str(input())
s = list(S)

if s[0] == s[1] == s[2] == s[3]:
    print("No")
elif s[0] == s[1] and s[2] == s[3]:
        print("Yes")
elif s[0] == s[2] and s[1] == s[3]:
        print("Yes")
elif s[0] == s[3] and s[1] == s[2]:
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
S = str(input())
s = list(S)
if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
    else:
        print("No")
else if s[0] == s[2]:
    if s[1] == s[3]:
        print("Yes")
    else:
        print("No")
else if s[0] == s[3]:
    if s[1] == s[2]:
        print("Yes")
    else:
        print("No")
Problem p03011 (python)

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

Buggy submission (verdict: Runtime Error):
T=[(map(int,input().split()))]
T.sort()
print(T[0]+T[1])

Buggy submission (verdict: Runtime Error):
P,Q,R=map(int,input().split())
T=list(P,Q,R)
T.sort()
print(T[0]+T[1])

Buggy submission (verdict: Runtime Error):
T=[map(int,input().split())]
T.sort()
print(T[0]+T[1])
Problem p03041 (python)

Fixed submission:
N, K = (int(i) for i in input().split())
S = list(input())

S[K - 1] = S[K - 1].lower()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
N = input()
K = input()
S = list(input())

S[K - 1] = S[K - 1].lower()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
S = [input()]

S[K - 1] = S[K - 1].lower()
print(''.join(S))

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
s = [str(i) for i in range(n)]

sl = s[k]
sk = sl.lower()
print(sk)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
s = list(str(n) for n input().split())

s = s[k]
s = s.lower()
print(s)

Buggy submission (verdict: Runtime Error):
s = list(str(i) for i input().split())
n = int(input())
k = int(input())

s = s[k]
s = s.lower()
print(s)

Buggy submission (verdict: Runtime Error):
s = range(n)
s = s.lower(k)
print(s)

Buggy submission (verdict: Runtime Error):
s = list(1:n)
s = s.lower(k)
print(s)

Buggy submission (verdict: Runtime Error):
s = list(1:n)
s = str(s[k])
s = s.lower()
print(s)

Buggy submission (verdict: Runtime Error):
for s in range(n):
    s = s.lower(k)

print(s)

Buggy submission (verdict: Runtime Error):
for s in range(n):
    s = str(s[k])
    s = s.lower()

print(s)

Buggy submission (verdict: Runtime Error):
s = list(n)
up = str(s[k])
s = up.lower()

print(s)

Buggy submission (verdict: Runtime Error):
for i in range(n):
    s = 'i'.lower()

print(s)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print('Yay!')
else:
    print(':(')

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

if k >= max(a - e):
    print('Yay!')
else:
    print(':(')

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

if k >= (a - e):
    print('Yay!')
else:
    print(':(')
Problem p02987 (python)

Fixed submission:
S = input()
 
if S[1]==S[2]==S[3]==S[0]:
        print('No')
        
elif S[0]==S[1] and S[2]==S[3]:
        print('Yes')
 
elif S[1]==S[2] and  S[0]==S[3]:
        print('Yes')
        
elif S[1]==S[3] and  S[0]==S[2]:
        print('Yes')
 
else :
    print('No')

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

if S[0]==S[1] and S[2]==S[3]　and S[0]!=S[2]:
        print('Yes')

elif S[1]==S[2] and  S[0]==S[3] and S[0]!=S[1]:
        print('Yes')
        
elif S[1]==S[3] and  S[0]==S[2] and S[0]!=S[1]:
        print('Yes')

else :
    print('No')