Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):

N=int(input())
S=list(input())
bango=[]
ans=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            s=[S[i],S[j],S[k]]
            n=''.join(s)
            if n not in bango:
                ans+=1
            bango.append(n)
print(ans)

Fixed submission:

N=int(input())
S=list(input())
numlist=range(1000)
ans=0

for i in numlist:
    num=str(i)
    if len(num)==1:
        num="00"+num
    if len(num)==2:
        num="0"+num
    if num[0] in S[:N-1]:
        num1=S.index(num[0])
        if num[1] in S[num1+1:N-1]:
            S2=S[num1+1:N-1]
            num2=S2.index(num[1])+num1+1
            if num[2] in S[num2+1:]:
                ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,T = map(int,input().split())

C = int((T + 1/2)//A)
ans = B*C

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Thu May 30 18:10:37 2019

@author: またの
"""

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0

for i in range(N):
    if V[i]-C[i]>0:
        ans += V[i]-C[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()

l=len(S)

ans=0
ans_list=()

for i in range(l):
    if S[i] in ("A","G","C","T"):
        ans+=1
    else:
        ans_list.append(ans)
        ans=0
ans_list.append(ans)
print(ans)
    

Fixed submission:
s = input()
t = ''
for i in range(len(s)):
    if s[i] in ('A', 'C', 'G', 'T'):
        t += '1'
    else:
        t += '0'
"""
print(t)
print(t.split('0'))
"""

print(max(map(len, t.split('0'))))
Buggy python submission (verdict: Runtime Error):
N,Q = map(int,input().split())
S = input()
A = []
L = []

for i  in range(N-1):
    if S[i]=='A' and S[i+1]=='C':
        A.append(i+2)
for i in range(Q):
    L=list(map(int,input().split()))
    minA=bisect_left(A,L[0])
    maxA=bisect_left(A,L[1])
    print(maxA-minA)



Fixed submission:
from bisect import bisect_left, bisect_right

N,Q = map(int,input().split())
S = input()
A = []
L = []

for i  in range(N-1):
    if S[i]=='A' and S[i+1]=='C':
        A.append(i)
        
for i in range(Q):
    L=list(map(int,input().split()))
    minA=bisect_left(A,L[0]-1)
    maxA=bisect_left(A,L[1]-1)
    print(maxA-minA)

Buggy python submission (verdict: Time Limit Exceeded):
N,Q = map(int,input().split())
S = input()
A = []
L = []

for i  in range(N-1):
    if S[i]=='A' and S[i+1]=='C':
        A.append(i+2)
for i in range(Q):
    L=list(map(int,input().split()))
    print(sum(L[0]< x <=L[1] for x in A))


Fixed submission:
from bisect import bisect_left, bisect_right

N,Q = map(int,input().split())
S = input()
A = []
L = []

for i  in range(N-1):
    if S[i]=='A' and S[i+1]=='C':
        A.append(i)
        
for i in range(Q):
    L=list(map(int,input().split()))
    minA=bisect_left(A,L[0]-1)
    maxA=bisect_left(A,L[1]-1)
    print(maxA-minA)

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int,input().split())
S = input()
L = []

for i in range(Q):

    L = (list(map(int,input().split())))
    M = S[L[0]-1:L[1]]
    print(M.count('AC'))

Fixed submission:
from bisect import bisect_left, bisect_right

N,Q = map(int,input().split())
S = input()
A = []
L = []

for i  in range(N-1):
    if S[i]=='A' and S[i+1]=='C':
        A.append(i)
        
for i in range(Q):
    L=list(map(int,input().split()))
    minA=bisect_left(A,L[0]-1)
    maxA=bisect_left(A,L[1]-1)
    print(maxA-minA)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = abs(A-(T-0.006*H[0]))
for i in range(N):
    C = abs(A-(T-0.006*H[i]))
    if B>C:
        B = C
        ans = i+1
print(ans)


Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = abs(A-(T-0.006*H[0]))
for i in range(N):
    C = abs(A-(T-0.006*H[i]))
    if B>=C:
        B = C
        ans = i+1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

if N ==1:
    print("Hello World")
else:
    print(A+B)

Fixed submission:
N = int(input())


if N ==1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)

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

if N ==1:
    print("Hello world")
else:
    print(A+B)

Fixed submission:
N = int(input())


if N ==1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):

def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append()
    return(len(A))
    
n=int(input())

print(yakusu(n))

Fixed submission:
def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append(i)
    return(len(A))
    
n=int(input())
ans=0

for j in range(1,n+1,2):
    if yakusu(j)==8:
        ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
listsum = 0
for i in range(n-1):
    for j in range(i+1,n):
        listsum += a[i]*a[j]%mod
        listsum = listsum%mod
print(listsum)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
listsum = sum(a)
kotae = 0
for i in range(n-1):
    listsum -= a[i]
    kotae += listsum*a[i]%mod

print(kotae%mod)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
l = 0
s = list()
for i in range(1,9000000):
    l = (l*10+7)%k
    if l == 0:
        print(i)
        exit()
    else:
        if s.count(l) == 0:
            s.append(l)
        else:
            print(-1)
            exit()
print(-1)
exit()

Fixed submission:
k = int(input())
l = 0
s = set()
for i in range(1,9000000):
    l = (l*10+7)%k
    if l == 0:
        print(i)
        exit()
    else:
        s.add(l)
        if len(s) == i-1:
            print(-1)
            exit()
print(-1)
exit()

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
l = 0
s = [False]*9000000
for i in range(1,9000000):
    l = (l*10+7)%k
    if l == 0:
        print(i)
        exit()
    else:
        if s[i] == True:
            print(-1)
            exit()
        else:
            s[i] = True
print(-1)
exit()

Fixed submission:
k = int(input())
l = 0
s = set()
for i in range(1,9000000):
    l = (l*10+7)%k
    if l == 0:
        print(i)
        exit()
    else:
        s.add(l)
        if len(s) == i-1:
            print(-1)
            exit()
print(-1)
exit()
Buggy python submission (verdict: Runtime Error):
print(int(input()%1000)

Fixed submission:
n = int(input()) % 1000
if n == 0:
    print(0)
else:
    print(1000-n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
x = 1
mod = 10**18
for i in range(n):
    x *= l[i]
if x > mod:
    print(-1)
    exit()
print(x)


Fixed submission:
n = int(input())
l = list(map(int, input().split()))
x = 1
mod = 10**18
if 0 in l:
    print(0)
    exit()
for i in range(n):
    x *= l[i]
    if x > mod:
        print(-1)
        exit()
print(x)
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = map(int, input().split())
if i%k == 0:
    print("OK")
    exit()
print("NG")

Fixed submission:
k = int(input())
a,b = map(int, input().split())
for i in range(a,b+1):
    if i%k == 0:
        print("OK")
        exit()
print("NG")

Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = map(int, input().split())
    if i%k == 0:
        print("OK")
        exit()
print("NG")

Fixed submission:
k = int(input())
a,b = map(int, input().split())
for i in range(a,b+1):
    if i%k == 0:
        print("OK")
        exit()
print("NG")
Buggy python submission (verdict: Runtime Error):
A,B,M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x = list()
y = list()
z = list()
cheapest = min(a) + min(b)
for i in range(M):
    l,m,n = map(int, input().split())
    x = a[l-1] + a[m-1]- n
    if x < cheapest:
        cheapest = x
print(cheapest)


Fixed submission:
A,B,M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cheapest = min(a) + min(b)
for i in range(M):
    l,m,n = map(int, input().split())
    x = a[l-1] + b[m-1]- n
    if x < cheapest:
        cheapest = x
print(cheapest)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
x = 1
for i in range(n):
    for j in range(x, n):
        if a[i] == a[j]:
            print("NO")
            quit()
    x += 1
    if x == n:
        print("YES")
        quit()

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = set(a)
if len(a) == len(b):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
p = list()
s = list()
for i in range(m):
    a,b = input().split()
    p.append(int(a))
    s.append(b)
toi = set(p)
x = -1
ac = 0
pen = 0
check = False
for i in toi:
    for j in range(p.count(i)):
        x += 12
        if s[x] == "AC":
            if not check:
                check = True
                ac += 1
        else:
            if not check:
                pen += 1
    check = False
print(ac,pen)


Fixed submission:
n,m = map(int, input().split())
ac = [False for i in range(n)]
pen = [0 for i in range(n)]
s = list()
p = list()
for i in range(m):
    a,b = input().split()
    a = int(a)
    s.append(a)
    p.append(b)
for i in range(m):
    if ac[s[i]-1] == True:
        pass
    else:
        if p[i] == "AC":
            ac[s[i]-1] = True
        else:
            pen[s[i]-1] += 1
wa = 0
for i in range(n):
    if ac[i] == True:
        wa += pen[i]
print(sum(ac), wa)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(math.floor(a*b/math.gcd(a, b)))

Fixed submission:
import math
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
def lcm(m, n):
    return int(m*n/gcd(m,n))
a, b = map(int, input().split())
print(lcm(a,b))

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

Fixed submission:
import math
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
def lcm(m, n):
    return int(m*n/gcd(m,n))
a, b = map(int, input().split())
print(lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return math.floor(x * y/math.gcd(x, y))
a, b = map(int, input().split())
print(lcm(a,b))


Fixed submission:
import math
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
def lcm(m, n):
    return int(m*n/gcd(m,n))
a, b = map(int, input().split())
print(lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return int((x * y)/math.gcd(x, y))
a, b = map(int, input().split())
print(lcm(a,b))


Fixed submission:
import math
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
def lcm(m, n):
    return int(m*n/gcd(m,n))
a, b = map(int, input().split())
print(lcm(a,b))

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a, b = map(int, input().split())
print(lcm(a,b))

Fixed submission:
import math
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
def lcm(m, n):
    return int(m*n/gcd(m,n))
a, b = map(int, input().split())
print(lcm(a,b))
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int,input().split()))
c = []
for val in range(a):
    c.append(5)
for val in range(a):
    c[b[val]-1] = val+1
d = str()
for val in c:
    d = d + str(val) + " "
d = d.rstrip()
print(d)

Fixed submission:
a = int(input())
b = list(map(int,input().split()))
c = []
for val in range(a):
    c.append(5)
for val in range(a):
    c[b[val]-1] = val+1
d = str()
for val in range(len(c)-1):
    print(c[val], end = ' ')
print(c[-1])

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int,input().split()))
c = []
for val in range(a):
    c.append(5)
for val in range(a):
    c[b[val]-1] = val+1
    d = str()
for val in c:
    d = d + str(val) + " "
d = d.rstrip()
print(d)

Fixed submission:
a = int(input())
b = list(map(int,input().split()))
c = []
for val in range(a):
    c.append(5)
for val in range(a):
    c[b[val]-1] = val+1
d = str()
for val in range(len(c)-1):
    print(c[val], end = ' ')
print(c[-1])
Buggy python submission (verdict: Time Limit Exceeded):
pnum, default, correct = map(int, input().split())
pep = [default]*pnum
a = list()
for i in range(correct):
    a.append(int(input()))
for i in a:
    for j in range(pnum):
        pep[j] -= 1
    pep[i-1] += 1
for i in pep:
    if i > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, shoki, correct = map(int, input().split())
b = list()
for i in range(correct):
    b.append(int(input()))
a = [shoki]*n
a = [i-correct for i in a]
for i in b:
    a[i-1] += 1
for i in range(n):
    if a[i] <= 0:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))
kari = 0
honto = 0
for i in range(n-1):
    kari = 0
    for j in range(i,n-1):
        if h[j+1] <= h[j]:
            kari += 1
        else:
            break
    if honto < kari:
        honto = kari
print(honto)



Fixed submission:
n = int(input())
l = list(map(int, input().split()))
kari = 0
p = 0
for i in range(n-1):
    if l[i+1] <= l[i]:
        kari += 1
        if kari > p:
            p = kari
    else:
        if kari > p:
            p = kari
        kari = 0
print(p)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
for i in range(n-1):
    if h[i] > h[i+1]:
        if i == 0:
            h[i] -= 1
            if h[i] > h[i+1]:
                print("No")
                quit()
        else:
            if h[i-1] >= h[i]:
                print("No")
                quit()
            else:
                h[i] -= 1
                if h[i] > h[i+1]:
                    print(No)
                    quit()

print("Yes")

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

x = -999
h.reverse()
for i in range(n):
    if i == 0:
        continue
    if h[i] > h[i-1]:
        if h[i]-h[i-1] == 1:
            h[i] -= 1
        else:
            print("No")
            quit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
if n == 1:
    print("Yes")
    quit()
for i in range(n-1):
    if h[i] > h[i+1]:
        if i == 0:
            h[i] -= 1
            if h[i] > h[i+1]:
                print("No")
                quit()
        else:
            if h[i-1] >= h[i]:
                print("No")
                quit()
            else:
                h[i] -= 1
                if h[i] > h[i+1]:
                    print(No)
                    quit()

print("Yes")

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

x = -999
h.reverse()
for i in range(n):
    if i == 0:
        continue
    if h[i] > h[i-1]:
        if h[i]-h[i-1] == 1:
            h[i] -= 1
        else:
            print("No")
            quit()
print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
monster = list(map(int, input().split()))
yuusha = list(map(int, input().split()))
a = sum(monster)
for i in range(n):
    while yuusha[i] != 0:
        if monster[i] > 0:
            yuusha[i] -= 1
            monster[i] -= 1
        elif monster[i + 1] > 0:
            yuusha[i] -= 1
            monster[i + 1] -= 1
        else:
            break
a -= sum(monster)
print(a)


Fixed submission:
n = int(input())
monster = list(map(int, input().split()))
yuusha = list(map(int, input().split()))
a = sum(monster)
for i in range(n):
    if monster[i] < yuusha[i]:
        yuusha[i] -= monster[i]
        monster[i] = 0
        if monster[i+1] < yuusha[i]:
            yuusha[i] -= monster[i+1]
            monster[i+1] = 0
        else:
            monster[i+1] -= yuusha[i]
            yuusha[i] = 0
    else:
        monster[i] -= yuusha[i]
        yuusha[i] = 0
a -= sum(monster)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
second = sorted(a)[-2]
m = max(a)
for i in range(n):
    if max(a) == a[i] and a.count(a[i]) == 1:
        print(second)
    else:
        print(m)

Fixed submission:
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
second = sorted(a)[-2]
m = max(a)
for i in range(n):
    if m == a[i]:
        print(second)
    else:
        print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
for i in range(n):
    if max(a) == a[i] and a.count(a[i]) == 1:
        print(sorted(a)[-2])
    else:
        print(max(a))

Fixed submission:
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
second = sorted(a)[-2]
m = max(a)
for i in range(n):
    if m == a[i]:
        print(second)
    else:
        print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list()
b = list()
for i in range(n):
    x = input()
    a.append(int(x))
b = sorted(a)
for i in range(n):
    if b[-1] == a[i] and a.count(b[-1]) == 1:
        print(b[-2])
    else:
        print(b[-1])

Fixed submission:
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
second = sorted(a)[-2]
m = max(a)
for i in range(n):
    if m == a[i]:
        print(second)
    else:
        print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list()
b = list()
for i in range(n):
    x = input()
    a.append(int(x))
b = sorted(a)
for i in range(n):
    if b[-1] == a[i] and a.count(b[-1]):
        print(b[-2])
    else:
        print(b[-1])

Fixed submission:
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
second = sorted(a)[-2]
m = max(a)
for i in range(n):
    if m == a[i]:
        print(second)
    else:
        print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list()
for i in range(n):
    a.append(int(input()))
for i in range(n):
    b = a[:]
    b.pop(i)
    print(max(b))

Fixed submission:
n = int(input())
a = list()
for i in range(n):
    x = input()
    a.append(int(x))
second = sorted(a)[-2]
m = max(a)
for i in range(n):
    if m == a[i]:
        print(second)
    else:
        print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int, input().split()))
s = float("inf")
for i in range(1,n):
    x = abs(sum(w[0:i])-sum(w[i:n]))
    if x < s:
        s = x
print(s)

Fixed submission:
n = int(input())
s = list()
for i in range(n):
    a,b = input().split()
    b = int(b) * -1
    s.append([a,b])
h = sorted(s)
for i in range(n):
    print(s.index(h[i])+1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
dp = [float("inf")] * 100000
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])


Fixed submission:
n,k = map(int, input().split())
dp = [float("inf")] * 100000
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
dp = [float("inf")] * 100000
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])

Fixed submission:
n,k = map(int, input().split())
dp = [float("inf")] * 100000
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
dp = [float("inf")] * n*10
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])

Fixed submission:
n,k = map(int, input().split())
dp = [float("inf")] * 100000
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
dp = [float("inf")] * n
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])

Fixed submission:
n,k = map(int, input().split())
dp = [float("inf")] * 100000
h = list(map(int, input().split()))
dp[0] = 0
for i in range(n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
print(dp[n-1])
Buggy python submission (verdict: Runtime Error):
a = input()
for i in range(len(a)):
    if a[i] == "1":
        a[i] = "9"
    elif a[i] == "9":
        a[i] = "1"
print(a)

Fixed submission:
a = input()
l = list(a)
for i in range(len(a)):
    if l[i] == "9":
        l[i] = "1"
    elif l[i] == "1":
        l[i] = "9"
print("".join(l))
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
for i in range(n):
    for j in range(n):
        if i*4+j*7 == n:
            print("Yes")
            quit()
        if i*4+j*7 >= n:
            break
print("No")

Fixed submission:
a, b = map(int, input().split())
if a%b == 0:
    print(0)
else:
    print(1)