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

Fixed submission:
N,K=(int(x) for x in input().split())
H=list(map(int, input().split()))
A = sorted(H)
i=0
a=N-K
if K >= N:
    print('0')

else:
    B=A[:a]
    C=sum(B)
    print(C)

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in input().split())
H=list(map(int, input().split()))
A = sorted(H, reverse=True)
i=0

if K >= N:
    print('0')
else:
    
    for i in range(K):
        A.pop(i)
        i=i+1
    B=sum(A)
    print(B)

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in input().split())
H=list(map(int, input().split()))

i=0

if K >= N:
    print('0')
else:
    A = sorted(H, reverse=True)
    for i in range(K):
        A.pop(i)
        i=i+1
    B=sum(A)
    print(B)
Problem p02862 (python)

Fixed submission:
p = 10**9 + 7

def pow_mod(p,a,n):
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * a) % p
        n = n // 2
        a = (a*a)%p
    return res


def comb_mod(n,k):
    global fac
    res = fac[n] * pow_mod(p,fac[k],p-2) * pow_mod(p,fac[n-k],p-2) % p
    return res

X,Y = map(int,input().split())
X,Y = max(X,Y),min(X,Y)
n = (X+Y)//3

fac = [1]
foo = 1
for i in range(1,n+1):
    foo = (foo*i)%p
    fac.append(foo)

k = 2*n - X
if (X+Y)%3 != 0 or n < k or k < 0:
    ans = 0
else:
    ans = comb_mod(n,k)

print(ans)

Buggy submission (verdict: Runtime Error):
p = 10**9 + 7

def pow_mod(p,a,n):
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * a) % p
        n = n // 2
        a = (a*a)%p
    return res


def comb_mod(n,k):
    global fac
    res = fac[n] * pow_mod(p,fac[k],p-2) * pow_mod(p,fac[n-k],p-2) % p
    return res

X,Y = map(int,input().split())
X,Y = max(X,Y),min(X,Y)
n = (X+Y)//3

fac = [1]
foo = 1
for i in range(1,n+1):
    foo = (foo*i)%p
    fac.append(foo)

k = 2*n - X
if (X+Y)%3 != 0 or n < k:
    ans = 0
else:
    ans = comb_mod(n,k)
print(ans)
Problem p02955 (python)

Fixed submission:
N,K = map(int,input().split())
A = [int(i) for i in input().split()]
S = sum(A)

def searchPrimeNum(N):
    max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

plis = searchPrimeNum(40000)

lis = []
for p in plis:
    if S%p == 0:
        lis.append([p,1])
        S = S//p
        while S%p == 0:
            lis[-1][1] += 1
            S = S//p
    if S == 1:
        break
if S != 1:
    lis.append([S,1])

yakulis =[1]
for l in lis:
    for j in range(len(yakulis)):
        for k in range(l[1]):
            n = yakulis[j]
            yakulis.append(l[0]**(k+1)*n)
yakulis.sort(reverse=True)

s = True
for r in yakulis:
    B = [i%r for i in A]
    B.sort()
    le = -1
    ri = N
    while ri-le > 1:
        mid = (le+ri)//2
        pl = sum(B[:mid+1])
        mi = r*(N-1-mid) - sum(B[mid+1:])
        if pl > mi:
            ri = mid
        else:
            le = mid
    k = sum(B[:le+1])
    if k <= K:
        s = False
        print(r)
        break
if s:
    print(1)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [int(i) for i in input().split()]
S = sum(A)

def searchPrimeNum(N):
    max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

plis = searchPrimeNum(40000)

lis = []
for p in plis:
    if S%p == 0:
        lis.append([p,1])
        S = S//p
        while S%p == 0:
            lis[-1][1] += 1
            S = S//p
    if S == 1:
        break
if S != 1:
    lis.append([[S,1]])

yakulis =[1]
for l in lis:
    for j in range(len(yakulis)):
        for k in range(l[1]):
            n = yakulis[j]
            yakulis.append(l[0]**(k+1)*n)
yakulis.sort(reverse=True)

s = True
for r in yakulis:
    B = [i%r for i in A]
    B.sort()
    le = -1
    ri = N
    while ri-le > 1:
        mid = (le+ri)//2
        pl = sum(B[:mid+1])
        mi = r*(N-1-mid) - sum(B[mid+1:])
        if pl > mi:
            ri = mid
        else:
            le = mid
    k = sum(B[:le+1])
    if k <= K:
        s = False
        print(r)
        break
if s:
    print(1)
Problem p03011 (python)

Fixed submission:
l =[int(i) for i in input().split()]
l.sort()
print(l[0]+l[1])

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

Fixed submission:

import sys
imput =sys.stdin.readline

p = 10**9 + 7

N,M =map(int,input().split())
lis = [0]*N

for _ in range(M):
    i = int(input())-1
    lis[i] = -1


if lis[0]!=-1:
    lis[0] =1
if N != 1:
    if lis[1]!=-1:
        lis[1] =1 + max(0,lis[0])

for i in range(N-2):
    i += 2
    if lis[i]!=-1:
        lis[i]= (max(0,lis[i-1])+max(0,lis[i-2]))%p

print(max(0,lis[-1]))

Buggy submission (verdict: Runtime Error):

import sys
imput =sys.stdin.readline

p = 10**9 + 7

N,M =map(int,input().split())
lis = [0]*N

for _ in range(M):
    i = int(input())-1
    lis[i] = -1


if lis[0]!=-1:
    lis[0] =1
if lis[1]!=-1:
    lis[1] =1 + max(0,lis[0])

for i in range(N-2):
    i += 2
    if lis[i]!=-1:
        lis[i]= (max(0,lis[i-1])+max(0,lis[i-2]))%p

print(lis[-1])
Problem p03127 (python)

Fixed submission:
def kumitate(a,b):
    a,b =max(a,b),min(a,b)
    while b != 0:
        a,b = b,a%b
    return a

N =int(input())
l =[int(i)for i in input().split()]
l =sorted(l)
mini =l[0]
for i in l:
    mini = kumitate(mini,i)
print(mini)

Buggy submission (verdict: Runtime Error):
N =int(input())
l =[int(i)for i in input().split()]
l =sorted(l)
min =l[0]
for i,st in enumerate(l):
    st = st % min
    if st==0:
        l.pop(i)
    elif st < min:
        min = min(st,min%st)
print(min)
Problem p02695 (python)

Fixed submission:
from itertools import combinations_with_replacement

N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]

ans = 0
for v in combinations_with_replacement(range(1, M+1), N):
    A = list(v)
    temp = 0
    for a, b, c, d in abcd:
        if A[b-1] - A[a-1] == c:
            temp += d
    ans = max(ans, temp)

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]

lis = list(range(1, M+1))
box = list(combinations(lis, N))
print(abcd)

ans = []
for i in box:
    temp = 0
    for a, b, c, d in abcd:
        if i[b-1] - i[a-1] == c:
            temp += d
    ans.append(temp)

print(max(ans))
Problem p02948 (python)

Fixed submission:
import heapq

N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
kouho = []
ans = 0

AB = sorted(AB)

# 後ろから見て優先度付きキューで取り出す
n = 0
heapq.heapify(kouho)
for i in range(1, M+1):
    if n < N:
        while AB[n][0] <= i:
            heapq.heappush(kouho, AB[n][1] * (-1))
            n += 1
            if n >= N:
                break
    
    if kouho:
        b = heapq.heappop(kouho)
        ans += b*(-1)
    
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
box = []
for i in range(N):
    box.append(list(map(int, input().split())))
box = sorted(box, reverse=True, key=lambda x: x[0])
box = sorted(box, reverse=True, key=lambda x: x[1])

ans = 0

for i in range(M):
    if i == 0:
        j = 0
    while box[j][0] > M - i:
        j += 1
        if j >= N-1:
            break
    else:
        ans += box[j][1]
        j += 1
        if j >= N-1:
            break

print(ans)
Problem p02954 (python)

Fixed submission:
S = list(str(input()))
ls = len(S)
a = [1]*ls
for i in range(ls-2):
    if S[i] == S[i+1] == "R":
        a[i+2] += a[i]
        a[i] = 0
for i in range(ls)[::-1]:
    if S[i] == S[i-1] == "L":
        a[i-2] += a[i]
        a[i] = 0
print(" ".join(map(str, a)))

Buggy submission (verdict: Runtime Error):
S = input()
ls = len(S)
box = [1]*ls

Sc = S
Sc = Sc.replace("RL", "X")

counter = 0
mval = 0


for i in Sc:
    if i != "X":
        counter += 1
        mval = max(counter, mval)
    else:
        counter = 0

if mval % 2 == 0:
    pass
else:
    mval += 1


for i in range(mval):
    boxc = box.copy()
    for j, k in enumerate(S):
        if box[j] == 0:
            continue

        if k == "R":
            box[j+1] += boxc[j]
            box[j] -= boxc[j]
        else:
            box[j-1] += boxc[j]
            box[j] -= boxc[j]

print(' '.join(map(str, box)))

Buggy submission (verdict: Runtime Error):
S = input()
ls = len(S)
box = [1]*ls

Sc = S
Sc = Sc.replace("RL", "X")

counter = 0
mval = 0


for i in Sc:
    if i != "X":
        counter += 1
        mval = max(counter, mval)
    else:
        counter = 0

if mval % 2 == 0:
    pass
else:
    mval += 1


for i in range(mval):
    boxc = box.copy()
    for j, k in enumerate(S):
        if box[j] == 0:
            continue

        if k == "R":
            box[j+1] += boxc[j]
            box[j] -= boxc[j]
        else:
            box[j-1] += boxc[j]
            box[j] -= boxc[j]

print(*box)

Buggy submission (verdict: Runtime Error):
S = input()
ls = len(S)
box = [1]*ls

Sc = S
Sc = Sc.replace("RL", "X")

counter = 0
mval = 0

print(Sc)

for i in Sc:
    if i != "X":
        counter += 1
        mval = max(counter, mval)
    else:
        counter = 0

if mval % 2 == 0:
    pass
else:
    mval += 1


for i in range(mval):
    boxc = box.copy()
    for j, k in enumerate(S):
        if box[j] == 0:
            continue

        if k == "R":
            box[j+1] += boxc[j]
            box[j] -= boxc[j]
        else:
            box[j-1] += boxc[j]
            box[j] -= boxc[j]

print(*box)
Problem p02990 (python)

Fixed submission:
# ABC132 D Blue and Red Balls

def comb(n, r):
    if n == 0 or r == 0:
        return 1
    if n < r:
        return 0
    a = b = 1
    r = min(n-r, r)
    for i in range(n-r+1,n+1):
        a*=i
    for i in range(1,r+1):
        b*=i
    
    return a//b

N, K = map(int, input().split())
MOD = int(1e9)+7

for i in range(1, K+1):
    temp = comb(N-K+1, i) * comb(K-1, i-1)
    print(int(temp % MOD))

Buggy submission (verdict: Runtime Error):
# ABC132 D Blue and Red Balls

from math import factorial

def comb(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

N, K = map(int, input().split())
MOD = int(1e9)+7

for i in range(1, K+1):
    temp = comb(N-K+1, i) * comb(K-1, i-1)
    print(int(temp % MOD))

Buggy submission (verdict: Runtime Error):
# ABC132 D Blue and Red Balls

from scipy.misc import comb

N, K = map(int, input().split())
MOD = int(1e9)+7

for i in range(1, K+1):
    temp = comb(N-K+1, i) * comb(K-1, i-1)
    print(int(temp % MOD))

Buggy submission (verdict: Runtime Error):
# ABC132 D Blue and Red Balls

from scipy.special import comb

N, K = map(int, input().split())
MOD = int(1e9)+7

for i in range(1, K+1):
    temp = comb(N-K+1, i) * comb(K-1, i-1)
    print(int(temp % MOD))
Problem p03013 (python)

Fixed submission:
import sys

n, m = map(int, input().split())
aaa = set()
if m != 0:
    for _ in range(m):
        aaa.add(int(input()))
    
    
dp = [0] * (n + 1) # 0 array
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0 # 入ってはいけない段に1が存在した場合は0
MOD = int(1e9) + 7

for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i-2] + dp[i-1]) % MOD # 入ってはいけないところからの遷移の場合0を加算
print(dp[n])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
MOD = int(1e9) + 7

stair = []
for i in range(N):
    if i+1 in a:
        stair.append(False)
    else:
        stair.append(True)

# DP
dp = [0] * N
if stair[0]:
    dp[0] = 1
if stair[1]:
    dp[1] = dp[0] + 1
else:
    dp[1] = 0

for i in range(2, N):
    if not stair[i]:
        dp[i] = 0
        continue
    if stair[i-1] and stair[i-2]:
        dp[i] = dp[i-1] + dp[i-2]
    elif stair[i-1]:
        dp[i] = dp[i-1]
    elif stair[i-2]:
        dp[i] = dp[i-2]
        
print(dp[N-1] % MOD)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(M)]
A = sorted(A)
bc = sorted(bc, reverse=True, key=lambda x:x[1])
i = 0
for b, c in bc:
    while A[i] <= c and b > 0:
        A[i] = c
        b -= 1
        i += 1
        if i >= N:
            break
    if i >= N:
        break
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(M)]
A = sorted(A)
bc = sorted(bc, reverse=True, key=lambda x:x[1])
i = 0
for b, c in bc:
    while A[i] <= c and b > 0:
        A[i] = c
        b -= 1
        i += 1
        if i >= N:
            break
print(sum(A))
Problem p03127 (python)

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

As = sorted(A)
As = [a%As[0] if a%As[0] != 0 else As[0] for a in As]
As = sorted(As)

def judge(tmp_one, tmp_two):
    flg = 1

    while flg:
        if tmp_two%tmp_one == 0:
            tmp_two = tmp_one
        else:
            tmp_two = tmp_two%tmp_one

        if tmp_one%tmp_two == 0:
            tmp_one = tmp_two
        else:
            tmp_one = tmp_one%tmp_two
        if tmp_one == tmp_two:
            flg = 0

    return tmp_one

tmp_one = As[0]
for i in range(1, N):
    if i == N - 1:
        tmp_two = As[i]
    elif As[i] != As[0]:
        tmp_two = As[i]
        break

ans = judge(tmp_one, tmp_two)
print(ans)

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

As = sorted(A)
As = [a%As[0] if a%As[0] != 0 else As[0] for a in As]
As = sorted(As)

def judge(tmp_one, tmp_two):
    flg = 1
    
    while flg:
        if tmp_two % tmp_one == 0:
            tmp_two = tmp_one
        else:
            tmp_two = tmp_two % tmp_one
            
        if tmp_one % tmp_two == 0:
            tmp_one = twp_two
        else:
            tmp_one = tmp_one % tmp_two
        if tmp_one == tmp_two:
            flg = 0
            
        return tmp_one
tmp_one = As[0]
for i in range(1, N):
    if i == N  - 1:
        tmp_two = As[i]
    elif As[i] != As[0]:
        tmp_two = As[i]
        break
        
ans = judge(tmp_one, tmp_two)
print(ans)

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

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

print(gcd(*A))
Problem p03252 (python)

Fixed submission:
#ABC110 C String Transformation

S = input()
T = input()

StoT = {}
TtoS = {}

for s, t in zip(S, T):
    if s in StoT.keys():
        if StoT[s] != t:
            print('No')
            exit()
    elif t in TtoS.keys():
        if TtoS[t] != s:
            print('No')
            exit()
    else:
        StoT[s] = t
        TtoS[t] = s
        
print('Yes')

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

S = input()
T = input()
L=len(S)
dds = defaultdict(int)
ddt = defaultdict(int)
for i in range(L):
  s = S[i]
  t = T[i]
  if dds[s] == 0:
    dds[s] = t
  else:
    if dds[s] != t:
      print("No")
      sys.exit()
      
  if ddt[t] == 0:
    ddt[t] = s
  else:
    if ddt[t] != s:
      print("No")
      sys.exit()
      
print("Yes")
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
if W >= S:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)
count = 0
for i in range(0, N):
    for j in range(i+1, N+1):
        if int(S[i:j]) % 2019 == 0:
            count += 1

print(count)
Problem p02881 (python)

Fixed submission:
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

yakusu = make_divisors(n)

answers = []
for i in range(len(yakusu)):
    answers.append(yakusu[i] + yakusu[-(i+1)] - 2)

print(min(answers))

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

yakusu = make_divisors(n)

k = (len(yakusu)-1)//2
a = yakusu[k] + yakusu[k+1] -2

if len(yakusu) <= 2:
    print(a)
else:
    b = yakusu[k-1] + yakusu[k+2] - 2
    if a > b :
        print(b)
    else:
        print(a)
Problem p02959 (python)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split(" ")]
b = [int(x) for x in input().split(" ")]


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

if b[n-1] - a[n-1] > 0:
    count += a[n-1]
    rest = b[n-1] - a[n-1]
    if rest < a[n]:
        count += rest
    else:
        count += a[n]
else:
    count += b[n-1]


print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split(" ")]
b = [int(x) for x in input().split(" ")]


count = 0
for i in range(n-1):
    if a[i] - b[i] < 0:
        count += a[i]
        diff = a[i+1] - (b[i] - a[i]) 
        if diff < 0:
            b[i+1] += a[i+1]
        else:
            count += b[i] - a[i]
            a[i+1] -= b[i] - a[i]
    elif a[i] - b[i] >= 0:
        count += b[i]
        
if b[n-1] - a[n-1] > 0:
    count += a[n-1]
    rest = b[n-1] - a[n-1]
    if rest < a[n]:
        count += rest
    else:
        count += a[n]
else:
    count += b[i]


print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split(" ")]
b = [int(x) for x in input().split(" ")]


count = 0
for i in range(n-1):
    if a[i] - b[i] < 0:
        if a[i+1] - b[i] + a[i] < 0:
            b[i+1] += a[i+1]
        count += a[i]
    elif a[i] - b[i] >= 0:
        count += b[i]

if b[n-1] - a[n-1] > 0:
    count += a[n-1]
    rest = b[n-1] - a[n-1]
    if rest < a[n]:
        count += rest
    else:
        count += a[n]
else:
    count += b[i]


print(count)
Problem p02552 (python)

Fixed submission:
x = int(input())

if x == 0:
  print(1)
elif x == 1:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(max(a*c, a*d, b*c, b*d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
A=max(a,b)
B=max(c,d)

if (A>0 and B>0):
  print(A*B)
elif A<0 and B>0:
  print(A*min(c,d))
elif A>0 and B<0:
  print(min(a,b)*B)
elif A<=0 and B<=0:
  print(min(a,b)*min(c,d))

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
A=max(a,b)
B=max(c,d)

if (A<=0 and B<=0) or (A>0 and B>0):
  print(A*B)
elif A<0 and B>0:
  print(A*min(c,d))
elif A>0 and B<0:
  print(min(a,b)*B)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
A=max(a,b)
B=max(c,d)

if (A<=0 and B<=0) or (A>0 and B>0):
  print(A*B)
elif A<0 and B>0:
  print(A*min(c,d))
else:
  print(min(a,b)*B)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
A=max(a,b)
B=max(c,d)

if (A<=0 and B<=0) or (A>0 and B>0):
  print(A*B)
elif A<0 and B>0:
  print(min(a,b)*B)
else:
  print(A*min(c,d))
Problem p02572 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7
aa = 0
b = 0
for i in range(n):
    aa += a[i] ** 2  
    b += a[i]
    #aa %= mod
    #b %= mod
print((b ** 2 - aa)//2%mod)

Buggy submission (verdict: Runtime Error):
import numpy as np

N=int(input())
A=np.array(list(map(int,input().split())))
L=len(str(max(A)))//4
A=A/10**L

x=np.sum(np.outer(A,A))-np.sum(A*A)
print(int(x/2*10**(2*L)%(10**9+7)))
Problem p02594 (python)

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

Buggy submission (verdict: Runtime Error):
N,D=map(int,input().split())
cnt=0
for idx in range(N):
  X,Y=map(int,input().split())
  if X**2+Y**2<=D**2:
    cnt=cnt+1
print(cnt)
Problem p02595 (python)

Fixed submission:
N,D=map(int,input().split())
cnt=0
for idx in range(N):
  X,Y=map(int,input().split())
  if X**2+Y**2<=D**2:
    cnt=cnt+1
print(cnt)

Buggy submission (verdict: Runtime Error):
import numpy as np
L=np.array(map(int,input()))
N=L(0,0)
D=L(0,1)
cnt=0
for idx in range(1,N):
  if L(idx,0)**2+L(idx,1)**2<=D**2:
    cnt=cnt+1
print(cnt)
Problem p02676 (python)

Fixed submission:
K=int(input())
S=input()
if len(S)<=K:
  print(S)
else:
  print(S[0:K]+'...')

Buggy submission (verdict: Runtime Error):
K=int(input())
S=input()
if len(S)<=len(K):
  print(S)
else:
  print(S[0:len(K)])
Problem p02688 (python)

Fixed submission:
N,K=map(int,input().split())
A=[]
people=list(range(1,N+1,1))
for idx in range(K):
    d=int(input())
    X=list((map(int,input().split())))
    for i in range(len(X)):
        A.append(X[i])
ans =[i for i in people if not i in A]
print(len(ans))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=[]
people=list(range(1,N+1,1))
for idx in range(K):
    d=int(input())
    X=list((map(int,input().split())))
    for i in range(len(X)):
        A.append(X[i])
ans =[i for i in people if not i in A]
print(ans[0])
Problem p02693 (python)

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

for num in range(A, B+1, 1):
  if num % K == 0:
    print('OK')
    break
else:
  print('NG')

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

if A%K==0 or B%K==0 or ABS(B-A)>=K:
  print('OK')
else:
  print('NG')

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

if A%K==0 or B%K==0 or ABS(B-A)>=K:
  print('OK')
else:
  print('NG')
Problem p02711 (python)

Fixed submission:
N=input()
for idx in range(len(N)):
  if N[idx] == str(7):
    print('Yes')
    break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N=input()
for idx in len(N):
  if N[idx] == str(7):
    print('Yes')
    break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N=input()
for idx in len(N):
  if N[idx] == 7:
    print('Yes')
    break
else:
  print('No')