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

Fixed submission:
s=input();l=len(s)//2;c=0
for i in range(l):
  if s[i]!=s[-i-1]:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
s=input();l=len(s)//2-1;c=0
if len(s)==1:
  print(0)
else
  for i in range(l):
    if s[i]!=s[-i-1]:
      c+=1
  print(c)
Problem p03041 (python)

Fixed submission:
n,k=[int(i) for i in input().split()];s=input()
print(s[0:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n,k=[int(i) for i in input().split()];s=input()
print(s[0:k]+s[k].lower()+s[k+1:])
Problem p02777 (python)

Fixed submission:
alc = input().split()
nums = list(map(int, input().split()))
choose = input()

ans0 = nums[0] - int(alc[0]==choose)
ans1 = nums[1] - int(alc[1]==choose)
print(ans0, ans1)

Buggy submission (verdict: Runtime Error):
nk = list(map(int, input().split()))
p = list(map(int, input().split()))
n = nk[0]
k = nk[1]
maxnum = 0
for i in range(n-k):
    if p[i+k] >= p[i]:
        maxnum = i+k

ans = (sum(p[maxnum-k+1:maxnum+1])+k)/2
print(ans)
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 'YES'
for i in range(n-1):
    if a[i] == a[i+1]:
        ans = 'NO'
        break

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 'YES'
for i in range(n):
    for j in range(j, n-i):
        if a[i] == a[j]:
            ans = 'NO'
            break

print(ans)
Problem p02781 (python)

Fixed submission:
import math
def check1(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    summ = 0
    if n >= 3:
        for i in range(n):
            summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))
def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()

Buggy submission (verdict: Runtime Error):
import math
def check1(N):
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    n = int(math.log10(N))
    summ = 0
    if n >= 3:
        for i in range(2, n):
            summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))
def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()

Buggy submission (verdict: Runtime Error):
import math
def check1(N):
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    n = int(math.log10(N))
    summ = 0
    for i in range(n):
        summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))
def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))        
main()

Buggy submission (verdict: Runtime Error):
import math
def check1(N):
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    n = int(math.log10(N))
    summ = 0
    for i in range(2, n):
        summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))

def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()
Problem p02879 (python)

Fixed submission:
arr = input().split()
a = int(arr[0])
b = int(arr[1])

#b = int(input())
if 1<=a<=9 and 1<=b<=9:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if 1<=a<=9 and 1<=b<=9:
  print(a*b)
else:
  print(-1)
Problem p02779 (python)

Fixed submission:
x = int(input(""))
l = list()
flag = 0
arr = [int(x) for x in input().split()]
arr2=set(arr)
l=len(arr)
l2=len(arr2)
if l!=l2:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
x = int(input(""))
l = list()
flag = 0
for i in range(0, x):
    temp = input("")
    if temp in l:
        flag = 1
    if temp not in l:
        l.append(temp)
if flag == 1:
    print("NO")
else:
    print("YES")
Problem p02766 (python)

Fixed submission:
n, k = map(int, input().split())
if n < k:
  print(1)
else:
  c = n // k
  ans = 1
  while (c >= 1):
    ans += 1
    c = c // k
  print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
if n <= k:
  print(1)
else:
  c = n // k
  ans = 1
  while (c >= 1):
    ans += 1
    c = c // k
print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
if n < k:
  print(1)
else:
  c = n // k
  ans = 1
  while (c >= 1):
    ans += 1
    c = c // k
print(ans)
Problem p03186 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b + a - c + 1 >= 0:
	print(b+c)
else:
	print(a+2*b+1)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,iput().split())
if b + a - c > 0:
	print(b+c)
else:
	print(a+2*b+1)

Buggy submission (verdict: Runtime Error):
a,b,c = int(iput().split())
if b + a - c > 0:
	print(b+c)
else:
	print(a+2*b+1)

Buggy submission (verdict: Runtime Error):
a,b,c = int(iput())
if b + a - c > 0:
	print(b+c)
else:
	print(a+2*b+1)
Problem p04005 (python)

Fixed submission:
A, B, C = map(int, input().split())
print(min(C%2*A*B, A%2*B*C, B%2*C*A))

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

Buggy submission (verdict: Runtime Error):

a,b,c=map(int,input().split())
print(min((a%)*b*c,a*(b%)*c,a*b*(c%)))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(min(a%*b*c,a*b%*c,a*b*c%))
Problem p02831 (python)

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

def hcfnaive(x, y): 
  if(y == 0): 
    return x 
  else: 
    return hcfnaive(y, x % y)

def lcm(x, y):
    return (x * y) // hcfnaive(x, y)

print(lcm(A, B))

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

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))
Problem p02831 (python)

Fixed submission:
import fractions
A, B = map(int, input().split())
ans = int((A*B)/fractions.gcd(A,B))
print(ans)

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

Fixed submission:
N, K = map(int, input().split())
ans = 0
while True:
    if N < K:
        print(ans + 1)
        break
    ans = ans + 1
    N = N / K

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
ans = 0
while True:
    ans = ans + 1
    N = N / K
    if N < K:
        print(ans + 1)
        return

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
ans = 0
while True:
    ans = ans + 1
    N = N / K
    if N < K:
        print(ans + 1)
        return
Problem p03013 (python)

Fixed submission:
import sys
max_num = 1000000007
input = sys.stdin.readline
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

stairs = [1] * (N+1)
for i in A:
    stairs[i] = 0

for i in range(1, N):
    if stairs[i+1] != 0:
        stairs[i+1] = stairs[i] + stairs[i-1]
print(stairs[N] % max_num)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list([int(input()) for i in range(M)])

stairs = [1] * (N+1)
for i in reversed(range(N+1)):
    if i in A:
        stairs[i] = 0
        continue

    one_step, two_step = 1, 0
    if stairs[i+1:i+2]:
        one_step = stairs[i+1]
    if stairs[i+2:i+3]:
        two_step = stairs[i+2]

    stairs[i] = one_step + two_step
print(stairs[0] % 1_000_000_007)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list([int(input()) for i in range(M)])

stairs = [1] * (N+1)
for i in reversed(range(N+1)):
    if i in A:
        stairs[i] = 0
        continue

    one_step, two_step = 1, 0
    if stairs[i+1:i+2]:
        one_step = stairs[i+1]
    if stairs[i+2:i+3]:
        two_step = stairs[i+2]

    stairs[i] = one_step + two_step
print(stairs[0] % 1_000_000_007)
Problem p03327 (python)

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

print("ABC") if N[0] < 1000 else print("ABD")

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

print("ABC") if N < 1000 else print("ABD")
Problem p02771 (python)

Fixed submission:
A,B,C=map(int,input().split())
if (A==B==C):
  print ('No')
elif (A != B and A != C and B != C):
  print ('No')
else:
  print ('Yes')

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
if (A=B=C):
  print(No)
  else:
    if (A=B):
      print (Yes)
    if (A=C):
      print (Yes)
    if (B=C):
      print (Yes)
    else:
      print (No)
Problem p02771 (python)

Fixed submission:
import sys

def main():
    
    # sys.stdin = open('input155a.txt')
    
    a, b, c = map(int, input().split())

    if a == b & b == c:
        print('No')
        
    elif a != b & b != c & c != a:
        print('No')
    
    else:
        print('Yes')
     

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():

    sys.stdin = open('input155a.txt')

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

    answer = 'Yes' if check(a, b, c) else 'No'
    print(answer)

def check(a, b, c):

    for _ in range(3):
        a, b, c = b, c, a
        if a == b and b != c:
            return True

    return False


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

Fixed submission:
import sys

def main():
    # sys.stdin = open('input149c.txt')

    x = int(input())

    r = False
    while not r:
        r = True
        for i in range(2,x):
            if x % i == 0:
                r = False
                break

        if r == False:
            x += 1
        
    print(x)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    # sys.stdin = open('input149c.txt')

    x = int(input())

    r = false
    while not r:
        r = true
        for i in range(2,x):
            if x % i == 0:
                r = false
                break

        if r == false:
            x += 1
        
    print(x)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    # sys.stdin = open('input149c.txt')

    x = int(input())

    r = false
    while not r:
        r = true
        for i in range(2,x):
            if x % i == 0:
                r = false
                break

        if r == false:
            x += 1
        
    print(x)

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

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input133d.txt')

#+++++

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

sum = 0
for s in a:
    sum += s

asum = 0
for i in range(n):
    if i % 2 == 1:
        asum += a[i]

x1 = sum - 2 * asum

ret = []
ret.append(x1)

for i in range(1, n):
   xi = 2 * a[i - 1] - ret[i - 1] 
   ret.append(xi)

for i in ret:
    print(i, end =" ")

Buggy submission (verdict: Runtime Error):
import sys

#if sys.platform =='ios':
sys.stdin=open('input133d.txt')

#+++++

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

sum = 0
for s in a:
    sum += s

asum = 0
for i in range(n):
    if i % 2 == 1:
        asum += a[i]

x1 = sum - 2 * asum

ret = []
ret.append(x1)

for i in range(1, n):
   xi = 2 * a[i - 1] - ret[i - 1] 
   ret.append(xi)

for i in ret:
    print(i, end =" ")
Problem p02766 (python)

Fixed submission:
import sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
    n //= k
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
imports sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
  	n /= k
    count += 1
print(count)
Problem p02771 (python)

Fixed submission:
d = raw_input()
a, b, c =  d.split()
a = int(a)
b = int(b)
c = int(c)
if (a==b):
  if c == a:
    print("No")
  else:
    print("Yes")
else:
  if a==c or b == c:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = raw_input()
n, k = a.split()
n = int(n)
k = int(k)
b = raw_input()
data = [int(one) for one in b.split()]
res = []
for i in range(len(data) - 1):
  for j in range(i+1, len(data)):
    res.append(data[i]*data[j])
res = sorted(res)
print(res[k-1])

Buggy submission (verdict: Runtime Error):
n = input()
d = dict()
for i in range(n):
  w = raw_input()
  if w in d:
    d[w] += 1
  else:
    d[w] = 1
di = d.items()
def com(a,b):
  if a[1] > b[1]:
    return True
  elif a[1] == b[1]:
    return a[0]>b[0]
  else:
    return False
di = sorted(di, cmp=com)
print(di[0][0])
if len(di) > 1:
  print(di[1][0])
Problem p02779 (python)

Fixed submission:
import sys
def main():
    l= sys.stdin.readline()
    count = int(l.strip())
    l = sys.stdin.readline()
    nums = list(map(int, l.split()))
    check = dict()
    for n in nums:
        if n in check:
            return "NO"
            
        else:
            check[n] = True
    return "YES"
if __name__ == "__main__":
    print(main())

Buggy submission (verdict: Runtime Error):
import sys
l= sys.stdin.readline()
count = int(l.strip())
l = sys.stdin.readline()
nums = list(map(int, l.split()))
check = dict()
for n in nums:
  if n in check:
    print("YES")
   	break
  else:
    check[n] = True
print("YES")
Problem p02879 (python)

Fixed submission:
str = input()
data = str.split()
n1 = int(data[0])
n2 = int(data[1])
if (n1 >9 or n2 > 9):
    print(-1)
else:
    print(n1*n2)

Buggy submission (verdict: Runtime Error):
str = input()
data = "".split(str)
n1 = int(data[0])
n2 = int(data[1])
if (n1 >9 or n2 > 9):
    print(-1)
else:
    print(n1*n2)
Problem p02880 (python)

Fixed submission:
import sys
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
n1 = int(input())
for i in range(1, 10):
  if n1 % i == 0 and n1 / i < 10:
    print("Yes")
    return
print("No")
Problem p02766 (python)

Fixed submission:
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
  
i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
print(len(str(out)))

Buggy submission (verdict: Runtime Error):
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

i = list(map(int, input().split()))
out = Base_10_to_n(i[0], i[1])
pritnt(out)
Problem p02766 (python)

Fixed submission:
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
	c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
    c += 1
print(c)
Problem p02766 (python)

Fixed submission:
import math

N, K = map(int,input().split())
if N==1:
  print(1)
else:
  print(math.ceil(math.log(N, K)))

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
i=1
while true:
  if N<K^i:
    print(i)
    break
  else:
    i = i + 1
Problem p02879 (python)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)

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

if A>=10 or B>=10:
    print(-1)
else:
    print(A*B)
Problem p02915 (python)

Fixed submission:
N=int(input())
print(N**3)

Buggy submission (verdict: Runtime Error):
N=input()
print(N**3)
Problem p02766 (python)

Fixed submission:
N, K = map(int, input().split())
cout = 1
for i in range(N):
    if N<K:
        break
    N = N//K
    cout += 1

print(cout)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
cout = 1
for i in ranga(N):
    N = N//K
    cout += 1
    if N<K:
        break
print(cout)
Problem p02771 (python)

Fixed submission:
N = input().split()
A = N[0]
B = N[1]
C = N[2]

if A==B==C:
    print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
    print("No")

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

#入力
N = int(input())
S = [input() for i in range(N)]

#出現回数のカウント
c = OrderedDict(collections.Counter(S))
ln = len(c.values())

#多い順に並べ替えた辞書をつくる
d = OrderedDict(sorted(c.items(), key = lambda x : x[1], reverse=True))
dval = list(d.values())
dkey = list(d.keys())

#回数が多い単語を抜き出したリストの制作
word = list()
word.append(dkey[0])
i=1
if ln>1:
    while dval[i-1]==dval[i]:
        word.append(dkey[i])
        i+=1
        if i==ln:
            break

#辞書順に並べ替える
dic = sorted(word)

#表示
for i in range(len(dic)):
    print(dic[i])

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

if A==B==C:
    print("No")
elif A==B or B==C or C==A:
    print("Yes")
else:
    print("No")
Problem p02773 (python)

Fixed submission:
import collections
from collections import OrderedDict

#入力
N = int(input())
S = [input() for i in range(N)]

#出現回数のカウント
c = OrderedDict(collections.Counter(S))
ln = len(c.values())

#多い順に並べ替えた辞書をつくる
d = OrderedDict(sorted(c.items(), key = lambda x : x[1], reverse=True))
dval = list(d.values())
dkey = list(d.keys())

#回数が多い単語を抜き出したリストの制作
word = list()
word.append(dkey[0])
i=1
if ln>1:
    while dval[i-1]==dval[i]:
        word.append(dkey[i])
        i+=1
        if i==ln:
            break

#辞書順に並べ替える
dic = sorted(word)

#表示
for i in range(len(dic)):
    print(dic[i])

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

#入力
N = int(input())
S = [input() for i in range(N)]

#出現回数のカウント
c = OrderedDict(collections.Counter(S))
ln = len(c.values())

#多い順に並べ替えた辞書をつくる
d = OrderedDict(sorted(c.items(), key = lambda x : x[1], reverse=True))
dval = list(d.values())
dkey = list(d.keys())

#回数が多い単語を抜き出したリストの制作
word = list()
word.append(dkey[0])
i=1
if ln>1:
    while dval[i-1]==dval[i]:
        word.append(dkey[i])
        i+=1
        if i==ln:
            break

#辞書順に並べ替える
dic = sorted(word)

#表示
for i in range(len(dic)):
    print(dic[i])

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

#入力
N = int(input())
S = [input() for i in range(N)]

#出現回数のカウント
c = collections.Counter(S)
c_val = list(c.values())
c_key = list(c.keys())

"""
print(c)
print(c_val)
print(c_key)
"""

#多い順に並べ替えた辞書をつくる
c_sorted = OrderedDict(sorted(c.items(), key = lambda x : x[1], reverse=True))
c_sorted_val = list(c_sorted.values())
c_sorted_key = list(c_sorted.keys())

"""
print(c_sorted)
print(c_sorted_val)
print(c_sorted_key)
"""

#回数が多いものを抜き出したリストの制作
c_max = list(c_sorted_key[0])

i=1
if len(c_val)>1:
    while c_val[i-1]==c_val[i]:
        c_max.append(c_key[i])
        i+=1
        if i==len(c_max):
            break

"""
print(c_max)
"""

#keyを降順に並べ替え
c_max.sort()

"""
print(c_max)
print(c_max[0])
"""

#表示
for i in range(len(c_max)):
    print(c_max[i])

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

#入力
N = int(input())
S = [input() for i in range(N)]

#出現回数のカウント
c = collections.Counter(S)
c_val = list(c.values())
c_key = list(c.keys())

"""
print(c)
print(c_val)
print(c_key)
"""

#多い順に並べ替えた辞書をつくる
c_sorted = OrderedDict(sorted(c.items(), key = lambda x : x[1], reverse=True))
c_sorted_val = list(c_sorted.values())
c_sorted_key = list(c_sorted.keys())

"""
print(c_sorted)
print(c_sorted_val)
print(c_sorted_key)
"""

#回数が多いものを抜き出したリストの制作
c_max = list(c_sorted_key[0])

i=1
if len(c_val)>1:
    while c_val[i-1]==c_val[i]:
        c_max.append(c_key[i])
        i+=1
        if i==len(c_max):
            break

"""
print(c_max)
"""

#keyを降順に並べ替え
c_max.sort()

"""
print(c_max)
print(c_max[0])
"""

#表示
i=0
while i!=len(c_max):
    print(c_max[i])
    i+=1
Problem p02847 (python)

Fixed submission:
def main():
	a = {"SUN" : 0,
	"SAT" : 6,
	"FRI" : 5,
	"THU" : 4, 
	"WED" : 3,
	"TUE" : 2,
	"MON" : 1}
	s = input()
	print(7-a[s.strip()])
	
main()

Buggy submission (verdict: Runtime Error):
def main():
	a = {"SUN" : 0,
	"SAT" : 6,
	"FRI" : 5,
	"THI" : 4, 
	"WED" : 3,
	"TUE" : 2,
	"MON" : 1}
	s = input()
	print(7-a[s])
	
main()
Problem p02771 (python)

Fixed submission:
i = list(map(int, input().split()))
a = i[0]
b = i[1]
c = i[2]

isPoor = False

if (a == b or a == c) and b != c:
    isPoor = True
elif (b == a or b == c ) and a != c:
    isPoor = True
elif (c == a or c == b) and a != b:
    isPoor = True

if isPoor:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

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

for x in A:
    if (x % 2 == 0) and (x % 3 != 0) and (x % 5 != 0):
        print('DENIED')
        sys.exit()

print ('APPROVED')

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

isApprove = True

for x in A:
    if x % 2 == 0:
        if (x % 3 != 0) or (x % 5 != 0):
            isApprove = False
            break
        
if isApprove:
    print ('APPROVED')
else:
    print('DENIED')
Problem p02777 (python)

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

if s == u:
  a -= 1
else:
  b -= 1

print(a, b)

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

balls = {s:a, t:b}

for key in balls:
    if key == u:
        balls[key] = balls[key] - 1

listBalls = list(balls.values())
print(f'{listBalls[0]} {listBalls[1]}')