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

Fixed submission:
#!/usr/bin/env python3
import bisect
import numpy as np

N, M = list(map(int, input().split()))
a_list = list(map(int, input().split()))
bc_list = []

for i in range(M):
    try:
        b, c = list(map(int, input().split()))
        bc_list.append((b, c))
    except:
        M = i

bc_list = sorted(bc_list, key=lambda x: x[1], reverse=True)
a_list = sorted(a_list)

fix_list = []
s = 0
b, c = bc_list[0]
bc_index = 0
now_b, now_c = 0, c

for i, a in enumerate(a_list):
    # a = a_list[i]
    if now_b >= b:
        bc_index += 1
        if bc_index >= len(bc_list):
            # TODO: 残りを足す
            fix_list.append(a)
            s += a
            continue
        now_b = 0
        b, c = bc_list[bc_index]

    if a < c:
        fix_list.append(c)
        s += c
    else:
        fix_list.append(a)
        s += a
    now_b += 1

ans = s
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import bisect
import numpy as np

N, M = list(map(int, input().split()))
a_list = list(map(int, input().split()))
bc_list = []

for _ in range(M):
    b, c = list(map(int, input().split()))
    bc_list.append((b, c))

bc_list = sorted(bc_list, key=lambda x: x[1], reverse=True)
now_list = np.array(sorted(a_list))
fix_list = np.array([])
min_a = min(a_list)

for bc in bc_list:
    b, c = bc
    if min_a >= c:
        # もう置き換えても合計値は増えない
        break
    # cより小さい数は何個あるか？
    # 線形探索だとTLEになるので、2分探索で考える
    c_index = bisect.bisect_right(now_list, c)
    target_index = c_index if c_index < b else b

    # c_indexまでをcで置き換えても、順序の入れ替えはない
    now_list[:target_index] = c
    # c_index以前の整数は使用確定なので掃き出す
    fix_list = np.hstack([fix_list, now_list[:target_index]])
    now_list = now_list[target_index:]
    min_a = now_list[0]

fix_list = np.hstack([fix_list, now_list])
ans = fix_list.sum()
ans = int(ans)
print(ans)
Problem p03803 (python)

Fixed submission:
# https://atcoder.jp/contests/abc054/tasks/abc054_a
# A - One Card Poker
a, b = list(map(int, input().split()))

if a == 1:
    a = 100
if b == 1:
    b = 100

if a == b:
    answer = 'Draw'
elif a < b:
    answer = 'Bob'
elif a > b:
    answer = 'Alice'

print(answer)

Buggy submission (verdict: Runtime Error):
import itertools

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

ab_list = []

for _ in range(0, m):
    a, b = list(map(int, input().split()))
    ab_list.append((a, b))
    ab_list.append((b, a))

# 全探索で解く場合
l = range(1, n+1)
count = 0
roots = [v for v in itertools.permutations(l, n) if v[0] == 1]

for v in roots:
    is_ok = True
    for i, _ in enumerate(list(v)[:-1]):
        # 探索対象となるエッジ
        target_edge = (list(v)[i], list(v)[i+1])
        if (target_edge not in ab_list):
            is_ok = False

    if is_ok:
        count += 1

print(count)
Problem p03804 (python)

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

a_list_list = []

for i in range(0, n):
    a_list_list.append(input().split()[0])

b_list_list = []

for i in range(0, m):
    b_list_list.append(input().split()[0])

def is_match(source_list_list, b_list_list, source_start_x):

    for k in range(len(b_list_list)):
        for l in range(len(b_list_list[0])):
            if source_list_list[k][source_start_x + l] != b_list_list[k][l]:
                return False

    return True

# def debug_print(source):
#     print('==============')
#     for row in source:
#         print(row)
#     print('==============')

is_ok = False

# debug_print(b_list_list)

for j in range(0, n-m+1):
    target_a_list_list = a_list_list[j:j+m]
    for i in range(0, n-m+1):
        # debug_print(target_a_list_list)
        if is_match(target_a_list_list, b_list_list, i):
            is_ok = True
            break
    if is_ok:
        break

ans = 'Yes' if is_ok else 'No'

print(ans)

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

a_list_list = []

for i in range(0, n):
    a_list_list.append(input().split()[0])

b_list_list = []

for i in range(0, m):
    b_list_list.append(input().split()[0])

def is_match(source_list_list, b_list_list, source_start_x):

    for k in range(len(b_list_list)):
        for l in range(len(b_list_list[0])):
            if source_list_list[k][source_start_x + l] != b_list_list[k][l]:
                return False

    return True

# def debug_print(source):
#     print('==============')
#     for row in source:
#         print(row)
#     print('==============')

is_ok = False

# debug_print(b_list_list)

for j, _ in enumerate(a_list_list):
    target_a_list_list = a_list_list[j:j+m]
    for i in range(0, n-m):
        # debug_print(target_a_list_list)
        if is_match(target_a_list_list, b_list_list, i):
            is_ok = True
            break
    if is_ok:
        break

ans = 'Yes' if is_ok else 'No'

print(ans)
Problem p03986 (python)

Fixed submission:
#!/usr/bin/env python3

X = input()
N = len(X)
after_x = ""
next_i = 0
# 連続する箇所で部分文字列を作りたい
s_count, t_count = 0, 0
if X[0] == "T":
    # Tから始まる場合、最初の連続するTは確定で残るので切り捨てる
    for i, x in enumerate(X):
        if x == "T":
            after_x += x
        else:
            break
    next_i = i

if len(after_x) != N:
    # 「全ての文字列がT」ではない
    # 残りの文字列について操作する（最初のTは処理したので、必ずSから始まる）
    for i, char in enumerate(X[next_i:]):
        if i == 0:
            # 最初は確定でSから始まる
            s_count += 1
            continue

        if char == "S":
            # Sの場合
            if X[next_i + i - 1] == "T":
                # T->Sの切り替わりのとき
                if t_count >= s_count:
                    # Sを全て使い切り、余ったTは確定で残る
                    after_x += "T" * (t_count - s_count)
                    t_count = 0
                    s_count = 0
                else:
                    # Tを全部使い切り、余ったSは引き継がれる
                    s_count -= t_count
                    t_count = 0
            s_count += 1
        else:
            # Tの場合
            t_count += 1
    last_char = char

    if last_char == "T":
        # Tで終わる場合
        if t_count >= s_count:
            # Sを全て使い切り、余ったTは確定で残る
            after_x += "T" * (t_count - s_count)
            t_count -= s_count
            s_count = 0
        else:
            # Tを全部使い切り、余ったSは引き継がれる
            s_count -= t_count
            t_count = 0
            after_x += "S" * s_count
    else:
        # Sで終わる場合
        after_x += "S" * s_count
# print(after_x)
ans = len(after_x)
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

X = input()
N = len(X)
after_x = ""
next_i = 0
# 連続する箇所で部分文字列を作りたい
if X[0] == "T":
    # Tから始まる場合、最初の連続するTは確定で残る
    for i, x in enumerate(X):
        if x == "T":
            after_x += x
        else:
            break
    next_i = i

if next_i < N - 1:
    # 残りの文字列について操作する（最初のTは処理したので、必ずSから始まる）
    s_count = 0
    t_count = 0
    is_t = False
    for i, char in enumerate(X[next_i:]):
        if i == 0:
            # 最初は確定でSから始まる
            s_count += 1
            continue

        if char == "S":
            # Sの場合
            if X[next_i + i - 1] == "T":
                # T->Sの切り替わりのとき
                if t_count >= s_count:
                    # Sを全て使い切り、余ったTは確定で残る
                    after_x += "T" * (t_count - s_count)
                    t_count -= s_count
                    s_count = 0
                else:
                    # Tを全部使い切り、余ったSは引き継がれる
                    s_count -= t_count
                    t_count = 0
            s_count += 1
        else:
            # Tの場合
            t_count += 1

# 最後に
if t_count >= s_count:
    # Sを全て使い切り、余ったTは確定で残る
    after_x += "T" * (t_count - s_count)
    t_count -= s_count
    s_count = 0
else:
    # Tを全部使い切り、余ったSは引き継がれる
    s_count -= t_count
    t_count = 0
    after_x += "S" * s_count

ans = len(after_x) + s_count
print(ans)
Problem p02552 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
if a==1
 print(0);
else
 print(1);
Problem p03073 (python)

Fixed submission:
s = input()

x = 0
count0 = 0
count1 = 0

for i in s:
    if i == str(x):
        count0 += 1
    x = int(not(x))

x = 1
for i in s:
    if i == str(x):
        count1 += 1
    x = int(not(x))
#print("count0:" + str(count0))
#print("count1:" + str(count1))
print(min(count0, count1))

Buggy submission (verdict: Runtime Error):
s = input()
x, count0, count1 = 0
for i in s:
    count0 = count0+1 if i==str(x) else count0
    x = int(not(x))
x = 1
for i in s:
    count1 = count1 + 1 if i == str(x) else count1
    x = int(not(x))
print(min(count0, count1))
Problem p03041 (python)

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

if S[K-1] == "A":
    S[K-1] = "a"
elif S[K-1] == "B":
    S[K-1] = "b"
else:
    S[K-1] = "c"

for i in range(N):
    print(S[i], end="")

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

if S[K] == "A":
    S[K] = "a"
elif S[K] == "B":
    S[K] = "b"
else:
    S[K] = "c"

for i in range(N):
    print(S[i], end="")
Problem p03208 (python)

Fixed submission:
N, K = list(map(int, input().split()))
h = []
for i in range(N):
    h.append(int(input()))
else:
    h.sort()

hi = []
i = 0
while i + (K - 1) < N:
    hi.append(int(h[i + (K - 1)] - h[i]))
    i += 1

print(min(hi))

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
h = []
for i in range(N):
    h.append(int(input()))
else:
    h.sort()

hi = []
i = 0
while i + (K - 1) < N:
    hi.append(int(h[i + 2] - h[i]))
    i += 1

print(min(hi))
Problem p02624 (python)

Fixed submission:
N=int(input())
ans = 0
 
for i in range(1, N+1):
    num = N // i
    if num == 1:
        ans += i
    else:
        ans += num * (i + num * i) / 2
 
print(int(ans))

Buggy submission (verdict: Runtime Error):
import sympy

N = int(input())
ans = 0

for i in range(1,N+1):
    ans += i * sympy.divisor_count(i)

print(ans)
Problem p03250 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
max(10 * A + B + C, A + 10*B + C,　A + B + 10 * C)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split()
max(10*A + B + C,A+10*B+C,A+B+10*C)
Problem p03307 (python)

Fixed submission:
N = int(input())
if N % 2 != 0:
    N *= 2
print(N)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N % 2 != 0:
    n *= 2
print(N)
Problem p03315 (python)

Fixed submission:
S = list(input())
ans = 0

for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
ans = 0
for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 S = list(input())
ans = 0
for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 
print(ans)
Problem p02552 (python)

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

Buggy submission (verdict: Runtime Error):
tmp = input()
if tmp = "0":
  print("1")
else:
  print("0")
Problem p02594 (python)

Fixed submission:
if int(input()) >=30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if int(input()) >=30:
  print("Yes")
if else:
  print("No")
Problem p02570 (python)

Fixed submission:
D, T, S = map(int,input().split())
print('Yes') if T * S >= D else print('No')

Buggy submission (verdict: Runtime Error):
D, T, S = map(int(),input().split())
print('YES') if T * S >= D else print('No')
Problem p02627 (python)

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

Buggy submission (verdict: Runtime Error):
A = input()
print('A') if A.issuper() else print('a')
Problem p02552 (python)

Fixed submission:
x = int(input())

print(0 if x else 1)

Buggy submission (verdict: Runtime Error):
x = intZ(input())

print(0 if x else 1)
Problem p02627 (python)

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

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

if a.islower() == True:
  print('a')
else:
  print('A)
Problem p02629 (python)

Fixed submission:
N = int(input())
ans=''

for i in range(1, 99):
  if N <= 26 ** i:
    N -= 1
    for j in range(i):
      ans += chr(ord('a') + N % 26)
      N //= 26
    break
  else:
    N -= 26 ** i

print(ans[::-1]) # reversed

Buggy submission (verdict: Runtime Error):
N = int(input())
ans=''

for i in range(1, 99):
	if N <= 26 ** i:
      N -= 1
      for j in range(i):
        ans += chr(ord('a') + N % 26)
        N //= 26
      break
    else:
      N -= 26 ** i

print(ans[::-1]) # reversed
Problem p02707 (python)

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

L = []
for i in range(N):
  L.append(0)

for i in range(N-1):
  L[A[i]-1] += 1

for j in range(N):
  print(L[j])

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

L = []
for i in range(N-1):
  L.append(0)

for i in range(N-1):
  L[A[i]] += 1

for j in range(N-1):
  print(L[j])
Problem p02790 (python)

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

A = int(a * int(b))
B = int(b * int(a))

if A > B:
  print(A)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
T = input().split()

a = T[0]
b = T[1]

A = int(a * int(b))
B = int(b + int(a))

if A > B:
  print(A)
else:
  print(B)
  
print(B)

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

A = int(a * int(b))
B = int(b + int(a))

if A > B:
  print(A)
else:
  print(B)

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

A = int(a * int(b))
B = int(b + int(a))

if A > B:
  print(A)
else:
  print(B)
Problem p02572 (python)

Fixed submission:
n=int(input())
L=[int(x) for x in input().split()]
sum=0
product=0
mod=1000000007
for i in range(n):
    sum+=L[i]%mod
for i in range(n-1):
    sum-=(L[i]%mod)
    product+=sum*(L[i]%mod)
print(product%mod)

Buggy submission (verdict: Runtime Error):
L=[int(x) for x in input().split()]
sum=0
product=0
mod=1000000007
for i in range(n):
    sum+=L[i]%mod
for i in range(n-1):
    sum-=(L[i]%mod)
    product+=sum*(L[i]%mod)
print(product)

Buggy submission (verdict: Runtime Error):
L=[int(x) for x in input().split()]
sum=0
product=0
mod=1000000007
for i in range(n):
    sum+=L[i]%mod
for i in range(n-1):
    sum-=(L[i]%mod)
    product+=sum*(L[i]%mod)
print(product)
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int, input().split())
s = 0
if k <= a:
    s += k
else:
    s += a
if 0 < k-(a+b):
    s -= k-(a+b)
print(s)

Buggy submission (verdict: Runtime Error):
a,b,c,k = int(input())
total = a*1 + b*0 - c*1
print(int(total))
Problem p02754 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
w = ("b"*a + "r"*b)*(n//(a+b))
if n%(a+b) <= a:
    w += "b"*(n%(a+b))
else:
    w += "b"*a + "r"*((n%(a+b))-a)
print(w.count('b'))

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
w = ("b"*a + "r"*b)*(n//(a+b))
if n%(a+b) <= a:
    w += "b"*(n%(a+b))
print(w.count('b'))
Problem p02860 (python)

Fixed submission:
n = int(input())
s = str(input())
if n%2 == 1:
    print('No')
else:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
 = int(input())
s = str(input())
if n%2 == 1:
    print('No')
else:
    if s[:n//2] == s[n//2:]:
        print('Yes')
    else:
        print('No')
Problem p03041 (python)

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

k = k-1

for i in range(n):
  if i == k:
    x = s[i].lower()
    print(x,end="")
  else:
    print(s[i],end="")

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
s = list(map(str, input().split()))
k = k-1

for i in range(n):
  if i != k:
    print(s[i],end="")
  else:
    x = s[i].lower()
    print(x,end="")

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
s = list(map(str, input().split()))
k = k-1

for i in range(n):
  if i != k:
    print(s[i],end="")
  else:
    s[i].lower()
    print(s[i],end="")

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
s = list(map(str, input().split()))
k = k-1

for i in range(n):
  if i != k:
    print(s[i],end="")
  else:
    s[i].upper()
    print(s[i],end="")
Problem p03315 (python)

Fixed submission:
S = str(input())
list = list(S)
num = list.count('+')
print(num - (4-num))

Buggy submission (verdict: Runtime Error):
S = str(input())
list = lisr(S)
num = list.count('+')
print(num - (4-num))

Buggy submission (verdict: Runtime Error):
S = str(input())
list = lisr(S)
num = int(list.count('+'))
print('num - (4-num)')

Buggy submission (verdict: Runtime Error):
S = str(input())
list = lisr(S)
num = int(list.count('+'))
print('num - (4-num'))

Buggy submission (verdict: Runtime Error):
S = str(input())
list = lisr(S)
num = list.count('+')
print('num - (4-num)')

Buggy submission (verdict: Runtime Error):
S = str(input())
list = lisr(S)
num = list.count('+')
print(num - (4-num))

Buggy submission (verdict: Runtime Error):
S = map(str, input().split())
list = list(S)
a = int(list.count('+'))
b = ist(list.count('-'))
print('a-b')

Buggy submission (verdict: Runtime Error):
S = map(str, input())
list = list(S)
a = int(list.count('+'))
b = ist(list.count('-'))
print('a-b')
Problem p02594 (python)

Fixed submission:
a = int(input())
if a >= 30:
	print("Yes")
else:
  	print("No")

Buggy submission (verdict: Runtime Error):
a = int(intput())
if a >= 30:
  print("Yes")
else:
  print("No")
Problem p02777 (python)

Fixed submission:
s, _ = list(input().split())
a, b = list(map(int, input().split()))
u = input()
if s == u:
    a -= 1
else:
    b -= 1
print(a, end=' ')
print(b)

Buggy submission (verdict: Runtime Error):
s, _ = list(input().split())
a, b = list(map(int, input().split()))
u = input()
if s == u:
    a -= 1
else:
    b -= u
print(a, end=' ')
print(b)
Problem p02831 (python)

Fixed submission:
a, b = list(map(int, input().split()))
def gcd(a, b):
  if a < b:
    a, b = b, a
  else:
    pass
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)
  
print(a * b // gcd(a, b))

Buggy submission (verdict: Runtime Error):
import math
a, b = list(map(int,input().split()))
g = math.gcd(a, b)
print(a * b // g)
Problem p03075 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [
    b - a, c - a, d - a, e - a, c - b, d - b, e - b, d - c, e - c, e - d
]

for i in l:
    if i > k:
        print(":(")
        break
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [
    b - a, c - a, d - a, e - a, c - b, d - b, e - b, d - c, e - c, e - d
]


for i in l:
    if l[i] > k:
        print(":(")
        break
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [
    b - a, c - a, d - a, e - a, c - b, d - b, e - b, d - c, e - c, e - d
]


for i in l:
    if l[i] > k:
        print(":(")
        break
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [
    b - a, c - a, d - a, e - a, c - b, d - b, e - b, d - c, e - c, e - d
]


for i in l:
    print(i)
    if l[i] > k:
        print(":(")
        break
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
l = [
    b - a, c - a, d - a, e - a, c - b, d - b, e - b, d - c, e - c, e - d
]


for i in l:
    if l[i] > 15:
        print(":(")
        break
else:
    print("Yay!")
Problem p02624 (python)

Fixed submission:
import math
n=int(input())
ans=0
for i in range(1,n+1):
	x=math.floor(n/i)
	ans+=(x*(x+1)*i)/2
print(int(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(1,n+1):
	x=math.floor(n/i)
	ans+=(x*(x+1)*i)/2
print(int(ans))
Problem p02633 (python)

Fixed submission:
import math
n=int(input())
print(int(360/math.gcd(n,360)))

Buggy submission (verdict: Runtime Error):
n=int(input())
print(int(360/math.gcd(n,360)))

Buggy submission (verdict: Runtime Error):
n=int(input())
print(int(360/math.gcd(n,360)))
Problem p02622 (python)

Fixed submission:
s = input()
t = input()
c=0
for i in range(len(s)):
  if s[i] != t[i]:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
s = input()
c=0
for i in range(len(s)):
  if s[i] != t[i]:
    c += 1
print(c)
Problem p02659 (python)

Fixed submission:
import math
A,B = input().split()
A = int(A)
C1 = A*int(B[0])*100
C2 = A*int(B[2])*10
C3 = A*int(B[3])
Ans = C1+C2+C3
Ans = math.floor(Ans//100)
print(Ans)

Buggy submission (verdict: Runtime Error):
A,B = input().split()
A = int(A)
C1 = A*int(B[0])
C2 = A*int(B[2])*0.1
C3 = A*int(B[3])*0.01
Ans = C1+C2+C3
#print(C1)
#print(C2)
#print(C3)
Ans = math.floor(Ans)
print(Ans)
Problem p02688 (python)

Fixed submission:
N,K=map(int, input().split())
s=[]
for i in range(K):
    d=int(input())
    a=list(map(int, input().split()))
    for j in range(len(a)):
        s+=[a[j]]
s=set(s)
#print(s)
s=list(s)
#print(s)
s.sort()
#print(s)
print(N-len(s))

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
s=[]
for i in range(K):
    d=int(input())
    for j in range(d):
        s+=[int(input())]
s=set(s)
#print(s)
s=list(s)
#print(s)
s.sort()
#print(s)
print(N-len(s))

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
s=[]
for i in range(K):
    d=int(input())
    for j in range(d):
        s+=[int(input())]
s=set(s)
print(N-len(s))
Problem p02729 (python)

Fixed submission:
N, M = map(int, input().split())
print(int(N*(N-1)/2+M*(M-1)/2))

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
A = input().split()
for i in range(N):
    A[i] = int(A[i])
#print(A)
for i in range(N):
    B = A.copy()
    del B[i]
    #print(B)
    C = collections.Counter(B)
    #print(C)
    D = list(C.values())
    #print(D)
    E=0
    for j in range(len(D)):
        E+=int(D[j]*(D[j]-1)/2)
    print(E)
Problem p02777 (python)

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

Buggy submission (verdict: Runtime Error):
N,K=map(int, input().split())
A = list(map(int, input().split()))
B=0
for i in range(N-K+1):
    S = (sum(A[i:i+K])+K)/2
    if B<S:
        B=S
print(B)
Problem p02659 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = input().split()
A = int(A)
B = int(B.replace('.', ''))
print(a*b//100)
Problem p02577 (python)

Fixed submission:
n=int(input())

l=list(map(int,str(n)))

a=sum(l)

if a%9==0:
  print('Yes')
else:
  print('No')

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

l=list(map(int,str(n)))

a=sum(l)

if l%9==0:
  print('Yes')
else:
  print('No')
Problem p02725 (python)

Fixed submission:
import numpy as np

N,M=(int(x) for x in input().split())
A=list(map(int, input().split()))
A=np.array(A)
B=A[1:]-A[:-1]
b=max(B)
c=A[-1]-A[0]
if c > N/2:
    d=int(N-c)
else:
    d=c
e=max(b,d)
f=N-e

print(f)

Buggy submission (verdict: Runtime Error):
N,M=(int(x) for x in input().split())
A=list(map(int, input().split()))
A=np.array(A)
B=A[1:]-A[:-1]
b=max(B)
c=A[-1]-A[0]
if c > N/2:
    c=int(c-N/2)
else:
    c=c
d=max(b,c)
print(N-d)