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

Fixed submission:
a,b = map(int,input().split())
c = 0
if a<=b:
  for i in range(b):
    c += a*(10**i)
  print(c)
else:
  for i in range(a):
    c += b*(10**i)
  print(c)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = 'a'*b
d = 'b'*a
if int(c[0]) <= int(d[0]):
  print(int(c))
else:
  print(int(d))
Problem p02836 (python)

Fixed submission:
s = str(input())
n = len(s)
cnt = 0
if n%2==0:
  for i in range(int(n/2)):
    if s[i]!=s[n-i-1]:
      cnt += 1
else:
  for i in range(int((n-1)/2)):
    if s[i]!=s[n-i-1]:
      cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
s = str(input())
n = len(s)
cnt = 0
if n%2==0:
  for i in range((n-3)/2):
    if s[i]!=s[n-i-1]:
      cnt += 1
else:
  for i in range(n/2-1):
    if s[i]!=s[n-i-1]:
      cnt += 1
print(cnt)
Problem p02860 (python)

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

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

Fixed submission:
p,q,r = map(int,input().split())
a = int(p+q)
b = int(q+r)
c = int(r+p)
l = []
l.append(a)
l.append(b)
l.append(c)
print(min(l))

Buggy submission (verdict: Runtime Error):
p.q,r = map(int,input().split())
a = int(p+q)
b = int(q+r)
c = int(r+p)
l = []
l.append(a)
l.append(b)
l.append(c)
print(min(l))
Problem p03041 (python)

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

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = str(input())
s = s.lower(k)
print(str(s))
Problem p02659 (python)

Fixed submission:
from decimal import *
a, b = map(str, input().split())
 
num = (Decimal(a) * Decimal(b)).quantize(Decimal('1'), rounding=ROUND_DOWN)
print(num)

Buggy submission (verdict: Runtime Error):
from decimal import *
a, b = map(float, input().split())
 
num = Decimal('a') * Decimal('b')
print(int(num))

Buggy submission (verdict: Runtime Error):
from decimal import *
a, b = map(float, input().split())

num = decimal('a') * decimal('b')
print(int(num))
Problem p02676 (python)

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

Buggy submission (verdict: Runtime Error):
K = int(input())
S = str(input())

if K >= S:
  print(S)
else:
  print(S[:K] + '...')
Problem p02880 (python)

Fixed submission:
import numpy as np

N = int(input())
arr = np.arange(1, 10)
arr2 = arr[:, np.newaxis] * arr

if N in arr2:
    print('Yes')
else:
    print('No')

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

N = int(input())
arr = np.arange(1, 10)
arr2 = arr[:, np.newaxis] * arr

if N in arr2:
    print('Yes')
else:
    print('No')
Problem p03804 (python)

Fixed submission:
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
lenB = M**2
flg=False
for i in range(N-M+1):
    for j in range(N-M+1):
        if A[i][j] == B[0][0]:
            cnt=0
            for k in range(M):
                for l in range(M):
                    if A[i+k][j+l] == B[k][l]:
                        cnt += 1
            if cnt==M**2:
                flg=True
ans='Yes' if flg else 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
lenB = M**2
flg=False

def check(i, j):
    cnt=0
    for k in range(M):
        for l in range(M):
            if A[i+k][i+j] == B[k][l]:
                cnt += 1
    if cnt==M**2:
        return True
    
for i in range(N-M+1):
    for j in range(N-M+1):
        if A[i][j] == B[0][0]:
            flg = check(i, j)
            
ans='Yes' if flg else 'No'
print(ans)
Problem p02688 (python)

Fixed submission:
N,K = map(int,input().split())
okashi=[0] * N
for i in range(K):
  x=input()
  y=input().split()
  for j in y:
    okashi[int(j)-1]=1
counter=0

for i in okashi:
  if i==0:
    counter=counter+1
print(counter)

Buggy submission (verdict: Runtime Error):
^CTraceback (most recent call last):
  File "testcon1.py", line 6, in <module>
    if x>=x2 and x<=y2:
N,K = map(int,input().split())
okashi=[0] * N
for i in range(K):
  x=input()
  y=input().split()
  for j in y:
    okashi[int(j)-1]=1
counter=0

for i in okashi:
  if i==0:
    counter=counter+1
print(counter)
Problem p02701 (python)

Fixed submission:
n=int(input())
ilist=[str(input()) for i in range(n)]
#print(ilist)

dic={}
for i in ilist:
  dic[i]=1

print (len(dic))

Buggy submission (verdict: Runtime Error):
n=int(input())
ilist=[str(input()) for i in range(n)]
#print(ilist)

dic={}
for i in ilist:
  dic[i]=1

print (len(dic))
~
Problem p02712 (python)

Fixed submission:
print(sum([i for i in range(int(input())+1) if (i % 3 != 0 and i % 5 != 0)]))

Buggy submission (verdict: Runtime Error):
print(sum([i for i in range(int(input()+1)) if (i % 3 != 0 and i % 5 != 0)]))
Problem p02659 (python)

Fixed submission:
from decimal import Decimal,ROUND_FLOOR

IN = input().split()
A = Decimal(IN[0])
B = Decimal(IN[1])

ans = A*B

if ans < 1:
    print(0)
else:
    print(ans.quantize(Decimal("0"), rounding=ROUND_FLOOR))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

IN = input().split()
A = Decimal(IN[0])
B = Decimal(IN[1])

ans = A*B

if ans < 1:
    print(0)
else:
    math.floor(ans)
Problem p02689 (python)

Fixed submission:
N,M = map(int,input().split())
H = list(map(int,input().split()))
H = [0] + H
Tree = [0] + [1]*N
for _ in range(M):
  A,B = map(int,input().split())
  if H[A] > H[B]:
    Tree[B] = 0
  elif H[A] == H[B]:
    Tree[A]=0
    Tree[B]=0
  else:
    Tree[A] = 0
print(sum(Tree))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = list(map(int,input().split()))
H = [0] + H
Tree = [0] + [1]*N
for _ in range(M):
  A,B = map(int,input().split())
  if H[A] > H[B]:
    Tree[B] = 0
  elif H[A] = H[B]:
    Tree[A]=0
    Tree[B]=0
  else:
    Tree[A] = 0
print(sum(Tree))
Problem p02695 (python)

Fixed submission:
import itertools
N,M,Q = map(int,input().split())
L = [list(map(int,input().split())) for _ in range(Q)]
data = list(range(1,M+1))
A=list(itertools.combinations_with_replacement(data,N))
max_score = 0

for Ai in A:
  x = 0
  for a,b,c,d in L:
    if Ai[b-1] - Ai[a-1] == c:
      x += d
  max_score = max(max_score,x)

print(max_score)

Buggy submission (verdict: Runtime Error):
import itertools
N,M,Q = map(int,input().split())
L = [list(map(int,input().split())) for _ in range(Q)]
data = list(range(1,M+1))
A=list(itertools.combinations_with_replacement(data,N))
max_score = 0

for Ai in A:
  x = 0
  for a,b,c,d in L:
    if Ai[b] - Ai[a] == c:
      x += d
  max_score = max(max_score,x)

print(max_score)

Buggy submission (verdict: Runtime Error):
import itertools
N,M,Q = map(int,input().split())
L = [list(map(int,input().split())) for _ in range(Q)]
date = list(range(1,M+1))
A=list(itertools.combinations_with_replacement(data,N))
max_score = 0

for Ai in A:
  x = 0
  for a,b,c,d in L:
    if Ai[b] - Ai[a] == c:
      x += d
  max_score = max(max_score,x)
  
print(max_score)
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,W = map(int,input().suplit())
if W >= S:
  print("unsafe")
else:
  print("safe")
Problem p02707 (python)

Fixed submission:
from collections import Counter
n = int(input())
A = list(map(int,input().split()))

mycounter = Counter(A)

for i in range(1,n+1):
  print(mycounter[i])

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

def main(i):
  a = A.count(i)
  b = A.pop(0)
  print(a)


for i in range(1,n+1):
  main(i)

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

def main(i):
  a = count(A.count(i))
  print(a)


for i in range(1,n+1):
  main(i)

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

def main(i):
  a = 0
  for j in A:
    if i = j:
      a = a+1
  print(a)
  

for i in range(1,n+1):
  main(i)
Problem p02712 (python)

Fixed submission:
a = 0
N = input()
n = int(N)
for i in range(1,n+1):
    if i % 5 != 0 and i % 3 != 0:
        a = a + i
    else:
        continue
print(a)

Buggy submission (verdict: Runtime Error):
a = 0
N = input()
n = int(N)
for i in range(1,n+1):
    if i % 5 != 0 and i % 3 != 0:
        a = a + i
    else:
        continue
return(a)

Buggy submission (verdict: Runtime Error):
a = 0
n = int(N)
for i in range(1,n+1):
    if i % 5 != 0 and i % 3 != 0:
        a = a + i
    else:
        continue
return(a)

Buggy submission (verdict: Runtime Error):
a = 0
n = int(N)
for i in range(1,n+1):
    if i % 5 != 0 and i % 3 != 0:
        a = a + i
    else:
        continue
print(a)
Problem p02723 (python)

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
    print("Yes")
else:
    print("No")
Problem p02862 (python)

Fixed submission:
x, y = map(int, input().split())
mod = 10 ** 9 + 7


def cmb(n, r, mod):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


N = 10 ** 6
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)

if (x + y) % 3 != 0:
    print(0)
else:
    res = 0
    m, n = 0, 0
    while m * 2 <= x:
        n = x - m * 2
        if 2 * n + m == y:
            res += cmb(m + n, m, mod)
        m += 1
    print(res)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
mod = 10**9 + 7
dp = [[0] * (m+1) for _ in range(n+1)]
dp[0][0] = 1
for i in range(1, n+1):
    for j in range(1, m+1):
        if i-2 >= 0 and j-1 >= 0:
            dp[i][j] += dp[i-2][j-1] % mod
        if i-1 >= 0 and j-2 >= 0:
            dp[i][j] += dp[i-1][j-2] % mod
        dp[i][j] %= mod
print(dp[n][m])
Problem p03038 (python)

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

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = []
for i in range(M):
    b.append(list(map(int, input().split())))
ans = 0
A.sort()
b.sort(key=lambda x: x[1], reverse=True)
j = 0
for i in range(M):
    if b[i][1] <= A[j] or j == N:
        break
    while j < N and b[i][0] and b[i][1] > A[j]:
        ans += b[i][1]
        b[i][0] -= 1
        j += 1
if j == N:
    print(ans)
else:
    print(ans + sum(A[j:]))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(4100000)
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = []
for i in range(M):
    b.append(list(map(int, input().split())))
ans = 0
A.sort()
b.sort(key=lambda x: x[1], reverse=True)
j = 0
for i in range(M):
    if b[i][1] <= A[j] or j == N:
        break
    while j < N and b[i][0] and b[i][1] > A[j]:
        ans += b[i][1]
        b[i][0] -= 1
        j += 1
print(ans + sum(A[j:]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = []
for i in range(M):
    b.append(list(map(int, input().split())))
ans = 0
A.sort()
b.sort(key=lambda x: x[1], reverse=True)
j = 0
for i in range(M):
    if b[i][1] <= A[j] or j == N:
        break
    while j < N and b[i][0] and b[i][1] > A[j]:
        ans += b[i][1]
        b[i][0] -= 1
        j += 1
print(ans + sum(A[j:]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = []
for i in range(M):
    b.append(list(map(int, input().split())))
ans = 0
A.sort()
b.sort(key=lambda x: x[1], reverse=True)
j = 0
for i in range(M):
    if b[i][1] <= A[j] or j == N:
        break
    while j < N and b[i][0]:
        ans += b[i][1]
        b[i][0] -= 1
        j += 1
print(ans + sum(A[j:]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = []
for i in range(M):
    b.append(list(map(int, input().split())))
ans = 0
A.sort()
b.sort(key=lambda x: x[1], reverse=True)
j = 0
for i in range(M):
    if b[i][1] <= A[j]:
        break
    while A[j] < b[i][1] and b[i][0]:
        ans += b[i][1]
        b[i][0] -= 1
        j += 1
print(ans + sum(A[j:]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
b = []
for i in range(M):
    b.append(list(map(int, input().split())))
ans = 0
A.sort()
b.sort(key=lambda x: x[1], reverse=True)
j = 0
for i in range(len(b)):
    while A[j] < b[i][1] and b[i][0]:
        A.pop(0)
        ans += b[i][1]
        b[i][0] -= 1
print(ans + sum(A))
Problem p03041 (python)

Fixed submission:
n,K=input().split()
n=int(n)
K=int(K)
S=input()
print(S[:(K-1)]+chr(ord(S[K-1])+32)+S[(K):])

Buggy submission (verdict: Runtime Error):
k,n=input().split()
n=int(n)
k=int(k)
s=input()
n=n-1
print(f"{s[:n]}{chr(ord(s[n])+32)}{s[n+1:]}")

Buggy submission (verdict: Runtime Error):
c=0
def doublet(n,f):
    global c
    if n<f:
        c=c+1
        return doublet(2*n,f)
    else:
        return c
num=int(input())
k=int(input())
if (num>=1 and num<=10**5) and (k>=1 and k<=10**5):
    sum_power=0.0
    for i in range(1,(num+1),1):
        count=doublet(i,k)
        p=pow(2,count)*num
        sum_power=sum_power+(1/p)
        c=0
    print(sum_power)
Problem p02829 (python)

Fixed submission:
a=input()
inputarray=[1,2,3]
inputarray.remove(int(a))
b=input()
inputarray.remove(int(b))
print(inputarray[0])

Buggy submission (verdict: Runtime Error):
N=input()
ST=input()
S=ST.split(' ')[0]
T=ST.split(' ')[1]
result=''

for i in range(int(N)):
  result+=S[i]
  result+=T[i]
  
print(result)

Buggy submission (verdict: Runtime Error):
a=input()
inputarray=[1,2,3]
inputarray.remove(a)
b=input()
inputarray1.remove(b)
Problem p02831 (python)

Fixed submission:
joukyuukokuminndomo=input().split(' ')
joukyuukokuminn2=int(joukyuukokuminndomo[0])
simojimo2=int(joukyuukokuminndomo[1])
joukyuukokuminn=joukyuukokuminn2
simojimo=simojimo2

while joukyuukokuminn%simojimo!=0:
  if joukyuukokuminn>simojimo:
    joukyuukokuminn=joukyuukokuminn-simojimo
  elif joukyuukokuminn<simojimo:
    simojimo=simojimo-joukyuukokuminn

if joukyuukokuminn>=simojimo:
  print(int(joukyuukokuminn2*simojimo2/simojimo))
elif joukyuukokuminn<simojimo:
  print(int(joukyuukokuminn2*simojimo2/joukyuukokuminn))

Buggy submission (verdict: Runtime Error):
joukyuukokuminndomo=input().split(' ')
joukyuukokuminn2=int(joukyuukokuminndomo[0])
simojimo2=int(joukyuukokuminndomo[1])
joukyuukokuminn=joukyuukokuminn2
simojimo=simojimo2

while joukyuukokuminn%simojimo!=0:
  if joukyuukokuminn>simojimo:
    joukyuukokuminn=joukyuukokuminn-simojimo
  elif joukyuukokuminn<simojimo:
    simojimo=simojimo-joukyuukokuminn

if joukyuukokuminn>simojimo:
  print(joukyuukokuminn2*simojinn2/simojimo)
elif joukyuukokuminn<simojimo:
  print(joukyuukokuminn2*simojinn2/joukyuukokuminn)

Buggy submission (verdict: Runtime Error):
joukyuukokuminn=input().split(' ')[0]
simojimo=input().split(' ')[1]

while True:
  if(int(joukyuukokuminn)%int(simojimo)=0):
    break
  def(int(joukyuukokuminn)%int(simojimo))

def(a,b):
  if a>b:
    a=a-b
  elif a<b:
    b=b-a
Problem p02726 (python)

Fixed submission:
import numpy as np

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0] * (N-1)

for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        ans[min(d1, d2) - 1] += 1

[print(ans[i]) for i in range(N - 1)]

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

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0 for _ in range(N - 1)]

for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        ans[min(d1, d2) - 1] += 1

[print(ans[i]) for i in range(N - 1)]

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

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0] * (N-1)

c = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        d3 = abs(Y - i) + 1 + abs(j - X)
        ans[min(d1, d2, d3) - 1] += 1

[print(ans[i]) for i in range(N - 1)]

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

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = np.zeros(N-1, np.int64)

c = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        d3 = abs(Y - i) + 1 + abs(j - X)
        ans[min(d1, d2, d3) - 1] += 1

[print(ans[i]) for i in range(N - 1)]
Problem p02779 (python)

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

A.sort()

count = 0
for i in range(N-1):
    if A[i] == A[i+1]:
        count += 1
        break

if count == 0:
    print('YES')
else:
    print('NO')

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

A.sort()

count = 0
for i in range(N):
    if A[i] == A[i+1]:
        count += 1
        break

if count == 0:
    print('YES')
else:
    print('NO')
Problem p02790 (python)

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

la = ''
lb = ''

for i in range(b):
    la += str(a)

for i in range(a):
    lb += str(b)

if a <= b:
    print(la)
else:
    print(lb)

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

la = ''
lb = ''

for i in range(b):
    la += a
    lb += b

if a <= b:
    print(la)
else:
    print(lb)
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())

if A == 1:
    if B == 2:
        ans = 3
    if B == 3:
        ans = 2
elif A == 2:
    if B == 1:
        ans = 3
    if B == 3:
        ans = 1
elif A == 3:
    if B == 1:
        ans = 2
    if B == 2:
        ans = 1

print(ans)

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

if A == 1 and B == 2:
    ans = 3
elif A == 2 and B == 3:
    ans = 1
elif A == 3 and B == 1:
    ans = 2

print(ans)
Problem p02832 (python)

Fixed submission:
from numpy import *

N = int(input())
a = zeros(N)
a = list(map(int, input().split()))

count = 0

for i in range(N):
    if count + 1 == a[i]:
        count += 1

ans = N - count

if count == 0:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
from numpy import *

N = int(input())
a = zeros(N)
a = list(map(int, input().split()))

count = 0

for i in range(N):
    if count + 1 == a[i]:
        count += 1

ans = N - count

if count == 0:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
from numpy import *

N = int(input())
a = zeros(N)
a = list(map(int, input().split()))

count = 0

for i in range(N):
    if count + 1 == a[i]:
        count += 1

ans = N - count

if count == 0:
    ans = -1

print(ans)
Problem p02833 (python)

Fixed submission:
n = int(input())

def g1(n, p):
    if n == 0:
        return 0
    else:
        return n // p + g1(n // p, p)

def g2(n, p):
    res = 0
    if n % 2 == 1:
        return g1(n, p) - g2(n - 1, p)
    else:
        res = g1(n // 2, p)
        if p == 2:
            res += n // 2
        return res


ans = min(g2(n, 2), g2(n, 5))
print(ans)

Buggy submission (verdict: Runtime Error):
def func(n):
    if n < 2:
        return 1
    else:
        return n * func(n - 2)

N = int(input())

count5 = 0
count2 = 0
A = func(N)
B = func(N)
while True:
    if A % 5 == 0:
        A = int(A / 5)
        count5 += 1
    else:
        break

while True:
    if B % 2 == 0:
        B = int(B / 2)
        if count2 >= count5:
            break
        count2 += 1
    else:
        break

if count5 <= count2:
    ans = count5
else:
    ans = count2

print(ans)

Buggy submission (verdict: Runtime Error):
def func(n):
    if n < 2:
        return 1
    else:
        return n * func(n - 2)

N = int(input())

count5 = 0
count2 = 0
A = func(N)
B = func(N)
while True:
    if A % 5 == 0:
        A = int(A / 5)
        count5 += 1
    else:
        break

while True:
    if B % 2 == 0:
        B = int(B / 2)
        if count2 >= count5:
            break
        count2 += 1
    else:
        break

if count5 <= count2:
    ans = count5
else:
    ans = count2

print(ans)
Problem p02847 (python)

Fixed submission:
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRI":
    cmd = 5
elif S == "SAT":
    cmd = 6

print(7-cmd)

Buggy submission (verdict: Runtime Error):
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

print(7-cmd)

Buggy submission (verdict: Runtime Error):
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(7-cmd)

Buggy submission (verdict: Runtime Error):
S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)

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

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)

Buggy submission (verdict: Runtime Error):
S = input("")

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)
Problem p02777 (python)

Fixed submission:
ball_name1,ball_name2 = input().split(" ")
ball1,ball2 = input().split(" ")
ball1 = int(ball1)
ball2 = int(ball2)
ball_chosen = input()


if (ball_chosen in ball_name1) :
    ball1-=1
    print(str(ball1)+" "+str(ball2))
else:
    ball2-=1
    print(str(ball1)+" "+str(ball2))

Buggy submission (verdict: Runtime Error):
ball_name1,ball_name2 = input().split(" ")
ball1,ball2 = input().split(" ")
ball1 = int(ball1)
ball2 = int(ball2)
ball_chosen = input()


if (ball_chosen in ball_name1) :
    print(f'{ball1-1} {ball2}')
else:
    print(f'{ball1} {ball2-1}')
Problem p02712 (python)

Fixed submission:
N = int(input())
output_list = [0]

for i in range(1,N+1):
  if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
    pass
  else:
    output_list.append(i)
  
print(sum(output_list))

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

for i in range(N):
  if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
  else:
    output_list.append(i)
  
print(sum(output_list)