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

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

flag = True

for i in range(N-1, 0, -1):
    if H[i-1] - 1 == H[i]:
        H[i-1] -= 1
    elif H[i-1] - 1 > H[i]:
        flag = False
        break

if flag:
    print("Yes")
else:
    print("No")

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

ans = "Yes"

for i in range(N-2):
    if H[i] - 1 > H[i+1] or H[i] - 1 > H[i+2]:
        ans = "No"
        break
if H[-2] - 1 > H[-1] and ans == "Yes":
    ans = "No"


print(ans)
Problem p02988 (python)

Fixed submission:
n = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(n-2):
  if (P[i] < P[i+1]) and (P[i+1] < P[i+2]):
    ans += 1
  elif (P[i] > P[i+1]) and (P[i+1] > P[i+2]):
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n - int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(n-2):
  if (P[i] < P[i+1]) and (P[i+1] < P[i+2]):
    ans += 1
  elif (P[i] > P[i+1]) and (P[i+1] > P[i+2]):
    ans += 1
print(ans)
Problem p03030 (python)

Fixed submission:
n = int(input())
l = []
for i in range(n):
    s, p = input().split()
    l.append((s,int(p),i+1))
l.sort(key = lambda x : x[1],reverse=True)
l.sort(key = lambda x : x[0])
for i in range(n):
    print(l[i][2])

Buggy submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(n):
    s, p = input().split()
    l.append((s,int(p),i))
l.sort(key = lambda x:(x[0],x[1]), reverse = True)
for _ in l:
    print(l[2])
Problem p03086 (python)

Fixed submission:
S = input()

ans = 0
tmp = 0
flag = False

for i in S:
    if (i == "A") or (i == "C") or (i == "G") or (i == "T"):
        tmp += 1
        flag = True
    elif (tmp > ans) and flag:
        ans = tmp
        tmp = 0
        flag = False
    elif flag:
        tmp = 0
        flag = False

if (ans < tmp):
    ans = tmp

print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
l=len(S)
num=0
for i in range(l):
  if S[i] in "AGCT":
    num+=1
  elif num>ans:
    ans=num
    num=0
  else:
    num=0
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
l=len(S)
num=0
for i in range(l):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    num+=1
  elif num>ans:
    ans=num
    num=0
  else:
    num=0
print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
l=len(S)
num=0
for i in range(l):
  if S[i]==A or S[i]==G or S[i]==C or S[i]==T:
    num+=1
  elif num>ans:
    ans=num
    num=0
  else:
    num=0
print(ans)
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
AClist = [0] 
for i in range(N-1):
    if S[i+1] == "C" and S[i] == "A":
        AClist.append(AClist[-1] + 1)
    else:
        AClist.append(AClist[-1])
for i in range(Q):
    l , r = map(int, input().split())
    print(AClist[r-1] - AClist[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input().split()
rList = list()
lList = list()
for i in range(Q):
    l, r = map(int, input().split())
    lList.append(l - 1)
    rList.append(r)
def AcNum(List):
    c = 0
    for i in range(len(List) - 1):
        if List[i] == "A" and List[i + 1] == "C":
            c += 1
    return c
for i in range(N):
    print(AcNum(S[lList[i]:rList[i]]))
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
tmp = 0
for i in range(max(a, b), 0, -1):
    if(a%i == 0)and(b%i == 0):
        tmp += 1
    if tmp == k:
        print(i)
        exit()

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

for i in range(100, 1, -1):
    if(a%i == 0)and(b%i == 0)and(flag):
        if(k == 1):
            ans = i
            flag = False
        else:
            k -= 1

print(ans)
Problem p03219 (python)

Fixed submission:
X, Y = map(int, input().split())
print(X + Y // 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
dH =[]
for i in H:
    dH.append(abs(A - T + 0.006 * i))
print(dH.index(min(dH) + 1))

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
dH =[]
for i in H:
    dH.append(abs(A - T + 0.006 * i))
min_dH = min(dH)
print(dH.index(min_dH) + 1)
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
k = []
for i in H:
    k.append(abs(A-(T-i*0.006)))
print(k.index(min(k))+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
dH =[]
for i in H:
    dH.appendabs((A - T + 0.006 * i))
min_dH = min(dH)
print(dH.index(min_dH) + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
dH =[0]
for i in range(N):
    dH[i] = A + 0.006 * H[i]
min_dH = min(dH)
print(dH.index(min_dH) + 1)
Problem p03240 (python)

Fixed submission:
N = int(input())

x = [0] * N
y = [0] * N
h = [0] * N

for i in range(N):
    xyh = list(map(int, input().split()))
    x[i] = xyh[0]
    y[i] = xyh[1]
    h[i] = xyh[2]
    if xyh[2] != 0:
        Cx = xyh[0]
        Cy = xyh[1]
        CH = xyh[2]

for i in range(101):
    for j in range(101):
        flag = True
        H = CH + abs(i - Cx) + abs(j - Cy)
        for k in range(N):
            if h[k] != max(H - abs(i - x[k]) - abs(j - y[k]), 0):
                flag = False
                break
        if flag:
            print(i, j, H)

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

x = [0] * N
y = [0] * N
h = [0] * N

for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())

for i in range(101):
    for j in range(101):
        h1 = h[0] + abs(i - x[0]) + abs(j - y[0])
        flag = True
        for k in range(1, N):
            h2 = h[k] + abs(i - x[k]) + abs(j - y[k])
            if h1 != h2:
                flag = False
                break
        if flag:
            ans = [str(i), str(j), str(h1)]
            break
    if flag:
        break

print(ans[0] + " " + ans[1] + " " + ans[2])
Problem p03285 (python)

Fixed submission:
N = int(input())
flag = False
for i in range(N//4+1):
    for j in range(N//7+1):
        if 4 * i + 7 * j == N:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
flag = False
for i in range(N//4):
    for j in range(N//7):
        if 4 * i + 7 * j == N:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
flag = False
for i in range(N//4 + 1):
    for j in range(N//7 + 1):
        if 4 * i + 7 * j == N:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
flag = False
for i in range(N//4 + 1):
    for j in range(N//7 + 1):
        if 4 * i + 7 * j == N:
            flag = True
            break
if flag:
    print("Yes")
else:
    print("No")
Problem p03369 (python)

Fixed submission:
S = input()
print(700 + 100*S.count('o'))

Buggy submission (verdict: Runtime Error):
S = input()
print(700 + 100*S.count(o))

Buggy submission (verdict: Runtime Error):
S = input()
print(500 + 100*S.count(o))
Problem p03416 (python)

Fixed submission:
A, B = map(int, input().split())
cou = 0
while A != (B + 1):
    Astr = str(A)
    if int(Astr[0]) == int(Astr[4]) and int(Astr[1]) == int(Astr[3]):
        cou = cou + 1
    A = A + 1
print(cou)

Buggy submission (verdict: Runtime Error):
A, B = map(int input().split())
cou = B//100 - A//100
Astr = str(A)
Aup = 10 * int(Astr[1]) + int(Astr[0])
Adown = A%100
Bstr =str(B)
Bup = 10 * int(Bstr[1]) + int(Bstr[0])
Bdown = B%100
if Adown < Aup :
    cou += 1
if Bdown > Bup :
    cou += 1
print(cou)
Problem p03493 (python)

Fixed submission:
s = int(input())
i = 0
if(s//100==1):
    i = i + 1
    s = s - 100
if(s//10==1):
    i = i + 1
    s = s-10
if(s==1):
    i = i + 1
print(i)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(input())
intA = [int(s) for s in A]
j = 1
c = 0
while j == 1 :
    for i in range(len(intA)):
        if(intA[i]%2==1):
            j = 0
        else:
            intA[i] = intA[i]//2
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
s1, s2, s3 = map(int,input().split())
i = 0
if(s1 == 1):
    i = i + 1
if(s2 == 1):
    i = i + 1
if(s3 == 1):
    i = i + 1
print(i)

Buggy submission (verdict: Runtime Error):
s1, s2, s3 = map(int,input().split())
i = 0
if(s1 == 1):
    i =+ 1
if(s2 == 1):
    i =+ 1
if(s3 == 1):
    i =+ 1
print(i)
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
cau = 0
flag = True
while flag:
    for i in range(N):
        if A[i] % 2 == 1:
            flag = False
            break        
    if flag:
        for i in range(N):
            A[i] = A[i]/2
        cau += 1
print(cau)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
cau = 0
flag = "go"
while flag == "go":
    for i in range(N):
        if(A[i] % 2 == 1):
            flag = "stop"
            break        
    if(flag = "go"):
        for i in range(N):
            A[i] = A[i]/2
        cau += 1
print(cau)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
cau = 0
flag = "0"
while flag == "0":
    for i in range(N):
        if(A[i] % 2 != 1):
            flag = "1"
            break
        if(flag = "0"):
            for i in range(N):
                A[i] = A[i]/2
        cau += 1
print(cau)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for n in range(N):
caunter = 0
flag = "0"
while flag == "0":
    for i in range(N):
        if(A[i] % 2 != 1):
            flag = "1"
            break
        
    if(flag = "0"):
        for i in range(N):
            A[i] = A[i]/2
        caunter += 1
print(caunter)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
for n in range(N):
caunter = 0
flag = "0"
while flag == "0":
    for i in range(N):
        if(A[i] % 2 != 1):
            flag = "1"
            break
        
    if(flag = "0"):
        for i in range(N):
            A[i] = A[i]/2
        caunter += 1
print(caunter)

Buggy submission (verdict: Runtime Error):
N = input()
A = list(input())
intA = [int(s) for s in A]
j = 1
c = 0
while j == 1 :
    for i in range(len(intA)):
        if(intA[i]%2==1):
            j = 0
        else:
            c += 1
print(c)
Problem p03503 (python)

Fixed submission:
N = int(input())
F = []
P = []
for _ in range(N):
    F.append(list(map(int, input().split())))
for _ in range(N):
    P.append(list(map(int, input().split())))

ans = -1000000000


for i in range(1, 1024):
    tmp = 0
    c = [0] * N
    ii = list(str(format(i, 'b')).zfill(10))
    for j in range(N):
        for k in range(10):
            if str(F[j][k]) == ii[k] and ii[k] == '1':
                c[j] += 1
    for j in range(N):
        tmp += P[j][c[j]]
    if tmp > ans :
        ans = tmp

print(ans)

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

for _ in range(N):
    F.append(list(map(int, input().split())))

P = []

for _ in range(N):
    P.append(list(map(int, input().split())))

c = [0] * 10
ans = - float('inf')
tmp = 0

for i in range(1, 1024):
    ii = format(i, 'b')
    ii = str(ii)
    ii = ii.zfill(10)
    ii = list(ii)
    for j in range(N):
        for k in range(10):
            if str(F[j][k]) == ii[k] and ii[k] == '1':
                c[j] += 1
    for j in range(N):
        tmp += P[j][c[j]]
    if tmp > ans:
        ans = tmp
    tmp = 0
    c = [0] * 10

print(ans)

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

for _ in range(N):
    F.append(list(map(int, input().split())))

P = []

for _ in range(N):
    P.append(list(map(int, input().split())))

c = [0] * 10
ans = -1000000000
tmp = 0

for i in range(1, 1024):
    ii = format(i, 'b')
    ii = str(ii)
    ii = ii.zfill(10)
    ii = list(ii)
    for j in range(N):
        for k in range(10):
            if str(F[j][k]) == ii[k] and ii[k] == '1':
                c[j] += 1
    for j in range(N):
        tmp += P[j][c[j]]
    if tmp > ans:
        ans = tmp
    tmp = 0
    c = [0] * 10

print(ans)

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

for _ in range(N):
    F.append(list(map(int, input().split())))

P = []

for _ in range(N):
    P.append(list(map(int, input().split())))

c = [0] * 10
ans = -1000000000
tmp = 0

for i in range(1, 1024):
    ii = format(i, 'b')
    ii = str(ii)
    ii = ii.zfill(10)
    ii = list(ii)
    for j in range(N):
        for k in range(10):
            if str(F[j][k]) == ii[k] == '1':
                c[j] += 1
    for j in range(N):
        tmp += P[j][c[j]]
    if tmp > ans:
        ans = tmp
    tmp = 0
    c = [0] * 10

print(ans)

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

for _ in range(N):
    F.append(list(input().split()))

P = []

for _ in range(N):
    P.append(list(map(int, input().split())))

c = [0] * 10
ans = -1000000000
tmp = 0

for i in range(1, 1024):
    i = format(i, 'b')
    i = str(i)
    i = i.zfill(10)
    i = list(i)
    for j in range(N):
        for k in range(10):
            if F[j][k] == i[k] == '1':
                c[j] += 1
    for j in range(N):
        tmp += P[j][c[j]]
    if tmp > ans:
        ans = tmp
    tmp = 0
    c = [0] * 10

print(ans)
Problem p03610 (python)

Fixed submission:
s = list(input())
AnsList = s[::2]
print(''.join(AnsList))

Buggy submission (verdict: Runtime Error):
s = input()
num = len(s)
i = 0
ans = []
while i <= num/2:
    ans[i] = s[2 * i]
ANS = sum(ans)
print(ANS)
Problem p03636 (python)

Fixed submission:
S = input()
S0 = S[0]
S1 = str(len(S) - 2)
S2 = S[-1]
print(S0+S1+S2)

Buggy submission (verdict: Runtime Error):
S = input()
S0 = S[0]
S1 = len(S) - 2
S2 = S[-1]
print(S0+S1+S2)
Problem p03658 (python)

Fixed submission:
N, K = map(int, input().split())
lList = list(map(int, input().split()))
lList.sort(reverse = True)
ans = 0
for i in range(K):
    ans += lList[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
lList = list(map(int, input().split())).sort(reverse = True)
ans = 0
for i in range(K):
    ans += lList[i]
print(ans)
Problem p03713 (python)

Fixed submission:
H, W = map(int, input().split())
if H%3 == 0 or H%3 == 0:
    ans = 0
else:
    ansl = [H] + [W] + [H*W] * 2
    if W%2 == 0:
        for i in range(1, H):
            tmp = abs(i * W - (H-i) * W // 2)
            if ansl[2] > tmp:
                ansl[2] = tmp
    else:
        for i in range(1, H):
            S1 = W * i
            S2 = (H-i) * (W//2)
            S3 = H*W - S1 - S2
            tmp = max(S1, S2, S3) - min(S1, S2, S3)
            if ansl[2] > tmp:
                ansl[2] = tmp
    if H == W:
        ansl[3] = ansl[2]
    elif H%2 == 0:
        for i in range(1, W):
            tmp = abs(i * H - (W-i) * H // 2)
            if ansl[3] > tmp:
                ansl[3] = tmp
    else:
        for i in range(1, W):
            S1 = H * i
            S2 = (W-i) * (H//2)
            S3 = H*W - S1 - S2
            tmp = max(S1, S2, S3) - min(S1, S2, S3)
            if ansl[3] > tmp:
                ansl[3] = tmp
    ans = min(ansl)
print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
if H%3 == 0 or H%3 == 0:
    ans = 0
else:
    ansl = [H] + [W] + [H*W] * 2
    if W%2 == 0:
        for i in range(1, H):
            tmp = abs(i * W - (H-i) * W // 2)
            if ansl[2] > tmp:
                ansl[2] = tmp
    else:
        for i in range(1, H):
            S1 = W * i
            S2 = (H-i) * (W//2)
            S3 = H*W - S1 - S2
            tmp = max(S1, S2, S3) - min(S1, S2, S3)
            if ansl[2] > tmp:
                ansl[2] = tmp
    if H == W:
        ansl[3] = ansl[2]
    elif H%2 == 0:
        for i in range(1, W):
            tmp = abs(i * H - (W-i) * H // 2)
            if ansl[3] > tmp:
                ansl[3] = tmp
    else:
        for i in range(1, W):
            S1 = H * i
            S2 = (W-i) * (H//2)
            S3 = H*W - S1 - S2
            tmp = max(S1, S2, S3) - min(S1, S2, S3)
            if ansl[3] > tmp:
                ansl[3] = tmp
	ans = min(ansl)
print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
if H%3 == 0 or H%3 == 0:
    ans = 0
else:
    ansl = [H] + [W] + [H*W] * 2
    if W%2 == 0:
        for i in range(1, H):
            tmp = abs(i * W - (H-i) * W // 2)
            if ansl[2] > tmp:
                ansl[2] = tmp
    else:
        for i in range(1, H):
            S1 = W * i
            S2 = (H-i) * (W//2)
            S3 = H*W - S1 - S2
            tmp = max(S1, S2, S3) - min(S1, S2, S3)
            if ansl[2] > tmp:
                ansl[2] = tmp
    if H == W:
        ansl[3] = ansl[2]
    elif H%2 == 0:
        for i in range(1, W):
            tmp = abs(i * H - (W-i) * H // 2)
            if ansl[3] > tmp:
                ansl[3] = tmp
    else:
        for i in range(1, W):
            S1 = H * i
            S2 = (W-i) * (H//2)
            S3 = H*W - S1 - S2
            tmp = max(S1, S2, S3) - min(S1, S2, S3)
            if ansl[3] > tmp:
                ansl[3] = tmp
ans = min(ansl)
print(ans)
Problem p03047 (python)

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

print(N-K+1);

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

print(N-k+1);
Problem p03105 (python)

Fixed submission:
import sys


def main():
    lines = sys.stdin.readlines()[0].split(' ')
    one_try = int(lines[0])
    money = int(lines[1])
    count = int(lines[2])
    n = 0
    while(True):
        if money >= one_try:
            money = money - one_try
            n = n + 1
        else:
            break
        if n == count:
            break
    print(n)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys


def main():
    lines = sys.stdin.readlines().split(' ')
    one_try = int(lines[0])
    money = int(lines[1])
    count = int(lines[2])
    n = 0
    while(True):
        if money >= one_try:
            money = money - one_try
            n = n + 1
        else:
            break
        if n == count:
            break
    print(n)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys


def main():
    one_try = int(sys.argv[1])
    money = int(sys.argv[2])
    count = int(sys.argv[3])
    n = 0
    while(True):
        if money >= one_try:
            money = money - one_try
            n = n + 1
        else:
            break
        if n == count:
            break
    print(n)


if __name__ == '__main__':
    main()
Problem p03651 (python)

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
import fractions
import functools
gcd = functools.reduce(fractions.gcd, A)
A_max = max(A)
if (A_max >= K and K % gcd == 0):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
import math
import functools
gcd = functools.reduce(math.gcd, A)
A_max = max(A)
if (A_max >= K and K % gcd == 0):
    print('POSSEBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
import math
import functools
gcd = functools.reduce(math.gcd, A)
print(gcd)
A_max = max(A)
if (A_max >= K and K % gcd == 0):
    print('POSSEBLE')
else:
    print('IMPOSSIBLE')
Problem p03060 (python)

Fixed submission:
n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
for a in ans_lst:
    if a > 0:
        ans += a

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
i = 0
while(ans_lst[i] > 0 and i < len(ans_lst)):
    ans += ans_lst[i]
    i += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
v_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
i = 0
while(ans_lst[i] > 0):
    ans += ans_lst[i]
    i += 1

print(ans)
Problem p03503 (python)

Fixed submission:
n = int(input())
f = [list(map(int,input().split())) for _ in range(n)]
p = [list(map(int,input().split())) for _ in range(n)]
res = -float('inf')
for i in range(1,1<<10):
    cnt = [0 for _ in range(n)]
    for j in range(10):
        for k in range(n):
            if (i>>j)&1 and f[k][10-j-1]:
                cnt[k] += 1
    total = 0
    for k in range(n):
        total += p[k][cnt[k]]
    res = max(res,total)
print(res)

Buggy submission (verdict: Runtime Error):
MIN = -(10**7)-1

def solve():
    cnt = 0
    i = 0
    for lst in f_lst:
        chk_range = sum(lst)
        cnt += max(p_lst[i][1:chk_range])
        i += 1
    if cnt < 0:
        cnt = min(min(p_lst))
    return cnt


n = int(input())
f_lst = [[] for _ in range(n)]
p_lst = [[] for _ in range(n)]
for i in range(n):
    f_lst[i].extend(map(int,input().split()))
for i in range(n):
    p_lst[i].extend(map(int,input().split()))

ans = solve()
print(ans)

Buggy submission (verdict: Runtime Error):
MIN = -(10**7)-1

def solve():
    cnt = 0
    i = 0
    for lst in f_lst:
        chk_range = sum(lst)
        cnt += max(p_lst[i][1:chk_range])
        i += 1
    if cnt < 0:
        cnt = min(min(p_lst))
    return cnt


n = int(input())
f_lst = [[] for _ in range(n)]
p_lst = [[] for _ in range(n)]
for i in range(n):
    f_lst[i].extend(map(int,input().split()))
for i in range(n):
    p_lst[i].extend(map(int,input().split()))

ans = solve()
print(f_lst)
print(p_lst)
print(ans)
Problem p03828 (python)

Fixed submission:
num = int(input())
cnt_list = [0] * (num+1)
ans = 1

for i in range(2,num+1):
    x = i
    prime = 2
    while x > 1:
        while x%prime == 0:
            cnt_list[prime] += 1
            x = x//prime
        prime += 1

for i in cnt_list:
    ans = (ans*(i+1)) % (10**9+7)
print(ans)

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

def factorial(num):
    if num == 1:
        return 1
    else:
        return num * factorial(num-1)

def factoring(n):
    i = 2
    prime_factors = []
    while i*i <= n:
        while n%i == 0:
            n /= i
            prime_factors.append(i)
        i += 1
    if n > 1:
        prime_factors.append(n)
    return prime_factors

def total_combination(num_list):
    non_duplicates = list(set(num_list))
    total = 1

    for i in non_duplicates:
        total *= num_list.count(i)+1

    return total 

n = int(input())

f = factorial(n)
primes = factoring(f)
ans = total_combination(primes) % MOD

print(ans)