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

Fixed submission:
n = int(input())
if n == 1:
  print("0")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
n = int(input())
if x == 1:
  print("0")
else:
  print("1")
Problem p02570 (python)

Fixed submission:
d=input()
arr = [int(i) for i in d.split()]

t1 = arr[0]/arr[-1]
if t1<= arr[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d=input()
arr = [int(d) for i in d.split()]

t1 = arr[0]/arr[-1]
if t1<= arr[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d,t,s =int(input()),int(input()),int(input())
t1 = d/s
if t1<= t:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d,t,s =int(input()),(input()),int(input())
t1 = d/s
if t1<= t:
  print("Yes")
else:
  print("No")
Problem p02550 (python)

Fixed submission:
#
import sys
import math
import itertools


# 整数をいくつか入力
n,x,m = (int(i) for i in input().split())

if n < 100000:
    b=0
    for i in range(n):
        b += x
        #print(x)
        x = (x*x) %m
    print(b)
else:
    ll=[0]*100000
    s=0
    for i in range(100000):
        ll[i]=x
        s += x
        x = (x*x) %m
    for i in range(99998,-1,-1):
        if ll[i]==ll[99999]:
            term=99999-i
    p=(n-100000)//term
    q=(n-100000)%term
    r=0
    for i in range(term):
        r += ll[100000-term+i]
    s += r * p
    for i in range(q):
        s += ll[100000-term+i]
    print(s)

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import itertools


# 整数をいくつか入力
n,x,m = (int(i) for i in input().split())

if n < 100000:
    b=0
    for i in range(n):
        b += x
        #print(x)
        x = (x*x) %m
    print(b)
else:
    ll=[0]*100000
    s=0
    for i in range(100000):
        ll[i]=x
        s += x
        x = (x*x) %m
    for i in range(99998,-1,-1):
        if ll[i]==ll[99999]:
            term=99999-i
    p=(n-100000)//term
    q=(n-100000)%term
    r=0
    for i in range(term):
        r += ll[100000-term+i]
    s += r * p
    for i in range(q):
        s += ll[100000-term+i]
    print(s%)
Problem p02753 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools

p=input()

if p=='AAA' or p == 'BBB':
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
#
import sys
import math
#import numpy as np
import itertools

# いくつか入力
n,p = (int(i) for i in input().split())
# 空白区切りの数列をリストに代入
s = [int(i) for i in list(input())] 

answer = 0
#print(s)
for i in range(n):
    q=0
    for j in range(i,n):
        q=q*10+s[j]
        if q%p==0:
            answer += 1
print(answer)
Problem p02863 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools
# いくつか入力
n,t = (int(i) for i in input().split())

# n行の複数列ある数値を二次元配列へ。x[n][?]
ab = [[int(i) for i in input().split()] for i in range(n)]
# 0:weight 1:value

ab = sorted(ab,key=lambda x: x[1])

dp = np.zeros((n+1,t),int)
dp2 = np.zeros((n+1,t),int)

for i in range(n):
    w = ab[i][0]
    dp[i+1][w:] = np.fmax(dp[i][:-w] + ab[i][1], dp[i][w:])
    dp2[i+1][w:] = np.fmax(dp2[i][:-w] + ab[i][1],dp[i][w:] + ab[i][1], dp2[i][w:])
    dp[i+1][:w] = dp[i][:w]
    dp2[i+1][:w] = np.fmax(dp[i][:w] + ab[i][1], dp2[i][:w])

answer = np.amax(dp2)
print(answer)

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools
# いくつか入力
n,t = (int(i) for i in input().split())

# n行の複数列ある数値を二次元配列へ。x[n][?]
ab = [[int(i) for i in input().split()] for i in range(n)]
# 0:weight 1:value

ab = sorted(ab,key=lambda x: x[1])

dp = np.zeros((n+1,t),int)
dp2 = np.zeros((n+1,t),int)

for i in range(n):
    for w in range(t):
        if w >= ab[i][0] :
            dp[i+1][w] = np.max(dp[i][w-ab[i][0]] + ab[i][1], dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]
        if w >= ab[i][0] :
            dp2[i+1][w] = np.max(dp2[i][w-ab[i][0]] + ab[i][1],dp[i][w] + ab[i][1], dp[i][w])
        else:
            dp2[i+1][w] = np.max(dp[i][w] + ab[i][1], dp[i][w])

answer =0
for i in range(n+1):
    for w in range(t):
        answer = np.max(answer, dp2[i][w])
print(answer)

#print(dp2)
Problem p02873 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools

# 文字列を一文字ずつのリストに代入 test は['t', 'e', 's', 't']
s = list(input())
t = [0]
now = 0
if s[0]=='<':
    now = 1
else:
    now = -1

for i in range(1,len(s)):
    if s[i]=='<' and now > 0:
        now += 1
    elif s[i]=='<' and now < 0:
        t.append(now)
        now = 1
    elif s[i]=='>' and now < 0:
        now -= 1
    elif s[i]=='>' and now > 0:
        t.append(now)
        now = -1
t.append(now)

answer=0
for i in range(1,len(t)):
    if t[i-1] > 0 and t[i] < 0:
        if t[i-1] < -t[i]:
            t[i-1] -= 1
        else:
            t[i] += 1
for i in range(len(t)):
    answer += abs(t[i]) * (abs(t[i]) + 1) // 2
#print(t)
print(answer)

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools

# 文字列を一文字ずつのリストに代入 test は['t', 'e', 's', 't']
s = list(input())
t = [0]
now = 0
for i in range(len(s)):
    print(i,t)
    if s[i]=='<':
        now += 1
        t.append(now)
    elif now == 0:
        now = -1
        t.append(now)
        if now == -1:
            t[i+1] += 1
            now += 1
            for j in range(i,-1,-1):
                if t[j]==t[j+1]:
                    t[j] += 1
                else:
                    break
    else:
        now = 0
        t.append(now)

answer=0
for i in range(len(t)):
    answer += t[i]

print(answer)
Problem p03013 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools

MOD = 1000000007
# いくつか入力
n,m = (int(i) for i in input().split())  

# n行の数をリストに
a = [int(input()) for i in range(m)] 
a.append(9999999) # sentinel
dame=0

b=[1]
if a[dame]==1:
    dame += 1
    b.append(0)
else:
    b.append(1)

for i in range(2,n+1):
    if i==a[dame]:
        dame += 1
        b.append(0)
    else:
        c=(b[i-1]+b[i-2]) % MOD
        b.append(c)

#print(a,b)
print(b[n])

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools

# いくつか入力
n,m = (int(i) for i in input().split())  

# n行の数をリストに
a = [int(input()) for i in range(m)] 
a.append(9999999) # sentinel
dame=0

b=[1]
if a[dame]==1:
    dame += 1
    b.append(0)
MOD = 1000000007

for i in range(2,n+1):
    if i==a[dame]:
        dame += 1
        b.append(0)
    else:
        c=(b[i-1]+b[i-2])%MOD
        b.append(c)

#print(a,b)
print(b[n])
Problem p03127 (python)

Fixed submission:
#
import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())

# リストに入れる
a = [int(i) for i in input().split()] 

def gcd(p,q):
    if p < q:
        r = p
        p = q
        q = r
    if q == 0:
        return p
    r = p % q
    return gcd(q,r)
        

for i in range(1,n):
    a[0] = gcd(a[0],a[i])
print(a[0])

Buggy submission (verdict: Runtime Error):
#
import sys
import math
import numpy as np
import itertools


# ひとつ入力
n = int(input())

# リストに入れる
a = [int(i) for i in input().split()] 

for i in range(1,n):
    a[0] = math.gcd(a[0],a[i])
print(a[0])
Problem p02753 (python)

Fixed submission:
s = input()
a = [str(i) for i in s]

if a[0] == a[1] and a[1] == a[2] and a[2] == a[0]:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
a = [s]

for i in range(q):
    so = input()
    if so == '1':
        a[0], a[-1] = a[-1], a[0]
    else:
        d, f, c = so.split()
        if f == '1':
            a.insert(0, c)
        else:
            a.append(c)


print(''.join(a))
Problem p02547 (python)

Fixed submission:
n = int(input())
count = 0
flag = 0

for i in range(n):
    d1, d2 = map(int,input().split())

    if d1 == d2 :
        count += 1
    else:
        count = 0

    if count == 3:
        flag = 1


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

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

for i in range(n):
    d1, d2 = map(int,input().split())

    if d1 == d2 :
        count += 1
    else:
        count = 0

    if count == 3:
        flag = 1


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

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

for i in range(n):
    d1, d2 = map(int,input().split())

    if d1 == d2 :
        count += 1
    else:
        count = 0

    if count == 3:
        flag = 1;


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

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

for i in range(n):
    d1 = int(input())
    d2 = int(input())

    if d1 == d2:
        num_of_double += 1

if num_of_double >= 3:
    print("Yes")
else:
    print("No")
Problem p02622 (python)

Fixed submission:
s = input()
t = input()

result = 0
for i, v in enumerate(s):
  if t[i] != v :
    result += 1
    
print(result)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()

result = 0
for i, v in enumerate(s):
  if t[i] !== v :
    result += 1
    
print(result)
Problem p02633 (python)

Fixed submission:
import sys

X = int(input())

n = 1
while True:
    if 360 * n % X == 0:
        print(360 * n // X)
        break
    n += 1

Buggy submission (verdict: Runtime Error):
X = int(input)
print(360 / x)
Problem p02712 (python)

Fixed submission:
N = int(input())

print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))

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

print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))
Problem p02847 (python)

Fixed submission:
S = input()

days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - days.index(S))

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

days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'}
print(7 - days.index(S))
Problem p02546 (python)

Fixed submission:
singular = input()
if singular[-1] == "s":
    print(singular + "es")
else:
    print(singular + "s")

Buggy submission (verdict: Runtime Error):
    singular = input()
    if singular[-1] == "s":
        print(singular + "es")
    else:
        print(singular + "s")

Buggy submission (verdict: Runtime Error):
singular = input()
if singular[-1] == "s":
    print(singular + "es)
else:
    print(singular + "s")
Problem p02547 (python)

Fixed submission:
doubletCount = 0
cases = int(input())
for roll in range(cases):
    d1, d2 = map(int, input().split())
    if d1 == d2:
        doubletCount += 1
    else:
        doubletCount = 0
                
    if doubletCount >= 3:
        print("Yes")
        break
            
    if roll == cases - 1:
        print("No")

Buggy submission (verdict: Runtime Error):
    doubletCount = 0
    cases = int(input())
    for roll in range(cases):
        d1, d2 = map(int, input().split())
        if d1 == d2:
            doubletCount += 1
        else:
            doubletCount = 0
            
        if doubletCount >= 3:
            print("Yes")
            break
        
        if roll == cases - 1:
            print("No")
Problem p02819 (python)

Fixed submission:
def check_prime(num):
  for i in range(2,num):
    if (x % i == 0):
      return False
      break
  else: 
    return True
 
if __name__ == "__main__":
  x = int(input())
  flag = True
  while flag: 
    if (check_prime(x)):
      print(x)
      flag = False
    else: 
      x = x + 1

Buggy submission (verdict: Runtime Error):
def check_prime(num):
  for i in range(2,num):
    if (x % i == 0):
      return False
      break
  else: 
    return True
 
if _name_ == "_main_":
  x = int(input())
  flag = True
  
  while flag: 
    if (check_prime(x)):
      print(x)
      flag = False
    else: 
      x = x + 1
Problem p02570 (python)

Fixed submission:
d, t, s = map(int, input().split())
ans = d/s
print('Yes' if ans <= t else "No")

Buggy submission (verdict: Runtime Error):
d, t, s = map(int, input().split())
ans = d/s
print('Yes' if ans < float(t) else "No"
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):
K, N = map(int, input().split())
A = list(map(int, input().split()))

for i in range(0, N): 
        for j in range(i + 1, N): 
            if A[i] + A[j] == K: 
                if A[i] > A[j]:
                    print(A[i] - A[j])
                else:
                    print(A[j] - A[i])
Problem p02753 (python)

Fixed submission:
s = input()

if (s[0] == s[2]) and (s[0] != s[1]):
    print('Yes')
elif (s[1] == s[2]) and (s[0] != s[2]):
    print('Yes')
elif (s[0] == s[1]) and (s[0] != s[2]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
stations = input()
s = stations.split()

if (s[0] == s[1] == s[2]):
    print('No')
elif (s[0] != s[1] != s[2]):
    print('No')
else:
    print('Yes')
Problem p02771 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if (a == b and c != a) or (a == c and b != a):
  print ('Yes')
elif b == c and a != b:
  print ('Yes')
else:
  print ('No')

Buggy submission (verdict: Runtime Error):
a, b, c = (int, raw_input().split())
 
if a == b or a == c:
  print ('Yes')
elif b == c:
  print ('Yes')
else:
  print ('No')

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

if a == b or a == c:
  print ('Yes')
elif b == c:
  print ('Yes')
else:
  print ('No')
Problem p02831 (python)

Fixed submission:
a,b = map(int,input().split())
x=max(a,b)
y=min(a,b)

def gcd(m,n):
    x=max(m,n)
    y=min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z

ans=a*b/gcd(a,b)
print(int(ans))

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

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

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(math.gcd(a, b))
Problem p02835 (python)

Fixed submission:
li = list(map(int,input().split()))
if li[0]+li[1]+li[2]>=22:
  print('bust')
else:
	print('win')

Buggy submission (verdict: Runtime Error):
A1,A2,A3=map(int,input().split())
A=A1+A2+A3
if　A>=22:
  print("bust")
else
	print("win")
Problem p02847 (python)

Fixed submission:
s=input()
if s=='MON':
  print(6)
elif s=='TUE':
  print(5)
elif s=='WED':
  print(4)
elif s=='THU':
  print(3)
elif s=='FRI':
  print(2)
elif s=='SAT':
  print(1)
else:
  print(7)

Buggy submission (verdict: Runtime Error):
if str(input())="SUN":
	print(7)
elif str(input())="MON":
  print(6)
elif str(input())="TUE":
  print(5)
elif str(input())="WED":
  print(4)
elif str(input())="THU":
  print(3)
elif str(input())="FRI":
  print(2)
elif str(input())="SAT":
  print(1)

Buggy submission (verdict: Runtime Error):
if str(input())='SUN':
	print(7)
elif str(input())='MON':
  print(6)
elif str(input())='TUE':
  print(5)
elif str(input())='WED':
  print(4)
elif str(input())='THU':
  print(3)
elif str(input())='FRI':
  print(2)
elif str(input())='SAT':
  print(1)

Buggy submission (verdict: Runtime Error):
if str(input())='SUN':
	print(7)
elif str(input())='MON':
  print(6)
elif str(input())='TUE':
  print(5)
elif str(input())='WED':
  print(4)
elif str(input())='THU':
  print(3)
elif str(input())='FRI':
  print(2)
elif str(input())='SAT':
  print(1)
end

Buggy submission (verdict: Runtime Error):
if input()='SUN':
	print(7)
elif input()='MON':
  print(6)
elif input()='TUE':
  print(5)
elif input()='WED':
  print(4)
elif input()='THU':
  print(3)
elif input()='FRI':
  print(2)
elif input()='SAT':
  print(1)
end

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

Buggy submission (verdict: Runtime Error):
if input()=='SUN':
	print(7)
elif input()=='MON':
  print(6)
elif input()=='TUE':
  print(5)
elif input()=='WED':
  print(4)
elif input()=='THU
  print(3)
elif input()=='FRI':
  print(2)
elif input()=='SAT':
  print(1)

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

Fixed submission:
r=int(input())
print(r*r)

Buggy submission (verdict: Runtime Error):
r=input()
print(r*r)

Buggy submission (verdict: Runtime Error):
r=input()
print(r*r

Buggy submission (verdict: Runtime Error):
r=input()
print(r^2)
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2==0:
	print(1/2)
else:
  	print((n-(n-1)/2)/n)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input().split()
ans=''
for i in range(1,n+1):
    ans+=str(a.index(str(i))+1)+' '

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(input())
ans=''
for i in range(1,n+1):
    ans+=str(a.index(str(i))+1)+' '

print(ans)
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
s=int(input())

if a>=3200:
  print(s)
else:
  print('red')
Problem p03011 (python)

Fixed submission:
li=list(map(int,input().split()))
print(min(li[0]+li[1],li[0]+li[2],li[1]+li[2]))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=0
if m!=0:
    a=int(input())
b=1
s=[1]*(n+1)
for i in range(1,n+1):
    if i!=a:
        if i-2>=0:
            s[i]=(s[i-1]+s[i-2])%1000000007
        else:
            s[i]=s[i-1]%1000000007
    elif b!=m:
        s[i]=0
        a=int(input())
        b+=1
    else:
        s[i]=0
print(s[n])
Problem p03013 (python)

Fixed submission:
n,m=map(int,input().split())
a=0
if m!=0:
    a=int(input())
    
b=1
s=[1]*(n+1)
for i in range(1,n+1):
    if i!=a:
        if i-2>=0:
            s[i]=(s[i-1]+s[i-2])%1000000007
        else:
            s[i]=s[i-1]%1000000007
    elif b!=m:
        s[i]=0
        a=int(input())
        b+=1
    else:
        s[i]=0
print(s[n])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=int(input())
b=1
s=[1]*(n+1)
for i in range(1,n+1):
    if i!=a:
        if i-2>=0:
            s[i]=(s[i-1]+s[i-2])%1000000007
        else:
            s[i]=s[i-1]%1000000007
    elif b!=m:
        s[i]=0
        a=int(input())
        b+=1
    else:
        s[i]=0
print(s[n])
Problem p03804 (python)

Fixed submission:
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        flag=True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l]!=b[k][l]:
                    flag=False
                    break
            if not flag:
                break
        if flag:
            print('Yes')
            break
    if flag:
        break

if not flag:
    print('No')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[input() for i in range(n)]
b=[input() for i in range(m)]

for i in range(n-m):
    for j in range(n-m):
        flag=True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l]!=b[k][l]:
                    flag=False
                    break
            if not flag:
                break
        if flag:
            print('Yes')
            break

if not flag:
    print('No')
Problem p03834 (python)

Fixed submission:
li=input().split(',')
print(li[0]+' '+li[1]+' ' + li[2])

Buggy submission (verdict: Runtime Error):
li=input().spl;it(',')
print(li[0]+' '+li[1]+' ' + li[2])
Problem p03315 (python)

Fixed submission:
i = input()
p = i.count("+")
print(2*p-4)

Buggy submission (verdict: Runtime Error):
in = input()
plus = in.count("+")
print(plus*2-4)
Problem p02571 (python)

Fixed submission:
s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t) + 1):
    for j in range(len(t)):
        if s[i+j] != t[j]:
            count += 1

    l.append(count)
    count = 0
print(min(l))

Buggy submission (verdict: Runtime Error):
s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t)):
    for j in range(len(t)):
        if s[i+j] != t[j]:
            count += 1

    l.append(count)
    count = 0
print(min(l))
Problem p02915 (python)

Fixed submission:
n = int(input())
ans = n * n * n
print(ans)

Buggy submission (verdict: Runtime Error):
n = map(int,input().split())
ans = n * n * n
print(ans)
Problem p03072 (python)

Fixed submission:
n = int (input())
h = list(map(int,input().split()))
max_num = 0
ans = 0
for i in range (n):
  if h[i] >= max_num:
    max_num = h[i]
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
list = []
num = 0
for i in range(N-1):
    list.append(i)
    if list[0] <= list[i]:
        flag = 1
    else:
        flag = 0

if flag == 1:
    for j in range(N-1):
        for k in range(N-1):
            if list[j] > list[k]:    #jが比較対象
                flag = 0      #flag = 1の時カウント、０の時はカウントしない
    num += 1

print(num)
Problem p02773 (python)

Fixed submission:
n=int(input())
s=sorted([input() for i in range(n)])
ans = ['']
x=1
max=0
for k in range(n):
    if k<n-1:
        if s[k]==s[k+1]:
            x+=1
        else:
            if max<x:
                ans=[s[k]]
                max=x
            elif max==x:
                ans.append(s[k])
            x=1
    else:
        if max<x:
            ans=[s[k]]
            max=x
        elif max==x:
            ans.append(s[k])

    

for j in range(len(ans)):
    print(ans[j])

Buggy submission (verdict: Runtime Error):
n=int(input())
s=sorted([input() for i in range(n)])
ans = ['']
x=1
max=0
for k in range(n):
    if k<n-1:
        if s[k]==s[k+1]:
            x+=1
        else:
            if max<x:
                ans=[s[k]]
                max=x
            if max==x:
                ans.append(s[k])
            x=1
    else:
        if max<x:
            ans=[s[k]]
            max=x
        if max==x:
            ans.append(s[k])

    
print(0)
for j in range(ans.max):
    print(ans[j])
Problem p02835 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[0]+a[1]+a[2] <= 21:
  print('win')
else:
  print('bust')

Buggy submission (verdict: Runtime Error):
def resolve():
    li = input().split()

    if li[0]+li[1] < 8:
        print("win")
    else if [0]+li[1];li[2] <= 22:
        print("win")
    else:
        print("bust")

Buggy submission (verdict: Runtime Error):
def resolve():
    li = input().split()

    if li[0]+li[1]+li[2] => 22:
        print("bust")
    else:
        print("win")

Buggy submission (verdict: Runtime Error):
li = input().split()

if li[0]+li[1]+li[2] => 22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
li = input().split()

if li[0]+li[1]+li[2] >= 22:
    print("bust")
else:
    print("win")
Problem p02577 (python)

Fixed submission:
s = input()
ans = 0
for i in range(len(s)):
    ans += int(s[i])
    
if ans%9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
while (n != 0): 
  
    sum = sum + int(n % 10) 
    n = int(n/10) 

    
if (sum%9) == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
while (n != 0): 
  
    sum = sum + int(n % 10) 
    n = int(n/10) 

    
if (sum%9) == 0:
    print("YES")
else:
    print("NO")