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

Fixed submission:
import math
import heapq

# 入力の取得(1行目。数値)
i = list(map(int, input().split()))

# 変数セット
# 1.購入する品物の数
itemCount = i[0]
# 2.割引券の数
discountTicketsCount = i[1]

# 入力の取得(2行目。数値)
priceList = list(map(int, input().split()))

# 「符号反転した」リストを優先度付きキューに変換
# ★ポイント★
# heapqは最小値しか取り出せないため、
# 符号反転してからキューに変換=>最小値を取る、という手法を行う。
priceList = [ n * -1 for n in priceList]
heapq.heapify(priceList)

# 割引件数分ループ
for i in  range(discountTicketsCount):

    # キューから最小値の取り出し(ここで符号反転も行っておく)
    target = abs(heapq.heappop(priceList))

    # 2で割る。(小数点切り下げ)
    target = math.floor(target / 2)

    # 割引券利用後の金額をキューに格納(ここで符号反転する)
    heapq.heappush(priceList, target * -1)

# 合計金額を出力
print(abs(sum(priceList)))

Buggy submission (verdict: Runtime Error):
import heapq

# 入力の取得(1行目。数値)
i = list(map(int, input().split()))

# 変数セット
# 1.購入する品物の数
itemCount = i[0]
# 2.割引券の数
discountTicketsCount = i[1]

# 入力の取得(2行目。数値)
priceList = list(map(int, input().split()))

# 「符号反転した」リストを優先度付きキューに変換
# ★ポイント★
# heapqは最小値しか取り出せないため、
# 符号反転してからキューに変換=>最小値を取る、という手法を行う。
priceList = [ n * -1 for n in priceList]
heapq.heapify(priceList)

# キューから最小値の取り出し
aaa = heapq.heappop(priceList)
print(aaa)
aaa = heapq.heappop(priceList)
print(aaa)


# 合計金額を出力
# print(sum(priceList))
Problem p02571 (python)

Fixed submission:
s=list(input())
t=list(input())
n=len(t)
m=len(s)
mn=n
for i in range(m-n+1):
    err=0
    for j in range(n):
        if s[i+j]!=t[j]:
            err+=1
    mn=min(mn,err)
print(mn)

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
n=len(t)
m=len(s)
for i in range(n):
    l=n-i
    for j in range(i+1):
        print(t[j:j+l],i,s[j:j+m-i])
        if ''.join(t[j:j+l]) in ''.join(s[j:j+m-i]):
            print(i)
            exit()
print(n)
Problem p02597 (python)

Fixed submission:
n=int(input())
c=list(input())
w=c.count('W')
ans=0
for i in range(n-w):
    if c[i]=='W':
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
c=list(input())
t=0
i=0
j=n-1
while c[i]=='R':
    i += 1
    if i>n-1:
        print(0)
        exit()
while c[j]=='W':
    j -= 1
    if j<0:
        print(0)
if i<j:
    i += 1
    j -= 1
    t += 1
while i<j:
    while c[i]=='R':
        i += 1
    while c[j]=='W':
        j -= 1
    i += 1
    j -= 1
    t += 1
print(t)
Problem p02629 (python)

Fixed submission:
n=int(input())
num=[]
t=1
count=1
while n>t*26:
    t *= 26
    n -= t
    count += 1
n -= 1
for i in range(count-1,-1,-1):
    m=26**i
    a=n//m
    n %= m
    num.append(a)
a_list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans=[]
for i in range(count):
    s=num[i]
    ans.append(a_list[s])
print(''.join(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
num=[]
t=1
count=1
while n>t*26:
    t *= 26
    n -= t
    count += 1

for i in range(count-1,-1,-1):
    m=26**i
    a=n//m
    n %= m
    num.append(a)
a_list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans=[]
for i in range(count):
    s=num[i]
    if i==count-1:
        s -= 1
    ans.append(a_list[s])
print(''.join(ans))
Problem p02735 (python)

Fixed submission:
h,w=map(int,input().split())
s=[]
for _ in range(h):
    s.append(list(input()))
a=[[0]]
for i in range(1,h):
    t=a[i-1][0]
    if s[i][0]!=s[i-1][0]:
        a.append([t+1])
    else:
        a.append([t])

for j in range(1,w):
    t=a[0][j-1]
    if s[0][j]!=s[0][j-1]:
        a[0].append(t+1)
    else:
        a[0].append(t)

for i in range(1,h):
    for j in range(1,w):
        up=a[i-1][j]
        left=a[i][j-1]
        if s[i][j]!=s[i-1][j]:
            up += 1
        if s[i][j]!=s[i][j-1]:
            left += 1
        mn=min(up,left)
        a[i].append(mn)
num=a[h-1][w-1]
ans=(num+1)//2
if s[0][0]=='#' and num%2==0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[]
for _ in range(h):
    s += list(input())

L=[int(x) for x in range(h+w-2)]
mn=(h+w)//2
import itertools
for route in itertools.permutations(L,h-1):
    route=sorted(route)
    if s[0]=='.':
        t=0
        count=0
    else:
        t=1
        count=2
    k=0
    for i in L:
        if i in route:
            if s[k]!=s[k+1]:
                if t==0:
                    count += 1
                    t=1
                else:
                    t=0
            k += 1
        else:
            if s[k]!=s[k+w]:
                if t==0:
                    count += 1
                    t=1
                else:
                    t=0
            k += w
    mn=min(mn,count)

print(mn)
Problem p02819 (python)

Fixed submission:
X=int(input())

for i in range(X,X*2):
    ok=0
    for j in range(2,i):
        if i%j == 0:
            ok += 1
    if ok == 0:
        print(i)
        break

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

for i in range(X,X*2):
    ok=0
    for j in range(2,i):
        if i%j == 0:
            ok += 1
    if ok == 0:
        print(i)
        break
Problem p02835 (python)

Fixed submission:
A1,A2,A3=map(int,input().split())

if A1+A2+A3>=22:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
A1,A2,A3=map(int,input().split)

if A1+A2+A3>=22:
    print("bust")
else:
    print("win")
Problem p03221 (python)

Fixed submission:
from collections import defaultdict
from bisect import bisect
n,m=map(int,input().split())
l=[tuple(map(int,input().split())) for _ in range(m)]
a=defaultdict(list)
for x,y in sorted(l):
    a[x]+=[y]

for x,y in l:
    z=bisect(a[x],y)
    print('%06d%06d'%(x,z))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from bisect import bisect
n,m=map(int,input().split())
l=[list(map(int,input().split()) for _ in range(m))]
a=defaultdict(list)
for x,y in sorted(l):
    a[x]+=[y]

for x,y in l:
    z=bisect(a[x],y)
    print('%06d%06d'%(x,z))
Problem p02779 (python)

Fixed submission:
list_len = int(input())
integer_list = input().split()
if list_len == len(set(integer_list)):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n_dice, n_choice = map(int, input().split())
dice_list = tuple(map(int, input().split()))
sumofarea_list = [sum(dice_list[i:i+n_choice]) for i in range(n_dice - n_choice + 1)]
print(max(sumofarea_list)/2 + n_choice / 2)
Problem p02597 (python)

Fixed submission:
N = int(input())

C = input()
firstW = -1
for i in range(N):
    if C[i] == "W":
        firstW = i
        break
for i in range(N-1,-1,-1):
    if C[i] == "R":
        firstR = i
        break

def checkR(ri,wi):
    for i in range(ri,wi,-1):
        if C[i] == "R":
            return i
    else:
        return -1

def checkW(ri,wi):
    for i in range(wi,ri):
        if C[i] == "W":
            return i
    else:
        return -1


if len(set(C)) == 1:
    print(0)
elif firstW > firstR:
    print(0)
else:
    ri = firstR
    wi = firstW
    cnt = 0
    while 1:
        wi = checkW(ri,wi+1)
        ri = checkR(ri-1,wi)
        if wi == -1 or ri == -1:
            break
        cnt += 1
    print(cnt+1)

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

C = input()
firstW = -1
for i in range(N):
    if C[i] == "W":
        firstW = i
        break
for i in range(N-1,-1,-1):
    if C[i] == "R":
        firstR = i
        break

def checkR(ri,wi):
    for i in range(ri,wi,-1):
        if C[i] == "R":
            return i
    else:
        return -1
def checkW(ri,wi):
    for i in range(wi,ri):
        if C[i] == "W":
            return i
    else:
        return -1


if firstW == -1 or firstW == N-1:
    print(0)
else:
    ri = firstR
    wi = firstW
    cnt = 0
    while 1:
        wi = checkW(ri,wi+1)
        ri = checkR(ri-1,wi)
        if wi == -1 or ri == -1:
            break
        cnt += 1
    print(cnt+1)
Problem p02712 (python)

Fixed submission:
N=int(input())
S=0

for i in range(1,N+1):
    if i%3!=0 and i%5!=0:
        S += i
print(S)

Buggy submission (verdict: Runtime Error):
N=int(input()[:-1])
ans=0
for i in range(1,N+1):
    if i%3==0 or i%5==0:
        pass
    else:
        ans+=1
print(ans)
Problem p02726 (python)

Fixed submission:
N, X, Y = map(int, input().split())
dis_comb = [0]*N

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

for i in range(1, N):
    print(dis_comb[i])

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

print(N)

for k in range(2, N):
    cnt = 0
    for i in range(1, N + 1):
        if X < i and i + k <= N:
            cnt += 1
        if i <= X and X - i + 1 == k:
            cnt += 2
        if i <= X and X - i + 2 <= k:
            if Y - (k - (X - i + 1)) > i + k:
                cnt += 2
            if Y - (k - (X - i + 1)) == i + k:
                cnt += 1
            if Y + (k - (X - i + 1)) <= N:
                cnt += 1
        if i + k <= X:
            cnt += 1
        if X < i and i+k < Y and:
            if i + k > Y-(k-(i-X+1)) and k-(i-X+1) >= 0:
                cnt += 1
                if Y+(k-(i-X+1)) <= N:
                    cnt += 1
    print(cnt)
Problem p02763 (python)

Fixed submission:
N = int(input())
S = ["*"]*(N+1)
S[1:] = list(input())
Q = int(input())
q1,q2,q3 = [0]*Q,[0]*Q,[0]*Q
for i in range(Q):
    tmp = input().split()
    q1[i],q2[i] = map(int,tmp[:2])
    if q1[i] == 2:
        q3[i] = int(tmp[2])
    else:
        q3[i] = tmp[2]

class BIT:
    def __init__(self, n, init_list):
        self.num = n + 1
        self.tree = [0] * self.num
        for i, e in enumerate(init_list):
            self.update(i, e)

    #a_kにxを加算
    def update(self, k, x):
        k = k + 1
        while k < self.num:
            self.tree[k] += x
            k += (k & (-k))
        return

    def query1(self, r):
        ret = 0
        while r > 0:
            ret += self.tree[r]
            r -= r & (-r)
        return ret

    #通常のスライスと同じ。lは含み、rは含まない
    def query2(self, l, r):
        return self.query1(r) - self.query1(l)

s_pos = [BIT(N+1,[0]*(N+1)) for _ in range(26)]

for i in range(1,N+1):
    s_pos[ord(S[i]) - ord("a")].update(i,1)

alphabets = [chr(ord("a") + i) for i in range(26)]

for i in range(Q):
    if q1[i] == 1:
        s_pos[ord(S[q2[i]]) - ord("a")].update(q2[i],-1)
        S[q2[i]] = q3[i]
        s_pos[ord(q3[i]) - ord("a")].update(q2[i],1)
    else:
        ans = 0
        for c in alphabets:
            if s_pos[ord(c) - ord("a")].query2(q2[i],q3[i]+1) > 0:
                ans += 1
        print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = ["*"]*(N+1)
S[1:] = list(input())
Q = int(input())
q1,q2,q3 = [0]*Q,[0]*Q,[0]*Q
for i in range(Q):
    tmp = input().split()
    q1[i],q2[i] = map(int,tmp[:2])
    if q1[i] == 2:
        q3[i] = int(tmp[2])
    else:
        q3[i] = tmp[2]

class BIT:
    def __init__(self, n, init_list):
        self.num = n + 1
        self.tree = [0] * self.num
        for i, e in enumerate(init_list):
            self.update(i, e)

    #a_kにxを加算
    def update(self, k, x):
        k = k + 1
        while k < self.num:
            self.tree[k] += x
            k += (k & (-k))
        return

    def query1(self, r):
        ret = 0
        while r > 0:
            ret += self.tree[r]
            r -= r & (-r)
        return ret

    #通常のスライスと同じ。lは含み、rは含まない
    def query2(self, l, r):
        return self.query1(r) - self.query1(l)

s_pos = [BIT(N+1,[0]*(N+1)) for _ in range(26)]

for i in range(1,N+1):
    s_pos[ord(S[i]) - ord("a")].update(i,1)

alphabets = [chr(ord("a") + i) for i in range(26)]

for i in range(Q):
    if q1[i] == 1:
        s_pos[ord(S[q2[i]]) - ord("a")].update(q2[i],-1)
        S[i] = q3[i]
        s_pos[ord(q3[i]) - ord("a")].update(q2[i],1)
    else:
        ans = 0
        for c in alphabets:
            if s_pos[ord(c) - ord("a")].query2(q2[i],q3[i]+1) > 0:
                ans += 1
        print(ans)
Problem p02831 (python)

Fixed submission:
import fractions

A, B = map(int, input().split())

print(int(A*B/fractions.gcd(A, B)))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())

print(int(A*B/math.gcd(A, B)))
Problem p02862 (python)

Fixed submission:

X, Y = map(int, input().split())
mod = 10 ** 9 + 7


def prime_mod(n, m):
    S = 1
    for i in range(1, n+1):
        S *= i
        S %= m
    return S


def prime_inv_mod(n, m):
    invs = [0] * (n + 1)
    invs[1] = 1
    for i in range(2, n + 1):
        invs[i] = m - invs[m % i] * (m//i) % m
    return invs


a = 2 * Y - X
b = 2 * X - Y
if a % 3 != 0 or b % 3 != 0 or a < 0 or b < 0:
    print(0)
else:
    a //= 3
    b //= 3
    upper = prime_mod(a+b, mod)
    mod_inv = prime_inv_mod(max(a, b), mod)

    lower1 = 1
    lower2 = 1
    for i in range(1, a + 1):
        lower1 *= mod_inv[i]
        lower1 %= mod
    for i in range(1, b + 1):
        lower2 *= mod_inv[i]
        lower2 %= mod

    print((upper*lower1*lower2) % mod)

Buggy submission (verdict: Runtime Error):

X, Y = map(int, input().split())
mod = 10 ** 9 + 7


def prime_mod(n, m):
    S = 1
    for i in range(1, n+1):
        S *= i
        S %= m
    return S


def prime_inv_mod(n, m):
    invs = [0] * (n + 1)
    invs[1] = 1
    for i in range(2, n + 1):
        invs[i] = m - invs[m % i] * (m//i) % m
    return invs


a = 2 * Y - X
b = 2 * X - Y
if a % 3 != 0 or b % 3 != 0:
    print(0)
else:
    a //= 3
    b //= 3
    upper = prime_mod(a+b, mod)
    mod_inv = prime_inv_mod(max(a, b), mod)

    lower1 = 1
    for i in range(1, max(a, b)+1):
        lower1 *= mod_inv[i]
        lower1 %= mod
        if i == min(a, b):
            lower2 = lower1
    print((upper*lower1*lower2) % mod)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
H, W = input().split()
# print(int(H))
# print(float(W))
ANS=int(H)*Decimal(W)
print(int(ANS))

Buggy submission (verdict: Runtime Error):
H, W = map(double, input().split())
print(int(H*W))
Problem p03042 (python)

Fixed submission:
# coding: utf-8
# Your code here!
A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<100:
    if M>0 and M<13:
        code=1

if M<100:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2

if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<20:
    if M>0 and M<13:
        code=1

if M<20:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2
if Y==19:
    M==12:
        code=2
if Y=12:
    M=19:
        code=1
        
if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")
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
    
def main():
    N,K=map(int,input().split())
    print(len(Base_10_to_n(N,K)))
main()

Buggy submission (verdict: Runtime Error):
def main():
    N,K=map(int,open(0).read().split())
    keta=1
    while flag==0:
        if K**keta<=N and K**(keta+1)>N:
            print(keta+1)
            return
        keta= keta+1

main()
Problem p02629 (python)

Fixed submission:
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[25] + name
                N = N//26
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)

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

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[26] + name
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)

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

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name = name + 'a'
    else:
            if N%26 == 0:
                name = name + alphabet[26]
            else:
                name = name + alphabet[N%26-1]
                N = N//26 +1
print(name)
Problem p02693 (python)

Fixed submission:
K = int(input())
A,B = map(int, input().split())
flg = 0
for i in range(A, B+1):
    if i%K == 0:
        flg = 1
if flg == 1:
    print('OK')
else:
    print('NG')

Buggy submission (verdict: Runtime Error):
A, B, N = map(int, input().split())
ans = 0
ans_max = 0
for x in range(1,N+1):
    ans = int(float(A*x)/float(B))-A*int(float(x)/float(B))
    if ans_max < ans:
        ans_max = ans
    if x > A and x > B:
        break
print(ans_max)
Problem p02699 (python)

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

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


for i in range(N):
    s = input()
    if i == 0:
        S.append(s)
    else:
        flg = 0
        j  = 0
        while(flg == 0 and j < len(S)):
            if S[j] == s:
                ans = ans - 1
                flg = 1
            j = j+1
        if flg == 0:
            S.append(s)
        
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
ans = 0
for j in range(len(S)):
    for i in range(j-2):
        if i < j:
            if int(S[i:j+1])%2019 == 0:
                ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
ans = N
for i in range(N):
    S.append(input())
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
            if len(S[j]) == len(S[i]):
                if S[j][0] == S[i][0]:
                    if S[j] == S[i]:
                        S[j] = ''
                        ans = ans - 1
                        flg = 1
        j = j+1
print(ans)
Problem p02701 (python)

Fixed submission:
N = int(input())
S = []
ans = N
S = [input() for i in range(N)]
#for i in range(N):
#    S.append(input())
S.sort()
for i in range(N-1):
    if S[i] == S[i+1]:
        ans = ans - 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
ans = N
for i in range(N):
    S.append(input())

for i in range(N):
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
            if S[j][0] == S[i][0]:
                if S[j] == S[i]:
                    S[j] = ''
                    ans = ans - 1
                    flg = 1
        j = j+1
print(ans)
Problem p03013 (python)

Fixed submission:
N, M = map(int, input().split())
breakstep = [True]*(N+1)
for _ in range(M):
    breakstep[int(input())] = False
#a = [breakstep[int(input())] for _ in range(M)]
dp = [0]*(N+1)

for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if breakstep[i]:
            dp[1] = 1
    else:
        if breakstep[i]:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0]*(N+1)
last_step= 0
for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if 1 == a[last_step]:
            dp[1] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[1] = 1
    else:
        if i  == a[last_step]:
            dp[i] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)
Problem p02779 (python)

Fixed submission:
# coding: utf-8
# Your code here!
n=int(input())
s=set(input().split())
if len(s)==n:
    print("YES")
else:
    print("NO")

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

flag=0
for i in range(N):
	count=0
	for j in range(N):
		if a[i]==a[j] and i!=j:
			count+=1
			print("No")
			flag+=count
			break
		else:
			continue
	if count>=1:
		break
if flag==0:
	print("Yes")
Problem p02699 (python)

Fixed submission:
a, b = map(int, input().split())
if a <= b:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())]
if a <= b:
  print("unsafe")
elif a > b:
  print("safe")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())]
if a < b:
  print("unsafe")
else:
  print("safe")
Problem p02711 (python)

Fixed submission:
a = input()
b = 0
for i in a:
    i = int(i)
    if i == 7:
        b += 1
if b == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
if 7 in n:
  print("Yes")
else:
  print("No")
Problem p02712 (python)

Fixed submission:
a = int(input())
sum = 0
list_number = []
for i in range(a):
    list_number.append(i + 1)
for i in list_number:
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        sum = sum + i
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(1, n + 1):
  if i !% 3 or i !% 5:
    sum = sum + i
print(sum)
Problem p02577 (python)

Fixed submission:
n = input()

s = 0
for i in range(0,len(n)):
    s += int(n[i:i+1])

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

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

s = 0
while True:
    x = n % 10
    s += x
    n = int(n/10)
    if(n==0):
        break
if s%9==0:
    print("Yes")
else:
    print("No")
Problem p02711 (python)

Fixed submission:
n = int(input())

for i in range(0,3):
    if( n % 10 == 7):
        print("Yes")
        break
    n = int(n / 10)
else:
    print("No")

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

for i in rang(0,2):
    if( n % 10 == 7):
        print("YES")
        break
    n /= 10
else:
    print("NO")