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

Fixed submission:
import fractions
N=int(input())
a=input().split()
A=[int(b) for b in a]
A=sorted(A,reverse=True)
numbers=[]
numbers.append(fractions.gcd(A[0],A[1]))
for a in range(1,N):
    answer=fractions.gcd(numbers[-1],A[a])
    numbers.append(answer)
print(numbers[-1])

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
a=input().split()
A=[int(b) for b in a]
A=sorted(A,reverse=True)
numbers=[]
numbers.append(math.gcd(A[0],A[1]))
for a in range(1,N):
    answer=math.gcd(numbers[-1],A[a])
    numbers.append(answer)
print(numbers[-1])

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
a=input().split()
A=[int(b) for b in a]
A=sorted(A,reverse=True)
numbers=[]
numbers.append(math.gcd(A[0],A[1]))
for a in range(1,N):
    answer=math.gcd(numbers[-1],A[a])
    numbers.append(answer)
print(numbers[-1])

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
a=input().split()
A=[int(b) for b in a]
A=sorted(A,reverse=True)
numbers=[]
for n in range(N-1):
    answer=math.gcd(A[n],A[n+1])
    numbers.append(answer)
numbers.append(A[-1])
print(min(numbers))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
a=input().split()
A=[int(b) for b in a]
A=sorted(A,reverse=True)
numbers=[]
for n in range(N-1):
    answer=math.gcd(A[n],A[n+1])
    numbers.append(answer)
print(min(numbers))
Problem p03745 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
flag=0
answer=1
if N==1:
    print(1)
else:
    if A[0] < A[1]:
        flag = 1
    elif A[0]>A[1]:
        flag = -1
    for n in range(N - 1):
        if flag == 1:
            if A[n] <= A[n + 1]:
                pass
            else:
                flag = 0
                answer += 1
        elif flag == -1:
            if A[n] >= A[n + 1]:
                pass
            else:
                flag = 0
                answer += 1
        else:
            if A[n] == A[n + 1]:
                pass
            elif A[n] < A[n + 1]:
                flag = 1
            else:
                flag = -1
    print(answer)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
flag=0
answer=1
if A[0]<A[1]:
    flag=1
else:
    flag=-1
for n in range(N-1):
    if flag==1:
        if A[n]<=A[n+1]:
            pass
        else:
            flag=0
            answer+=1
    elif flag==-1:
        if A[n]>=A[n+1]:
            pass
        else:
            flag=0
            answer+=1
    else:
        if A[n]==A[n+1]:
            pass
        elif A[n]<A[n+1]:
            flag=1
        else:
            flag=-1
print(answer)
Problem p03775 (python)

Fixed submission:
N=int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
yakusuu=make_divisors(N)
if len(yakusuu)%2 != 0:
    print(len(str(yakusuu[len(yakusuu)//2])))
else:
    ans=pow(10,9)
    for n in range(len(yakusuu)//2):
        number=max(len(str(yakusuu[n])),len(str(yakusuu[-n-1])))
        ans=min(ans,number)
    print(ans)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
P = 0
P += N
Eratosthenes = [p for p in range(2, math.ceil(N ** 0.5))]
number = Eratosthenes[0]
sosuu = []
while number < N ** 0.25:
    sosuu.append(number)
    n_Eratosthenes = []
    for n in Eratosthenes:
        if n % number == 0:
            pass
        else:
            n_Eratosthenes.append(n)
    if len(n_Eratosthenes) == 0:
        break
    number = n_Eratosthenes[0]
    Eratosthenes = n_Eratosthenes
numbers = sosuu + Eratosthenes
suuji = 0
answers = []
while N > 1 and suuji < len(numbers):
    number = numbers[suuji]
    if N % number == 0:
        answers.append(number)
        N = N // number
    else:
        suuji += 1
number = 1
for n in answers:
    number *= n
other = P // number
if P==1:
    print(1)
else:
    if other == 1:
        a = 1
        b = 1
        for n in range(len(answers)):
            if n % 2 == 0:
                a *= answers[n]
            else:
                b *= answers[n]
        print(max(len(str(a)), len(str(b))))
    else:
        print(max(len(str(other)), len(str(number))))

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
P=0
P+=N
Eratosthenes = [p for p in range(2, math.ceil(N ** 0.5))]
number = Eratosthenes[0]
sosuu = []
while number < N ** 0.25:
    sosuu.append(number)
    n_Eratosthenes = []
    for n in Eratosthenes:
        if n % number == 0:
            pass
        else:
            n_Eratosthenes.append(n)
    if len(n_Eratosthenes) == 0:
        break
    number = n_Eratosthenes[0]
    Eratosthenes = n_Eratosthenes
numbers = sosuu + Eratosthenes
suuji = 0
answers = []
while N > 1 and suuji < len(numbers):
    number = numbers[suuji]
    if N % number == 0:
        answers.append(number)
        N = N // number
    else:
        suuji += 1
number=1
for n in answers:
    number*=n
other=P//number
if other==1:
    a=1
    b=1
    for n in range(len(answers)):
        if n%2==0:
            a*=answers[n]
        else:
            b*=answers[n]
    print(max(len(str(a)),len(str(b))))
else:
    print(max(len(str(other)),len(str(number))))
Problem p03803 (python)

Fixed submission:
A,B=map(int,input().split())
if A==B:
    print('Draw')
else:
    if A==1:
        print('Alice')
    elif B==1:
        print('Bob')
    else:
        if A > B:
            print('Alice')
        else:
            print('Bob')

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A==B:
    print('Draw')
else:
    if A==1:
        print('Alice')
    elif B==1:
        print('Bob')
    else:
        if A > B:
        print('Alice')
        else:
        print('Bob')
Problem p02550 (python)

Fixed submission:
N,X,M = map(int,input().split())
A = [0]*M
S = 0
r = X % M
A[r] = 1
d = 0
I = 0
for i in range(1,M+1):
    r = (r*r) % M
    if A[r] == 0:
        A[r] = i+1
    else:
        I = A[r]
        j = i+1
        d = j-I
        break
r = X
for i in range(I):
    S += r
    r = (r*r) % M
if d != 0:
    t,u = (N-I)//d,(N-I)%d
    s = 0
    for i in range(d):
        s += r
        r = (r*r) % M
    S += s*t
    for i in range(u):
        S += r
        r = (r*r) % M
print(S)

Buggy submission (verdict: Runtime Error):
N,X,M = map(int,input().split())
A = [0]*M
S = 0
r = X
A[r-1] = 1
d = 0
for i in range(1,M):
    r = (r*r) % M
    if A[r-1] == 0:
        A[r-1] = i+1
    else:
        I = A[r-1]
        j = i+1
        d = j-I
        break
r = X
for i in range(I):
    S += r
    r = (r*r) % M
if d != 0:
    t,u = (N-I)//d,(N-I)%d
    s = 0
    for i in range(d):
        s += r
        r = (r*r) % M
    S += s*t
    for i in range(u):
        S += r
        r = (r*r) % M
print(S)
Problem p02790 (python)

Fixed submission:
a,b = input().split()
A,B = min(int(a),int(b)),max(int(a),int(b))
print(int(str(A)*B))

Buggy submission (verdict: Runtime Error):
N = int(input())
L = len(str(N))
B = int(str(N)[0])
c = 0
for i in range(1,N+1):
    I = str(i)
    l = len(I)
    a,b = int(I[0]),int(I[l-1])
    if a == 0 or b == 0:
        continue
    else:
        if a == b:
            c += 1
        for m in range(max(L-2,0)):
            c += 10**m
        if L == 1:
            continue
        if b > B:
            continue
        elif b < B:
            c += 10**(L-2)
        elif L > 2:
            c += int(str(N)[1:L-1])
        elif L == 2:
            c += 1
print(c)
Problem p02891 (python)

Fixed submission:
S = input()
K = int(input())
L = len(S)
a = S[0]
i = 0
C = []
if L == 1:
    C = [1]
while i < L-1:
    count = 1
    b,c = S[i],S[i+1]
    i+= 1
    while b == c:
        count += 1
        if i == L-1:
            break
        b,c = S[i],S[i+1]
        i += 1
    C.append(count)
if a != S[L-1]:
    num = 0
    for co in C:
        num += co//2
    ans = int(num*K)
else:
    if len(C) == 1:
        ans  = L*K//2
    else:
        num1 = 0
        for co in C:
            num1 += co//2
        num2 = (C[len(C)-1]+C[0])//2
        for co in C[1:len(C)-1]:
            num2 += co//2
        ans = int(num1+num2*(K-1))
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
L = len(S)
a = S[0]
i = 0
C = []
while i < L-1:
    count = 1
    b,c = S[i],S[i+1]
    i+= 1
    while b == c:
        count += 1
        if i == L-1:
            break
        b,c = S[i],S[i+1]
        i += 1
    C.append(count)
if a != S[L-1]:
    num = 0
    for co in C:
        num += co//2
    print(int(num*K))
else:
    num1 = 0
    for co in C:
        num1 += co//2
    num2 = (C[len(C)-1]+1)//2
    for co in C[:len(C)-1]:
        num2 += co//2
    print(int(num1+num2*(K-1)))

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
L = len(S)
a = S[0]
i = 0
C = []
while i < L-1:
    count = 1
    b,c = S[i],S[i+1]
    i+= 1
    while b == c:
        count += 1
        if i == L-1:
            C.append(count)
            break
        b,c = S[i],S[i+1]
        i += 1
    if i == L-1:
        break
    C.append(count)
if a != S[L-1]:
    num = 0
    for co in C:
        num += co//2
    print(int(num*K))
else:
    num1 = 0
    for co in C:
        num1 += co//2
    num2 = (C[len(C)-1]+1)//2
    for co in C[:len(C)-1]:
        num2 += co//2
    print(int(num1+num2*(K-1)))

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())
L = len(S)
a = S[0]
modi = 0
i = 0
C = []
while i < L-1:
    count = 1
    b,c = S[i],S[i+1]
    i+= 1
    while b == c:
        count += 1
        if i == L-1:
            C.append(count)
            break
        b,c = S[i],S[i+1]
        i += 1
    if i == L-1:
        break
    C.append(count)
if a != S[L-1]:
    num = 0
    for co in C:
        num += co//2
    print(int(num*K))
else:
    num1 = 0
    for co in C:
        num1 += co//2
    num2 = (C[len(C)-1]+1)//2
    for co in C[:len(C)-1]:
        num2 += co//2
        print(co,co//2)
    print(int(num1+num2*(K-1)))
Problem p03015 (python)

Fixed submission:
L = input()
l = len(L)
a = 1
for i in range(l):
    a = 3 * a
    a = a % 1000000007
b = 2
c = 0
j = l-2
while(j >= 0):
    d = 0
    if L[l-1-j] == "0":
        d = 2 * b % 1000000007
    else:
        b = (2 * b) % 1000000007
    c = (3 * c) % 1000000007
    c = (d + c) % 1000000007
    j -= 1
a = (a - c) % 1000000007
print(a)

Buggy submission (verdict: Runtime Error):
L = input()
l = len(L)
a = 1
for i in range(l):
    a = 3 * a
    a = a % 1000000007
b = 2
c = 0
j = l-2
while(j >= 0):
    if L[l-1-j] == "0":
        d = 2 * b % 1000000007
    else:
        b = (2 * b) % 1000000007
    c = (3 * c) % 1000000007
    c = d + c
    j -= 1
a = a - c % 1000000007
print(a)
Problem p02753 (python)

Fixed submission:
s = input()
l = set(s)
if len(l) == 1:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n,a,b = map(int,input().split())
if a == 0:
    print(0)
elif b == 0:
    print(n)
elif a + b>n:
    print(a)
else:
    c = n//(a+b)
    d = n%(a+b)
    if a>d:
        print(c*a+d)
    else:
        print(c*a + a)
Problem p02833 (python)

Fixed submission:
import sys
n = int(input())
if n%2 == 1:
    print(0)
    sys.exit()
ans = 0
num = 10
while num<=n:
    ans += n//num
    num *= 5
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n == 1000000000000000000:
    print(124999999999999995)
else:
    cnt = 0
    dp = [0]*(n+1)
    dp[0] = 1
    dp[1] = 1
    for i in range(2,n+1):
        dp[i] = i*dp[i-2]
    ans = dp[n]
    l = -1
    while str(ans)[l] == '0':
        cnt+=1
        l-=1
    print(cnt)
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split())
ans = a+b+c
if ans>=22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input())
ans = a+b+c
if ans>=22:
    print("bust")
else:
    print("win")
Problem p02859 (python)

Fixed submission:
r = int(input())
print(r**2//1)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
li = [list(map(int,input().split())) for i in range(N)]
ans = []
for i in range(N):
    for j in range(N):
        d = (li[i][0] - li[j][0])**2 + (li[i][1]-li[j][1])**2
        d = math.sqrt(d)
        ans.append(d)
print(sum(ans)/N)
Problem p02951 (python)

Fixed submission:
A,B,C = map(int,input().split())
last = A-B
D = C - last
if D<0:
    D = 0
print(D)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
state = 0
L = []
cnt = 0
cnt2 = 0
for i in range(1,len(H)):
    d = H[i]-H[i-1]
    if d<0:
        H[i-1] = H[i-1] - 1
for i in range(1,len(H)):
    d = H[i]-H[i-1]
    if d<0:
        cnt+=1
    elif d == 0:
        cnt2+=1

if cnt>0:
    print("No")
elif cnt2 == len(H)-1 and len(H)>=2:
    print("No")
else:
    print("Yes")
Problem p02987 (python)

Fixed submission:
s = input()
first = s[0]
second = ""
cnt_f = 0
cnt_s = 0
for i in range(len(s)):
    if s[i] != first:
        second = s[i]
        break
for i in range(len(s)):
    if s[i] == first:
        cnt_f+=1
    if s[i] == second:
        cnt_s+=1
if cnt_f == 2 and cnt_s == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
first = s[0]
cnt_f = 0
cnt_s = 0
for i in range(len(s)):
    if s[i] != first:
        second = s[i]
        break
for i in range(len(s)):
    if s[i] == first:
        cnt_f+=1
    if s[i] == second:
        cnt_s+=1
if cnt_f == 2 and cnt_s == 2:
    print("Yes")
else:
    print("No")
Problem p03137 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

n,m = map(int,input().split())
x = sorted(list(map(int,input().split())))
diff = []
visit = [False]*m
visit[0] = True
if m == 1 or n>=m:
    print(0)
    sys.exit()
for i in range(m-1):
    d = x[i+1] - x[i]
    diff.append(d)
diff.sort(reverse= True)
for i in range(n-1):
    diff[i] = 0
print(sum(diff))

Buggy submission (verdict: Runtime Error):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

n,m = map(int,input().split())
x = sorted(list(map(int,input().split())))
diff = []
if m == 1:
    print(0)
    sys.exit()
for i in range(m-1):
    d = x[i+1] - x[i]
    diff.append(d)
diff.sort(reverse= True)
for i in range(n-1):
    diff[i] = 0
print(sum(diff))
Problem p03307 (python)

Fixed submission:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

n = int(input())
if n%2 == 0:
    print(n)
else:
    print(2*n)

Buggy submission (verdict: Runtime Error):
import sys
import itertools
import funtools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

n = int(input())
if n%2 == 0:
    print(n)
else:
    print(2*n)
Problem p02552 (python)

Fixed submission:
if int(input()) == 0:
	print(1)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
if x == 1:
	print(0)
else:
	print(1)
Problem p02623 (python)

Fixed submission:
from itertools import accumulate
from bisect import bisect_left

ri = lambda S: [int(v) for v in S.split()]


def rii():
    return ri(input())


N, M, K = rii()
A = rii()
B = rii()

i = j = 0

pA = [0] + list(accumulate(A))
pB = [0] + list(accumulate(B))

ans = 0
for i, a in enumerate(pA):
    br = 0
    if K >= a:
        r = K - a
        br = i
    
    if r:
        j = bisect_left(pB, r)
        if j != len(pB):
            if pB[j] > r:
                j -= 1
            br += j
    
    ans = max(ans, br)

print(ans)

Buggy submission (verdict: Runtime Error):
from functools import lru_cache

ri = lambda S: [int(v) for v in S.split()]


def rii():
    return ri(input())


N, M, K = rii()
A = rii()
B = rii()

i = j = 0


@lru_cache(None)
def dp(i, j, k):
    ki = kj = mki = mkj = 0

    if i < N:
        Ki = k - A[i] if A[i] <= k else 0
        mki = 1 + dp(i + 1, j, Ki) if Ki >= 0 else 0
    if j < M:
        kj = k - B[j] if B[j] <= k else 0
        mkj = 1 + dp(i, j + 1, kj) if kj >= 0 else 0

    return max(mki, mkj)


print(dp(0, 0, K))
#print(dp.cache_info())

Buggy submission (verdict: Runtime Error):
ri = lambda S: [int(v) for v in S.split()]


def rii():
    return ri(input())


N, M, K = rii()
A = rii()
B = rii()

i = j = 0


def dp(i, j, k):
    ki = kj = mki = mkj = 0

    if i < N:
        Ki = k - A[i] if A[i] <= k else 0
        mki = 1 + dp(i + 1, j, Ki) if Ki >= 0 else 0
    if j < M:
        kj = k - B[j] if B[j] <= k else 0
        mkj = 1 + dp(i, j + 1, kj) if kj >= 0 else 0

    return max(mki, mkj)


print(dp(0, 0, K))

Buggy submission (verdict: Runtime Error):
ri = lambda S: [int(v) for v in S.split()]


def rii():
    return ri(input())


N, M, K = rii()
A = rii()
B = rii()

i = j = 0


def dp(i, j, k):
    print(i, j, k)
    ki = kj = mki = mkj = 0

    if i < N:
        Ki = k - A[i] if A[i] <= k else 0
        mki = 1 + dp(i + 1, j, Ki) if Ki >= 0 else 0
    if j < M:
        kj = k - B[j] if B[j] <= k else 0
        mkj = 1 + dp(i, j + 1, kj) if kj >= 0 else 0

    return max(mki, mkj)


print(dp(0, 0, K))
Problem p02723 (python)

Fixed submission:
S = input()

check = S[2] == S[3] and S[4] == S[5]

print("Yes" if check else "No")

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

check = S[2] == S[3] and S[4] == S[5]

print("Yes" if check else "No")

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

check = S[2] == S[4] and S[3] == S[5]

print("Yes" if check else "No")
Problem p02759 (python)

Fixed submission:
N = int(input())
print(N//2 + N%2)

Buggy submission (verdict: Runtime Error):
N = int(input())
prnit(N//2 + N%2)
Problem p02623 (python)

Fixed submission:
n,m,k=map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a, b = [0], [0]

for i in range(n):
  a.append(a[i] + A[i])
for i in range(m):
  b.append(b[i] + B[i])
  
ans, j = 0, m

for i in range(n+1):
  if a[i] > k:
    break
  while b[j] > k - a[i]:
    j -= 1
  ans = max(ans, i + j)
  
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k=map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
result = 0
count = 0
while True:
  if not a and not b:
    print(count)
  if result > k:
    print(count-1)
    break
  if not a:
    result += b.pop()
    count += 1
  elif not b:
    result += a.pop()
    count += 1
  elif a[0] < b[0]:
    result += a.pop(0)
    count += 1
  else:
    result += b.pop(0)
    count += 1
Problem p02659 (python)

Fixed submission:
A, B = map(int, input().replace('.', '').split())
print(A*B//100)

Buggy submission (verdict: Runtime Error):
print(eval(input().replace('.','').replace(' ','*'))//100)
Problem p03011 (python)

Fixed submission:
P, Q, R = map(int, input().split())
time = [P, Q, R]
result = []
for i in range(len(time)):
  for j in range(i+1, len(time)):
    result.append(time[i]+time[j])
print(min(result))

Buggy submission (verdict: Runtime Error):
n=list(map(int,input().split()));print(min([i+j for i in n for j in n if i!=j]))
Problem p02819 (python)

Fixed submission:

def prime_list_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
def prime_list_eratosthenes_from(n_from, n_to):
    from bisect import bisect_left
    data = prime_list_eratosthenes(n_to)
    i = bisect_left(data, n_from)
    return data[i:]
x = int(input())
d = prime_list_eratosthenes_from(x, 1000000)
print(d[0])

Buggy submission (verdict: Runtime Error):

def prime_list_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
def prime_list_eratosthenes_from(n_from, n_to):
    from bisect import bisect_left
    data = prime_list_eratosthenes(n_to)
    i = bisect_left(data, n_from)
    return data[i:]
x = int(input())
d = prime_list_eratosthenes_from(x, 100000)
print(d[0])
Problem p02990 (python)

Fixed submission:
def nCr(n, r):
    import math
    return math.factorial(n) // ((math.factorial(n - r) * math.factorial(r)))
MOD = 1000000007

n, k = map(int, input().split())
b, r = k, n-k
for i in range(0, k):
    x = nCr(b - 1,  i) # 青いブロックの分け方
    if r - i < 0:
        print(0)
    else:
        y = nCr(r + 1, r - i)
        print(x * y % MOD)

Buggy submission (verdict: Runtime Error):
def nCr(n, r):
    import math
    return math.factorial(n) // ((math.factorial(n - r) * math.factorial(r)))
MOD = 1000000007

n, k = map(int, input().split())
b, r = k, n-k
for i in range(0, k):
    x = nCr(b - 1,  i) # 青いブロックの分け方
    y = nCr(r + 1 , r- i)

    print(x * y % MOD)

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

def nCr_with_replacement(n, r):
    # 重複を許容するくみあわせ　
    return nCr(n + r - 1, r)

# 並び変えるときの組み合わせ
def nPr(n, r):
    import math
    return math.factorial(n) // math.factorial(n - r)
MOD = 1000000007

n, k = map(int, input().split())
b, r = k, n-k
#b, r = max(b,r), min(b,r)
#print("b,r: {0},{1}".format(b,r))
for i in range(0, k):
    x = nCr(b - 1,  i) # 青いブロックの分け方
    #print(r+1)
    #print(i)
    y = nCr(r + 1 , r- i)

    #print("x,y: {0},{1}".format(x,y))
    print(x * y % MOD)
Problem p03252 (python)

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

ds = dict()
dt = dict()
tr = dict()
tr2 = dict()
res = True
for i in range(len(s)):
    ds[s[i]] = True
    dt[s[i]] = True
    if s[i] not in tr:
        tr[s[i]] = t[i]
    else:
        if tr[s[i]] != t[i]:
            res = False

    if t[i] not in tr2:
        tr2[t[i]] = s[i]
    else:
        if tr2[t[i]] != s[i]:
            res = False

if (len(ds) == 26 or len(dt) == 26) and ds != dt:
    res = False

print("Yes" if res else "No")

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

    ds = dict()
    dt = dict()
    tr = dict()
    tr2 = dict()
    res = True
    for i in range(len(s)):
        ds[s[i]] = True
        dt[s[i]] = True
        if s[i] not in tr:
            tr[s[i]] = t[i]
        else:
            if tr[s[i]] != t[i]:
                res = False

        if t[i] not in tr2:
            tr2[t[i]] = s[i]
        else:
            if tr2[t[i]] != s[i]:
                res = False

    #if (len(ds) == 26 or len(dt) == 26) and ds != dt:
    #    res = False

    print("Yes" if res else "No")