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

Fixed submission:
N, M = map(int, input().split())

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    B.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

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

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

B=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

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

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

C=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
        if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

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

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

C=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
    if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
    print(ans)

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

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])

C=[]
for i in range(M):
    c, d = map(int, input().split())
    C.append([c, d])

for i in range(N):
    saitei = float("inf")
    ans = 0
    for j in range(M):
    if abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1]) < saitei:
            saitei = abs(A[i][0]-B[j][0]) + abs(A[i][1]-B[j][1])
            ans = j+1   
        else:
            continue
    print(ans)

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

A = []
for i in range(N):
    a, b = map(int, input().split())
    A.append([a, b])
print(A)
for i in range(M):
    c, d = map(int, input().split())
    saitei = float("inf")
    for j in range(N):
        if abs(A[j][0]-c) + abs(A[j][1]-d) < saitei:
            saitei = abs(A[i][0]-c) + abs(A[i][1]-d)
            ans = j+1   
        else:
            continue
    print(ans)
Problem p03804 (python)

Fixed submission:
N, M = map(int, input().split())
a = []
b = []
for i in range(N):
    a.append(input())
c = 0
ans = "No"
for i in range(M):
    b.append(input())
for i in range(N-M+1):
    for j in range(N-M+1):
        for k in range(M):
            if a[i+k][j:j+M] == b[k]:
                c += 1
        if c == M:
            ans = "Yes"
            break
        c = 0
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
list = []
for i in range(H):
    list.append(input())
count = 0
for i in range(M):
    x = input()
    for j in list:
    if x in j:
        count+=1
print("No" if count=0 else "Yes")
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 p02596 (python)

Fixed submission:
K = int(input())
L,r = K*9 if K%7 else K*9//7, 10
for i in range(1,L+1):
	r %= L
	if r == 1:
		print(i)
		exit()
	r *= 10
print(-1)

Buggy submission (verdict: Runtime Error):
K = int(input())
L,r = K*9 if K%7 else K*9/7, 10
for i in range(1,L+1):
	r %= L
	if r == 1:
		print(i)
		exit()
	r *= 10
print(-1)
Problem p02598 (python)

Fixed submission:
N,K = map(int, input().split())
A = list(map(int, input().split()))

l,r = 1,max(A)
while l<r:
	m = (l+r)//2
	s = sum([a//m+(not a%m==0)-1 for a in A])
	if s <= K:
		r = m
	else:
		l = m+1
print(r)

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

l,r = 0,max(A)
while l<r:
	m = (l+r)//2
	s = sum([a//m+(not a%m==0)-1 for a in A])
	if s <= K:
		r = m
	else:
		l = m+1
print(r)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()
print(sum([x!=y for x,y in zip(S,T)]))

Buggy submission (verdict: Runtime Error):
S,T = map(input().split())
print(sum[x!=y for x,y in zip(S,T)])
Problem p02623 (python)

Fixed submission:
# coding:utf-8
import itertools
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
j = m

aa = [0] + list(itertools.accumulate(a))
bb = [0] + list(itertools.accumulate(b))
# print(aa)
# print(bb)


# しゃくとり法 / Aの山だけ読みつつ、そこにBからいくつ取り出すかで考える
for i, a_item in enumerate(aa):
    if a_item > k:
        break
    while a_item + bb[j] > k:
        j -= 1
    ans = max(i + j, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import itertools
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
j = m

aa = [0] + list(itertools.accumulate(a))
bb = [0] + list(itertools.accumulate(b))
#print(aa)
#print(bb)


# しゃくとり法 / Aの山だけ読みつつ、そこにBからいくつ取り出すかで考える
for i, a_item in enumerate(a):
    if a_item > k:
        break
    while a_item + b[j] > k:
        j -= 1
    ans = max(i + j, ans)
print(ans)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
time = 0

if sum(a) + sum(b) <= k:
    print(len(a) + len(b))
    exit()

while time < k:
    if len(a) == 0:
        book = b[0]
    elif len(b) == 0:
        book = a[0]
    else:
        book = min(a[0], b[0])

    time += book
    if time > k:
        break

    ans += 1
    if book == a[0]:
        a.pop(0)
    else:
        b.pop(0)
print(ans)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
time = 0

if sum(a) + sum(b) <= k:
    print(len(a) + len(b))
    exit()

while time <= k:
    if len(a) == 0 and len(b) == 0:
        print(ans)
        exit()
    elif len(a) == 0:
        book = b[0]
    elif len(b) == 0:
        book = a[0]
    else:
        book = min(a[0], b[0])

    time += book
    if time > k:
        print(ans)
        exit()
    ans += 1
    if book == a[0]:
        a.pop(0)
    else:
        b.pop(0)
Problem p02624 (python)

Fixed submission:
# coding:utf-8
n = int(input())
ans = 0

for i in range(1, n + 1):
    tmp = n // i
    ans += i * tmp * (tmp + 1) // 2
print(ans)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
import sympy
n = int(input())

ans = 0
for i in range(1, n + 1):
    ans += i * sympy.divisors(i)
print(ans)
Problem p02754 (python)

Fixed submission:
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)

ans = a * count + min(mod, a)
print(ans)

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

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)


if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]


print(ans_ball.count('b'))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)
#print(count, mod)

if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]

print(ans_ball.count('b'))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
n, a, b = map(int, input().split())

if n >= (a+b):
    count = n // (a+b)
    mod = n % (a+b)
    #print(count, mod)
else:
    count = 1
    mod = 0

if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]

print(ans_ball.count('b'))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
n, a, b = map(int, input().split())
count = n // (a+b)
mod = n % (a+b)
#print(count, mod)
ball = ('b'* a + 'r'* b) * count

if mod >= 1:
    ball = ball + 'b'* a + 'r'* b

ans_ball = ball[:n]
print(ans_ball.count('b'))
Problem p02879 (python)

Fixed submission:
#coding:utf-8
a, b = map(int, input().split())

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
a, b = map(int, input())

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a*b)
Problem p02959 (python)

Fixed submission:
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            a[i + 1] -= b[i]
            ans += b[i]
        else:
            ans += a[i + 1]
            a[i + 1] = 0


print(ans)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            a[i + 1] -= b[i]
            ans += b[i]
        else:
            ans += a[i + i]
            a[i + 1] = 0


print(ans)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0

for i in range(n):
    if a[i] >= b[i]:
        ans += b[i]
    else:
        ans += a[i]
        b[i] -= a[i]
        if a[i + 1] >= b[i]:
            ans += b[i]
            a[i + 1] -= b[i]
        else:
            ans += a[i + i]
            a[i + 1] = 0


print(ans)
Problem p02990 (python)

Fixed submission:
#coding:utf-8
from scipy.misc import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())
m = pow(10,9) + 7

for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % m)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())


for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    print(blue * blue_num % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())


for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    ans = blue * blue_num % (10 ** 9 + 7)
    print(ans)

Buggy submission (verdict: Runtime Error):
#coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())


for i in range(k):
    # 赤と赤の間に青を配置する場所の組み合わせ
    blue = comb(n-k+1, i+1, exact=True)
    # 青をいくつずつ配置するかの組み合わせ
    blue_num = comb(k-1, i, exact=True)
    ans = blue * blue_num % (pow(10,9)+ 7)
    print(ans)

Buggy submission (verdict: Runtime Error):
coding:utf-8
from scipy.special import comb

n, k = map(int, input().split())
all_ans = comb(n, k, exact=True)
cmb = 0
#print(a)

for i, j in zip(range(n-k+1, n), range(1, k)):
    #print(i, j)
    a = comb(i, j, exact=True)
    ans = a % (pow(10,9)+ 7)
    cmb += ans
    print(ans)

print((all_ans - cmb) % (pow(10,9)+ 7))
Problem p03013 (python)

Fixed submission:
#coding:utf-8
#DPの練習

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

#壊れている階段とそうでない階段を判別するリスト
broken = [0] * (n+1)

#段ごとに何通りかを集計するためのリスト
dp = [0] * (n+1)
#0段目は必ず1通りしかない
dp[0] = 1


#壊れている階段をマークする
for i in range(m):
    broken[int(input())] = 1

#1段目から壊れている可能性があるので場合分け
if broken[1] == 1:
    dp[1] = 0
else:
    #1段目が無事な場合は1通り
    dp[1] = 1

#2段目以降
for i in range(2, n+1):
    if broken[i] == 1:
        #壊れていた場合次の段を確認する
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] = dp[i] % 1000000007

print(dp[n])

Buggy submission (verdict: Runtime Error):
#coding:utf-8
#DPの練習

n, m = map(int, input().split())
a = [int(input()) for i in range(m)]

#壊れている階段とそうでない階段を判別するリスト
broken = [0] * (n+1)

#段ごとに何通りかを集計するためのリスト
dp = [0] * (n+1)
#0段目は必ず1通りしかない
dp[0] = 1


#壊れている階段をマークする
for i in range(m):
    broken[a[i]] = 1

#1段目から壊れている可能性があるので場合分け
if broken[1] == 1:
    dp[2] = 0
else:
    #1段目が無事な場合は1通り
    dp[2] = 1

#3段目以降
for i in range(2, n+1):
    if broken[i] == 1:
        #壊れていた場合次の段を確認する
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] = dp[i] % 1000000007

print(dp[n])

Buggy submission (verdict: Runtime Error):
#coding:utf-8
#DPの練習

n, m = map(int, input().split())
a = [int(input()) for i in range(m)]

#壊れている階段とそうでない階段を判別するリスト
broken = [0] * (n+1)

#段ごとに何通りかを集計するためのリスト
dp = [0] * (n+1)
#0段目は必ず1通りしかない
dp[0] = 1


#壊れている階段をマークする
for i in range(m):
    broken[a[i]] = 1

#1段目から壊れている可能性があるので場合分け
if broken[1] == 1:
    dp[2] = 0
else:
    #1段目が無事な場合は1通り
    dp[2] = 1

#3段目以降
for i in range(2, n+1):
    if broken[i] == 1:
        #壊れていた場合次の段を確認する
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] = dp[i] % 1000000007

print(dp[n])
Problem p03208 (python)

Fixed submission:
# coding:utf-8
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
h.sort()
ans = h[0]

print(min(h[i + k - 1] - h[i] for i in range(n - k + 1)))

Buggy submission (verdict: Runtime Error):
# coding:utf-8
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
h.sort()
ans = h[0]

print(min(h[i + k - 1] - h[i] for i in range(n - k + 1))
Problem p03631 (python)

Fixed submission:
#coding:utf-8

n = list(input())

if n[0] == n[2]:
  print('Yes')
else:
  print('No')

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

a, b, c, d = map(int, input().split())
time = max(b,d) - min(a,c)
print(max(0, time))

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

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

print(max(b,d) - min(a,c))

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

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

print(min(a,c)- max(b,d))
Problem p02682 (python)

Fixed submission:
from sys import stdin
A,B,C,K=list(map(int,(stdin.readline().strip().split())))
if A>=K:
    print(K)
    exit()
if A+B>=K:
    print(A)
    exit()
K=K-(A+B)
print(A+(K*-1))
exit()

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,C,K=list(map(int,(stdin.readline().strip().split())))
maxx=0
K-=A
maxx=max(maxx,A)
if K<=0:
    print(maxx)
    exit()
K-=B
aa=B*0
maxx=max(maxx,maxx+aa)
if K<=0:
    print(maxx)
    exit()
K-=C
aa=C*-1
maxx=max(max,maxx+aa)
if K<=0:
    print(maxx)
    exit()
Problem p02707 (python)

Fixed submission:
from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split())))
num_list=[0]*N
moji=A[0]
i=0
length=len(A)-1
for i in A:
    num_list[i-1]+=1
for num in num_list:
    print(num)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split()))).sort()
moji=A[0]
count=1
i=0
length=len(A)-1
j=0
sougou=0
while(i!=length):

    if moji==A[i+1]:
        count+=1
        i+=1
        j+=1
    else:
        sougou += 1
        print(count)
        count=1
        j=1
        i+=1
        moji=A[i]
if j>=1:
    sougou += 1
    print(count)
for _ in range(N-sougou):print(0)
Problem p02729 (python)

Fixed submission:
from sys import stdin
import itertools
N,M = list(map(int, (stdin.readline().strip().split())))
count=0
count+=len(list(itertools.combinations(range(N), 2)))
count+=len(list(itertools.combinations(range(M), 2)))
print(count)

Buggy submission (verdict: Runtime Error):
from sys import stdin
from scipy import special
N,M = list(map(int, (stdin.readline().strip().split())))
count=0
count+=special.comb(N,2, True)
count+=special.comb(M,2, True)
print(count)
Problem p02847 (python)

Fixed submission:
week=['SUN','MON','TUE','WED','THU','FRI','SAT']
S=input()
day=week.index(S)
print(7-day)

Buggy submission (verdict: Runtime Error):
from sys import stdin
A,B,X=list(map(int,(stdin.readline().strip().split())))

left=0
right=10**(9)+1

while(right-left>1):
    num = left + (right - left) // 2
    cost=A*num+B*(len(str(num)))
    if cost<=X:
        left=num
    else:
        right=num
print(left)
Problem p03209 (python)

Fixed submission:
N,X=list(map(int,input().split()))
p=[]
a=[]
def search(N):
    if N==0:
        p.append(1)
        a.append(1)
        return 1,1
    else:
        search(N-1)
        p.append(2*p[N-1]+1)
        a.append(2*a[N-1]+3)
search(N)
def bug(N,X):#p,a
    if N==0 and X>=1:return 1
    if X==1:return 0
    if 1<X<=1+a[N-1]:
        return bug(N-1,X-1)
    elif X==a[N-1]+2:
        return p[N-1]+1
    elif a[N-1]+2<X<=2+2*a[N-1]:
        return p[N-1]+1+bug(N-1,X-2-a[N-1])
    elif X==3+2*a[N-1]:
        return 2*p[N-1]+1
print(bug(N,X))

Buggy submission (verdict: Runtime Error):
N,X=list(map(int,input().split()))
p=[]
a=[]
def search(N):
    if N==0:
        p.append(1)
        a.append(1)
        return 1,1
    else:
        search(N-1)
        p.append(2*p[N-1]+1)
        a.append(2*a[N-1]+3)
search(N)
def bug(N,X):#p,a
    if X==1:return 0
    if 1<X<=1+a[N-1]:
        return bug(N-1,X-1)
    elif X==a[N-1]+2:
        return p[N-1]+1
    elif a[N-1]+2<X<=2+2*a[N-1]:
        return p[N-1]+1+bug(N-1,X-2-a[N-1]-1)
    elif X==3+2*a[N-1]:
        return 2*p[N-1]-1
print(bug(N,X))
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k]+s[k].lower()+s[k+1:])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k]+s.[k]lower()+s[k+1:])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k]+lower(s[k])+s[k+1:])

Buggy submission (verdict: Runtime Error):
print(S[:K] + lower(S[K]) + S[K+1:])
Problem p03075 (python)

Fixed submission:
L = []
for i in range(5):
  x = int(input())
  L.append(x)
K = int(input())
if L[4] - L[0] <= K:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
L = []
for i in range(5):
  x = input()
  L.append(x)
K = int(input())
if L[4] - L[0] <= K:
  print('Yay!')
else:
  print(':(')
Problem p02831 (python)

Fixed submission:
A,B=map(int,input().split())

import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(A,B))

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

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A,B))
Problem p02916 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

P=0
P+=B[A[0]-1]
for i in range(N-1):
    if A[i]!=N and A[i+1]==A[i]+1:
        u=B[A[i+1]-1]
        q=C[A[i+1]-2]
        o=u+q
        P+=o
    else:
        u=B[A[i+1]-1]
        P+=u
    
print(int(P))

Buggy submission (verdict: Runtime Error):
P=0
P+=B[A[0]-1]
for i in range(N-1):
    if A[i]!=N:
        u=B[A[i+1]-1]
        q=C[A[i+1]-2]
        o=u+q
        P+=o
    else:
        u=B[A[i+1]-1]
        P+=u
    
print(P)
Problem p02693 (python)

Fixed submission:
# coding: utf-8
# Your code here!
K = int (input())
line= list(map(int,input().split()))
a,b = line[0],line[1]
if b<K:
    print("NG")
    

else:
    for i in range(a,b+1):
        if i%K==0:
            print("OK")
            break
        elif i==b:
            print("NG")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
K = int (input())
line= list(map(int,input().split()))
a,b = line[0],line[1]
if B<K:
  print("NG")
if (b-a+1)>=K:
    print("OK")

else:
    for i in range(a,b+1):
        if i%K==0:
            print("OK")
            break
    print("NG")
Problem p02707 (python)

Fixed submission:
# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num+1):
    print(clist[i])

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
line= list(map(int,input().split()))
N = line[0]
K = line[1]
#0~Nの連続した整数から
#K個以上(N+1)個以下だけ選ぶ
answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num
 
if answer >=(10**9+7):
    print(int(answer%(10**9+7)))
    
else:
    print(int(answer))
Problem p02688 (python)

Fixed submission:
n,k = map(int,input().split())
x = []
for i in range (k):
  d = int(input())
  a = list(map(int,input().split()))
  x += a
print(n-len(set(x)))

Buggy submission (verdict: Runtime Error):
sunuke,var = map(int,input().split())
loser = [1] * sunuke
for i in range(var):
  d = int(input())
  buy = map(int(input().split())
  for t in buy:
    winer[t-1] = 0
print(sum(loser))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
have = [0] * n
for i in range (k):
  d = int(input())
  a = list(map(int,input().split()))
  for j in a:
    have[i] += 1
ans = 0
for m in range (1,k+1):
  if have[m] == 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
have = [0] * n
for i in range (k):
  d = int(input())
  a = map(int,input().split())
  for j in a:
    have[i] += 1
ans = 0
for m in range (1,k+1):
  if have[m] == 0:
    ans += 1
print(ans)
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,M = map(int,input()split())
ans = N*(N-1)/2 + M*(M-1)/2
ans = int()
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input()split())
ans = N*(N-1)/2 + M*(M-1)/2
print(ans)
Problem p02753 (python)

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S_1,S_2,S_3 = input().split()
if S_1 == S_2 && S_2 == S_3:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S_1,S_2,S_3 = input().split()
if s_1 == s_2 && s_2 == s_3:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s_1,s_2,s_3 = input().split()
if s_1 == s_2 && s_2 == s_3:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s_1,s_2,s_3 = input().split()
if s_1 == s_2 == s_3:
  print("No")
else:
  print("Yes")
Problem p02759 (python)

Fixed submission:
N = int(input())
A = N / 2
A = int(A)
B = (N + 1) / 2
B = int(B)
if N % 2 == 0:
  print(A)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(S)
A = N / 2
B = (N + 1) / 2
if N % 2 == 0:
  print(A)
else:
  print(B)
Problem p02777 (python)

Fixed submission:
S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()
if S == U:
  A -= 1
else:
  B -= 1
print(A,B)

Buggy submission (verdict: Runtime Error):
S,T,A,B,U = input().split()
A = int(A)
B = int(B)
if U == S:
  A -= 1
else:
  B -= 1
print(A,B)

Buggy submission (verdict: Runtime Error):
S,T,U = input().split()
A,B = map(int,input()split())
if U == S:
  A -= A
else:
  B -= B
print(A,B)