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

Fixed submission:
N = input()
N = int(N)
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H.append( int(str[i]) )
flag = 0
ans = 0
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag =  1
      break
    else:
      flag = 0
  if flag == 0:
    ans = ans+1
  flag = 0

print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H.append( int(str[i]) )
flag
ans = 0
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag = 1
    else:
      flag = 0
  if flag == 0:
    ans = ans+1

print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H.append( int(str[i]) )
flag
ans = 0
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag = 1
    else:
      flag = 0
  if flag == 0:
    ans = ans+1

print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H.append( int(str[i]) )
flag = []
i = 0
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag.append(1)
    else:
      flag.append(0)
ans = 0
i = 0
for i in range(N):
  if flag[i] == 0:
    ans = ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H[i] = str[i]
flag = []
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag[i] = 1
    else:
      flag[i] = 0
ans = 0
for i in range(N):
  if flag[i] = 0:
    ans = ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
str = input().split()
H = []
for i range(N):
  H[i] = str[i]
flag = []
for i range(N):
  for j range(i):
    if H [i] < H[j]:
      flag[i] = 1
    else:
      flag[i] = 0
ans = 0
for i range(N):
  if flag[i] = 0:
    ans = ans+1
print(ans)
Problem p03075 (python)

Fixed submission:
A = []
for i in range(5):
  str = input()
  A.append(int(str))
K = int( input() )

if( A[4] - A[0] <= K):
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
A = []
for i in range(5):
  str = input()
  A[i] = int(str)
K = int( input() )

if( A[5] - A[0] > K):
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
str = input().split()
flag = 0
k = str[len(str)]
for i in range( 1,len(str) ):
  if str[i] - str[i-1] > k:
    flag = 1
if flag == 1:
  print(":(")
else:
  print("Yay!")
Problem p02785 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
attack_cnt = 0
 
desc_h = sorted(h, reverse=True)
end = k if k <= n else n
del desc_h[0:end]
 
print(sum(desc_h))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
attack_cnt = 0
 
desc_h = sorted(h, reverse=True)
for i in range(k):
  desc_h.pop(0)
 
print(sum(desc_h))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split())
attack_cnt = 0

desc_h = sorted(h, reverse=True)
for i in range(k):
  desc_h.pop(0)

print(sum(desc_h))
Problem p02819 (python)

Fixed submission:
x = input()

def is_sosu(num):
  st = 2
  while True:
    if num % st == 0:
      break
    st += 1
  if st == num:
    print(num)
    return
  is_sosu(num+1)

is_sosu(int(x))

Buggy submission (verdict: Runtime Error):
x = map(int, input())

def is_sosu(num):
  st = 2
  while st <= num:
    if num % st == 0:
      print(num)
      return
    st += 1
  else:
    st += 1
    if num == st:
      is_sosu(num+1)

is_sosu(x)

Buggy submission (verdict: Runtime Error):
x = map(int, input())

def is_sosu(num):
  st = 2
  if num % st == 0:
    print(num)
  else:
    st += 1
    if num == st:
      is_sosu(num+1)

is_sosu(x)

Buggy submission (verdict: Runtime Error):
x = map(int, input())

def is_sosu(num):
  st = 2
  if num % st == 0:
    print(num)
  st += 1
  if num == st:
    is_sosu(num+1)

is_sosu(x)
Problem p02912 (python)

Fixed submission:
import heapq as hp
def solution():
    n, m = map(int, input().split())
    a = [int(aa) * -1 for aa in input().split()]
    hp.heapify(a)
    for i in range(m):
        hp.heappush(a, (hp.heappop(a)*-1 // 2) * -1)
    print(abs(sum(a)))

solution()

Buggy submission (verdict: Runtime Error):
import numpy

def solution():
    n, m = map(int, input().split())
    a = [int(aa) for aa in input().split()]
    a.sort(reverse=True)
    for i in range(m):
        a[0] = a[0] // 2
        numpy.np.sort(a)[::-1]
    print(sum(a))

solution()

Buggy submission (verdict: Runtime Error):
import numpy

def solution():
    n, m = map(int, input().split())
    a = [int(aa) for aa in input().split()]
    a.sort(reverse=True)
    for i in range(m):
        a[0] = a[0] // 2
        numpy.np.sort(a)[::-1]
    print(sum(a))

solution()
Problem p02682 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
if(k<=a):
    print(k)
elif(k<=(a+b)):
    print(a)
else:
    x=k-(a+b)
    print(z-x)
Problem p02627 (python)

Fixed submission:
a = input()
print('A' if 'A' <= a <= 'Z' else 'a')

Buggy submission (verdict: Runtime Error):
2
1 2
3
1 100
2 100
100 1000
Problem p02629 (python)

Fixed submission:
def amari(x):
    if x == 0:
        return 'a'
    elif x == 1:
        return 'b'
    elif x == 2:
        return 'c'
    elif x == 3:
        return 'd'
    elif x == 4:
        return 'e'
    elif x == 5:
        return 'f'
    elif x == 6:
        return 'g'
    elif x == 7:
        return 'h'
    elif x == 8:
        return 'i'
    elif x == 9:
        return 'j'
    elif x == 10:
        return 'k'
    elif x == 11:
        return 'l'
    elif x == 12:
        return 'm'
    elif x == 13:
        return 'n'
    elif x == 14:
        return 'o'
    elif x == 15:
        return 'p'
    elif x == 16:
        return 'q'
    elif x == 17:
        return 'r'
    elif x == 18:
        return 's'
    elif x == 19:
        return 't'
    elif x == 20:
        return 'u'
    elif x == 21:
        return 'v'
    elif x == 22:
        return 'w'
    elif x == 23:
        return 'x'
    elif x == 24:
        return 'y'
    elif x == 25:
        return 'z'
    
N = int(input())
K = 0
k = 0
i = 0
my_str = []
while True:
    if  k <= N <= K:
        N = N - k #number in the floor
        for j in range(i): # i=length of the coded name
            my_str.append(amari(N % 26))
            N = N // 26
        strA = ''.join(my_str[::-1])
        print(strA)
        exit()
    else:
        i += 1
        k = K + 1
        K += 26 ** i

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

def amari(x):
    if x == 1:
        return 'a'
    elif x == 2:
        return 'b'
    elif x == 3:
        return 'c'
    elif x == 4:
        return 'd'
    elif x == 5:
        return 'e'
    elif x == 6:
        return 'f'
    elif x == 7:
        return 'g'
    elif x == 8:
        return 'h'
    elif x == 9:
        return 'i'
    elif x == 10:
        return 'j'
    elif x == 11:
        return 'k'
    elif x == 12:
        return 'l'
    elif x == 13:
        return 'm'
    elif x == 14:
        return 'n'
    elif x == 15:
        return 'o'
    elif x == 16:
        return 'p'
    elif x == 17:
        return 'q'
    elif x == 18:
        return 'r'
    elif x == 19:
        return 's'
    elif x == 20:
        return 't'
    elif x == 21:
        return 'u'
    elif x == 22:
        return 'v'
    elif x == 23:
        return 'w'
    elif x == 24:
        return 'x'
    elif x == 25:
        return 'y'
    elif x == 26:
        return 'z'

i = 1
my_str = []
while True:
    if 26 ** i > N:
        if i == 1:
            print(amari(N))
            exit()
        for j in range(i - 2 + 2):
            t = amari(N // (26 ** (1 + i - 2 - j)))
            my_str.append(t)
            N -= ((26 ** (1 + i - 2 - j) *  (N // (26 ** (1 + i - 2 - j)))))
        strA = "".join(my_str)
        print (strA)
        exit()
    i += 1
Problem p02659 (python)

Fixed submission:
import numpy as np 
A,B = map(str,input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
print(int(A*B//100))

Buggy submission (verdict: Runtime Error):
import numpy as np 
A,B = map(str,input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
print(int(A*C//100))

Buggy submission (verdict: Runtime Error):
import numpy as np 
A,B = map(float,input().split())
print(numpy.trunc(A*B))
Problem p02723 (python)

Fixed submission:
A = input()

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

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

if A[0]!=A[1]!=A[2]!=A[4] andA[0]!=A[1]!=A[3]!=A[5] and  A[2]==A[3] and A[4] == A[5]:
    print("Yes")
else:
    print("No")
Problem p02725 (python)

Fixed submission:
K,N  =list(map(int,input().split()))
A = list(map(int,input().split()))
C = list()
ans = int()
B = list(sorted(A))
for i in range(len(B)-1):
    C.append(B[i+1]-B[i])
C.append((K-B[-1])+(B[0]))
C = sorted(C)
for i in range(N-1):
    ans += C[i]
print(ans)

Buggy submission (verdict: Runtime Error):
K,N  =list(map(int,input().split()))
A = list(map(int,input().split()))
C = list()
ans = int()
A.append(K)
A.append(int(0))
B = list(sorted(A))
for i in range(len(B)-1):
    C.append(B[i+1]-B[i])
C.remove(0)
C = sorted(C)
print(C)
for i in range(N-1):
    ans += C[i]
print(ans)
Problem p02779 (python)

Fixed submission:
N = input()
M = list(map(int,input().split()))
X = set(M)
Y = len(X)
Z = len(M)
if Y == Z:
    print("YES")

else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N = input()
M = list(map(int,input().split()))
X = set(M)
Y = len(X)

if N == Y:
    print("YES")
    
else:
    print("NO")
Problem p02847 (python)

Fixed submission:
a = input()
if a == "SUN":
  print("7")
elif a == "MON":
  print("6")
elif a == "TUE":
  print("5")
elif a == "WED":
  print("4")
elif a == "THU":
  print("3")
elif a == "FRI":
  print("2")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
a = input()
if a = SUN:
  print("7")
elif a = MON:
  print("6")
elif a = TUE:
  print("5")
elif a = WED:
  print("4")
elif a = THU:
  print("3")
elif a = FRI:
  print("2")
else:
  print("1")
Problem p02881 (python)

Fixed submission:
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))+1):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = []
i = 2
a = int()
b = int()
ans = 10**12+1
for i in range(2,int(np.sqrt(N))):
    if N%i ==0:
        A.append(i)

if len(A) == 0:
    print(N-1)
else:
    for j in range(len(A)):
        a = A[j]-1
        b = (N/A[j])-1
        if a+b <= ans:
            ans = a+b
    print(int(ans))
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print("red")

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

if b <3200:
  print("red")
else:
  print(a)
Problem p03041 (python)

Fixed submission:
a, b = list(map(int,input().split()))
S = list(str(input()))
S[b-1] = str.lower(S[b-1])
S = "".join(map(str,S))
print(S)

Buggy submission (verdict: Runtime Error):
a, b = list(map(int,input().split()))
S = list(str(input()))
S[a+1] = str.lower(S[a+1])
S = "".join(map(str,S))
print(S)
Problem p02682 (python)

Fixed submission:


import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

"""
# 文字列（数値変換も含む）
n = readline().rstrip() # １行に１文字列のみ
lis = readline().rstrip().split() # # １行に複数の文字列

# 数値（文字変換も含む）
n = int(readline().rstrip()) # １行に数値１個のみ
a, b, c = map(int,readline().rstrip().split()) # １行に複数の数値
A = list(map(int,readline().rstrip().split()))  # １行に複数の数値（リスト受け取り）
lis = [readline().rstrip().split() for _ in range(n)] # １行に複数の数値(m個)かつ、n行続く場合（出力は二次元リスト：[['1', '2'], ['4', '5']]）

# 一行に文字列が一個 * n行
s_lis=[readline().rstrip().decode() for _ in range(n)] # .decodeはバイト列から文字列へ変換
# 一行に文字列が一個 * n行で文字列をアルファベット順に変換
s_lis=["".join(sorted(readline().rstrip().decode())) for _ in range(n)]
# 一行に文字列が複数個 * n行
s_lis=[readline().rstrip().split().decode() for _ in range(n)] # .decodeはバイト列から文字列へ変換

# 一行に数値が一個 * n行
s_lis=[int(readline().rstrip()) for _ in range(n)] 
# 一行に数値が複数個 * n行
s_lis=[int(readline().rstrip().split()) for _ in range(n)]

# dとAの行が交互に並んでいる場合
s = sys.stdin.readlines()
n, k=map(int, s[0].split())
d=[]
A=[]
for i in s[1:2*k:2]:
    d.append(int(i))
for i in s[2:2*k+1:2]:
    A.append(list(map(int, i.split())))
"""

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

if k<=a:
    print(k)

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

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

Buggy submission (verdict: Runtime Error):


import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

"""
# 文字列（数値変換も含む）
n = readline().rstrip() # １行に１文字列のみ
lis = readline().rstrip().split() # # １行に複数の文字列

# 数値（文字変換も含む）
n = int(readline().rstrip()) # １行に数値１個のみ
a, b, c = map(int,readline().rstrip().split()) # １行に複数の数値
A = list(map(int,readline().rstrip().split()))  # １行に複数の数値（リスト受け取り）
lis = [readline().rstrip().split() for _ in range(n)] # １行に複数の数値(m個)かつ、n行続く場合（出力は二次元リスト：[['1', '2'], ['4', '5']]）

# 一行に文字列が一個 * n行
s_lis=[readline().rstrip().decode() for _ in range(n)] # .decodeはバイト列から文字列へ変換
# 一行に文字列が一個 * n行で文字列をアルファベット順に変換
s_lis=["".join(sorted(readline().rstrip().decode())) for _ in range(n)]
# 一行に文字列が複数個 * n行
s_lis=[readline().rstrip().split().decode() for _ in range(n)] # .decodeはバイト列から文字列へ変換

# 一行に数値が一個 * n行
s_lis=[int(readline().rstrip()) for _ in range(n)] 
# 一行に数値が複数個 * n行
s_lis=[int(readline().rstrip().split()) for _ in range(n)]

# dとAの行が交互に並んでいる場合
s = sys.stdin.readlines()
n, k=map(int, s[0].split())
d=[]
A=[]
for i in s[1:2*k:2]:
    d.append(int(i))
for i in s[2:2*k+1:2]:
    A.append(list(map(int, i.split())))
"""

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

if k<=a:
    print(k)

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

else:
    print(a+b-c)
Problem p02695 (python)

Fixed submission:
import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M, Q = map(int, readline().split())

# 1～Mまでの数を複数回用いて、長さNの要素の部分列返す
#（combinations：複数使用なし、combinations_with_replacement：複数使用あり）
A = np.array(list(itertools.combinations_with_replacement(range(1, M + 1), N)))

n = len(A) # 組合せ総数
score = np.zeros(n, np.int32) # [0,0,...,0] :0が n個のaraay

m = map(int, read().split())
for a, b, c, d in zip(m, m, m, m):
    cond = A[:, b - 1] - A[:, a - 1] == c
    score += d * cond

print(score.max())

Buggy submission (verdict: Runtime Error):

import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M, Q = map(int, readline().split())

# 1～Mまでの数を複数回用いて、長さNの要素の部分列返す
#（combinations：複数使用なし、combinations_with_replacement：複数使用あり）
A = np.array(list(itertools.combinations_with_replacement(range(1, M + 1), N)))

n = len(A) # 組合せ総数
score = np.zeros(n) [0,0,...,0] # 0が n個のaraay

m = map(int, read().split())
for a, b, c, d in zip(m, m, m, m):
    cond = A[:, b - 1] - A[:, a - 1] == c
    score += d * cond

print(score.max())
Problem p02712 (python)

Fixed submission:


N = int(input())

fizzbuzz = []

for i in range(1, N+1):
    if i % 3 == 0 or i % 5 == 0:
        fizzbuzz.append('0')
    else:
        fizzbuzz.append(str(i))

num = [int(s) for s in fizzbuzz]
print(sum(num))

Buggy submission (verdict: Runtime Error):


N = int(input())

fizzbuzz = []

for i in range(1, N):
    if i % 15 == 0:
        fizzbuzz.append('0')
    elif i % 3 == 0:
        fizzbuzz.append('0')
    elif i % 5 == 0:
        fizzbuzz.append('0')
    else:
        fizzbuzz.append(str(i))

num = [int(s) for s in fizzbuzz]
print(int(sum(num))L)

Buggy submission (verdict: Runtime Error):

import sys
sys.setrecursionlimit(10**6)
N = int(input())

fizzbuzz = []

for i in range(1, N):
    if i % 15 == 0:
        fizzbuzz.append('0')
    elif i % 3 == 0:
        fizzbuzz.append('0')
    elif i % 5 == 0:
        fizzbuzz.append('0')
    else:
        fizzbuzz.append(str(i))

num = [int(s) for s in fizzbuzz]
print(int(sum(num))
Problem p02729 (python)

Fixed submission:

from math import factorial

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

def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

if M > 1 and N > 1:
    sum_n = combinations_count(M, 2) + combinations_count(N, 2)

elif M > 1:
    sum_n = combinations_count(M, 2)

elif N > 1:
    sum_n = combinations_count(N, 2)

else:
    sum_n = 0

print(sum_n)

Buggy submission (verdict: Runtime Error):

from math import factorial

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

def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

sum_n = combinations_count(M, 2) + combinations_count(N, 2)
print(sum_n)
Problem p02773 (python)

Fixed submission:
from collections import Counter

stdin = open(0)
N = int(stdin.readline())
S = stdin.read().split()

counter = Counter(S)
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()

print(*names, sep='\n')

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from collections import Counter
readline = sys.stdin.buffer.readline # 一行読み込み

n=int(input())
s=["".join(readline().rstrip()) for _ in range(n)]
print(s)

counter = Counter(s)
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()

print(*names, sep='\n')

Buggy submission (verdict: Runtime Error):

import sys
from collections import Counter
readline = sys.stdin.buffer.readline # 一行読み込み

n=int(input())
s=["".join(readline().rstrip()) for _ in range(n)]
print(s)

counter = Counter(s)
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()

print(*names, sep='\n')

Buggy submission (verdict: Runtime Error):

from collections import Counter

n=int(input())
s=list(input(i).split() for i in range(n))

counter = Counter(s)
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()

print(*names, sep='\n')

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input(i) for i in range(n))

counter = Counter(s)
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()

print(*names, sep='\n')
Problem p02836 (python)

Fixed submission:

s = input()
n = len(s)
nn = -(-n//2)
ans = 0
for i in range(nn):
    if not s[i] == s[n-i-1]:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):

s = input()
n = len(s)
nn = -(-n/2)
ans = 0
for i in range(nn):
    if not s[i] == s[n-i-1]:
        ans += 1
print(ans)
Problem p02915 (python)

Fixed submission:

n=int(input())
print(n**3)

Buggy submission (verdict: Runtime Error):

n=int(input())
print(N**3)
Problem p02951 (python)

Fixed submission:

a,b,c=map(int,input().split())
if b+c<=a:
    print(0)

else:
    print(c+b-a)

Buggy submission (verdict: Runtime Error):

a,b,c=map(int,input().split())
if b+c<=a:
    print(0)

else:
    print(c+b-a))
Problem p02987 (python)

Fixed submission:

s=list(input())
import collections
s = collections.Counter(s)
if list(s.values())==[2,2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

s=list(input())
c = collections.Counter(s)
if list(c.values())==[2,2]:
    print("Yes")
else:
    print("No")
Problem p02688 (python)

Fixed submission:
n,k = map(int,input().split())
sunuke=[0]*n
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for j in a:
        sunuke[j-1]+=1

print(sunuke.count(0))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d=[]
for i in range(k*2):
    d.append(list(map(int,input().split())))

ans=[]
for i in range(1,len(d),2):
    ans.append(*d[i])

ans=len(set(ans))
print(n-ans)
Problem p02831 (python)

Fixed submission:
from fractions import gcd
a,b=map(int,input().split())
gcd=gcd(a,b)
ans=a*b//gcd
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
gcd=math.gcd(a,b)
ans=a*b//gcd
print(int(ans))

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

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

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

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

Buggy submission (verdict: Runtime Error):
S,T = map(str,input().split())
A,B = map(str,input().split())
U = input()
if U == S:
  print(A-1 B)
else:
  print(A B-1)
Problem p02785 (python)

Fixed submission:
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
if N>K:
  for i in range(K):
    H[i]=0
  count = sum(H)
  print(count)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
for i in range(K):
  H[i]=0
count = sum(H)
print(count)
Problem p02829 (python)

Fixed submission:
A=int(input())
B=int(input())
ans = 6-A-B
print(ans)

Buggy submission (verdict: Runtime Error):
A=input()
B=input()
if A!=1 and B!=1:
  print(1)
elif A!=2 and B!=2:
  print(2)
else A!=3 and B!=3:
  print(3)
Problem p02881 (python)

Fixed submission:
N = int(input())
a = []
for i in range(1,int(N**0.5+1)):
    if N%i == 0:
        x = i+N//i
        a.append(x)
print(min(a)-2)

Buggy submission (verdict: Runtime Error):
def prime_factorization(N):
    a = []
    while N%2 == 0:
        a.append(2)
        N//= 2
    f = 3
    while f*f <= N:
        if N%f == 0:
            a.append(f)
            N//= f
        else:
            f+= 2
    if N != 1:
        a.append(N)
    return(a)

N = int(input())

a = prime_factorization(N)
Length = len(a)
if Length%2 == 0:
    for i in range(Length-Length/2):
        x = a[Length/2]*a[Length/2+i]
else:
    for i in range(Length-int(Length/2)):
        x = a[int(Length/2)-1]*a[int(Length/2)+i-1]
y = N//x
print(x+y-2)
Problem p03208 (python)

Fixed submission:
N,K = map(int,input().split())
h = [0]*N
hmax = 0
hmin = 0
H = [0]*(N-K+1)
for i in range(N):
  h[i] = int(input())
h.sort()
for i in range(N-K+1):
  hmin = h[i]
  hmax = h[i+K-1]
  H[i] = hmax-hmin
print(min(H))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
h = [0]*N
hmax = 0
hmin = 0
H = [0]*(N//K+2)
for i in range(N):
  h[i] = int(input())
h.sort()
for i in range(N//K+2):
  hmin = h[i]
  hmax = h[i+K-1]
  H[i] = hmax-hmin
print(min(H))