TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input('')
i == ''

if i == 1:
  i = 9
elsif i == 9:
  i = 1
  
print(n)

n =input()
if 111 =< n <= 999:
  

s = input()

r = ""
for i in s:
  if i =='1':
    r += '9'
  else:
    r += '1'
print(r)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
s=input()
for i in range(3):
  if s[i] =='9':
    s[i]='1'
  else:
    s[i]='9'
print(s)

s=input()
t=[]
for i in range(3):
  if s[i] =='9':
    t.append('1')
  else:
    t.append('9')
st="".join(t)
print(st)

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N = input()
for i in range(3):
  if N[i] == '1':
    N[i] == '9'
  else:
    N[i] == '1'

print(N)

N = input()
for i in range(2):
  if N[i] == '1':
    N[i] == '9'
  else:
    N[i] == '1'
print(N)

N = input()
for i in range(2):
  if N[i] == '1':
    N[i] == '9'
  else:
    N[i] == '1'
 

N = input()
for i in range(3):
  if N[i] == '1':
    N[i] = '9'
  else:
    N[i] = '1'
 
print(N)

N = input()
for i in range(3):
  if N[i] == '1':
    N[i] == '9'
  else:
    N[i] == '1'
print(N)

N = input()
print(N.translate(str.maketrans({'1': '9', '9': '1'})))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
x=input()
n=[x[i] for i in range(len(x))]
for i in range(len(n)):
  if n[i]=="1"or"9":
    if n[i]=="1":
      n[i]="9"
    else:
      n[i]=="1"
print(int("".join(n)))

n=input()
print(int("".join(["1" if n[i]==9 else "9" if n[i]==1 else n[i] for i in range(len(n))])))

x=input()
n=[x[i] for i in range(len(n))]
for i in range(len(n)):
  if n[i]=="1"or"9":
    if n[i]=="1":
      n[i]="9"
    else:
      n[i]=="1"
print(int("".join(n)))

n=input()
for i in range(len(n)):
  if n[i]=="1"or"9":
    if n[i]=="1":
      n[i]="9"
    else:n[i]=="1"
print(int(n))
    

n=input()
print(int("".join(["1" if n[i]=="9" else "9" if n[i]=="1" else n[i] for i in range(len(n))])))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
S = input()
ans = ""
for s in S:
    if s == 9:
        ans += "1"
    elif s == 1:
        ans += "9"
    else:
        ans += s
print(int(ans))

S = input()
ans = ""
for s in S:
    if s == 9:
        ans += "1"
    elif s == 1:
        ans += "9"
    else:
        ans += s
print(ans)

S = input()
ans = ""
for s in S:
    if s == "9":
        ans += "1"
    elif s == "1":
        ans += "9"
    else:
        ans += s
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n=int(input())
v=list(map(int,input().split()))
odd=[[0,0] for i in range(10**5+1)]
even=[[0,0] for i in range(10**5+1)]
for i in range(1,10**5+1):
    odd[i][1]=i
    even[i][1]=i
for i in range(n):
    if (i+1)%2==1:
        odd[v[i]][0]+=1
    else:
        even[v[i]][0]+=1
odd=sorted(odd,reverse=True)
even=sorted(even,reverse=True)
ans=0
if(odd[0][0]+even[0][0]==n): #odd[0][0]=n//2
    if(odd[0][1]==even[0][1]):
        ans=n//2
    else:
        ans=0

else:
    
    if(odd[0][1]==even[0][1]):
        if(odd[0][0]+even[1][0]<=odd[1][0]+even[0][0]):
            ans=(n//2-odd[1][0])+(n//2-even[0][0])
        else:
            ans=(n//2-odd[0][0])+(n//2-even[1][0])

    else:
        ans=(n//2-odd[0][0])+(n//2-even[0][0])
print(ans)


n=int(input())
n2=list(str(n))
for i in range(3):
    if n2[i]=="1":
        n2[i]="9"
    else:
        n2[i]="1"
new_n="".join(n2)
print(new_n)

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N = input()
 
if int(N) <= int(N[0] * 3):
    print(int(N[0] * 3))
else:
    print(int(str((int(N[0]) + 1)) * 3))

n = input()
d = {'1':'9', '9':'1'}
print(''.join([d[c] for c in n]))

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
#111a
print(input().replace(1,x).replace(9.1).replace(x,9))

print(input().replace("1","x").replace("9","1").replace("x","9"))

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
print(n.replace("1", "9").replace("9", "1"))

n = input()
print(n.replace("1", "x").replace("9", "1").replace("x", "9"))

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
s=input()
foi i in s:
  if i=="9":
    print('1',end="")
  else:
    print("9",end="")
print()

s=input()
for i in s:
  if i=="9":
    print('1',end="")
  else:
    print("9",end="")
print()

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
print(n.replace('1', '9').replace('9', '1'))


n = input()
print(n.replace('9','1').replace('1','9'))


n = input()
print(n.translate(str.maketrans({'1':'9', '9':'1'})))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = str(input())
for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    else:
        n[i] = "1"
print(n)          

n = str(input())
m = ""
for i in range(3):
    if n[i] == "1":
        m += "9"
    else:
        m += "1"
print(m)          


Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n=input()
ans=''
for i in range(len(n)):
    if n[i]==1:
        ans+='9'
    else:
        ans+='1'
print(ans)

n=input()
ans=''
for i in range(len(n)):
    if n[i]=='1':
        ans+='9'
    else:
        ans+='1'
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
num = input()
for i in range(len(num)):
  if num[i] == '1':
    num[i] = '9'
  else:
    num[i] = '1'
print(num)

num = input()
out = ''
for i in range(len(num)):
  if num[i] == '1':
    out += '9'
  else:
    out += '1'
print(out)

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
for i in input():
  print(9 if i == "1" else 1, end = "")
  print()

for i  in input():
    print(9 if i == "1" else 1, end = "")
print()

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
for i in range(n):
  if n[i] == "1":
    n[i] = "9"
  else:
    n[i] = "1"
print(n)

n = str(input())
lis = ""
for i in range(len(n)):
    if n[i] == "1":
        lis += "9"
    else:
        lis += "1"
print(lis)


Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
print(1110-int(input())

print(1110-int(input()))

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N = int(input())
V = [int(i) for i in input().split()]

Vodd = V[1::2]
Veven = V[::2]

from collections import Counter

Vodd = sorted(Counter(Vodd).items(), key=lambda x:x[1])
Veven = sorted(Counter(Veven).items(), key=lambda x:x[1])

if Vodd[-1][0] == Veven[-1][0]:
    if len(Vodd) == len(Veven) == 1:
        ans = N - Vodd[-1][1]
    elif len(Vodd) == 1:
        ans = N - Vodd[-1][1] - Veven[-2][1]
    elif len(Veven) == 1:
        ans = N - Vodd[-2][1] - Veven[-1][1]
    elif Vodd[-2][1] >= Veven[-2][1]:
        ans = N - Vodd[-2][1] - Veven[-1][1]
    else:
        ans = N - Vodd[-1][1] - Veven[-2][1]
else:
    ans = N - Vodd[-1][1] - Veven[-1][1]


print(ans)


n = list(input())

for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"

print(*n,sep="")

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())
 
# h,w = li()
# ss = [ns() for _ in range(h)]

n = int(input())

vs = li()
v_odd = []
v_even = []

i=0
for v in vs:
    if i % 2 == 0:
        v_even.append(v)
    else:
        v_odd.append(v)
    i = i + 1

max_count_odd = 0

m_odd = 0
m_even = 0
for ss in set(v_odd):
    count = v_odd.count(ss)
    if count > max_count_odd:
        max_count_odd = count
        m_odd = ss
# import pdb;pdb.set_trace() 
max_count_even = 0
for ss in set(v_even):
    count = v_even.count(ss)
    if count > max_count_even:
        max_count_even = count
        m_even = ss
# import pdb;pdb.set_trace() 
ans = len(v_even)-max_count_even  +  len(v_odd)-max_count_odd

m2_oddmax = 0
m2_evenmax = 0
import copy
# import pdb;pdb.set_trace()
if(m_even==m_odd):
    temp = set(v_odd)
    temp.remove(m_odd)
    m2_odd = 0
    # import pdb;pdb.set_trace()
    for ss in temp:
        count = v_odd.count(ss)
        if count > m2_oddmax:
            m2_oddmax = count
            m2_odd = ss
    temp = set(v_even)
    temp.remove(m_even)
    m2_even = 0
    for ss in temp:
        count = v_even.count(ss)
        if count > m2_evenmax:
            m2_evenmax = count
            m2_even = ss
    if m2_evenmax > m2_oddmax:
        # import pdb;pdb.set_trace()
        ans = len(v_even)-m2_evenmax + len(v_odd)-max_count_odd
    elif m2_evenmax <= m2_oddmax:
        # import pdb;pdb.set_trace()
        ans = len(v_even)-max_count_even + len(v_odd)-m2_oddmax
    if m2_even == 0 and m2_odd == 0:
        ans = int(n/2)
    # import pdb;pdb.set_trace()


print(ans)


import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())



a = str(input())
ans=''
for c in a:
    if c=='1':
        ans = ans + '9'
    elif c=='9':
        ans = ans + '1'
    else:
        ans = ans + c

print(ans)


Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        if n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        if n2 == 1:
            n2 = 9
        if n3 == 9:
            n1 = 1
        if n3 == 1:
            n3 = 9

        nn = n1 *100 + n2*10 + n3

        print(nn)


#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        elif n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        elif n2 == 1:
            n2 = 9
        if n3 == 9:
            n3 = 1
        elif n3 == 1:
            n3 = 9


#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        elif n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        elif n2 == 1:
            n2 = 9
        if n3 == 9:
            n1 = 1
        elif n3 == 1:
            n3 = 9

        nn = n1 *100 + n2*10 + n3

        print(nn)
        


#
n = int(input())

if 111 <= n <1000:
    #main
        n1 = int (n / 100)
#        print(n1)
#        print("   ")
        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)
#       print(n2)
#       print("   ")
        
        n3 = n - n1 *100 - n2*10
#        print(n3)
#        print("   ")
        
        if n1 == 9:
            n1 = 1
        elif n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        elif n2 == 1:
            n2 = 9
        if n3 == 9:
            n3 = 1
        elif n3 == 1:
            n3 = 9

        nn = n1 *100 + n2*10 + n3

        print(nn)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n=input()

print(n.replace("1","x").replace("9","1"),replace("x","9"))

n=input()

print(n.replace("1","x").replace("9","1").replace("x","9"))   

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n=input()
swap=""
for i in n:
    if i=="1":
        swap+="9"
    elif i=="9":
        swap+="1"
    else:
        swap+=i
print(swap[-1::-1])


n=input()
swap=""
for i in n:
    if i=="1":
        swap+="9"
    elif i=="9":
        swap+="1"
    else:
        swap+=i
print(swap)


Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = read()

arr = list(n)
output = ""
for e in arr
  if e == '1':
    output += '9'
  else:
    output += '1'

print(output)

n = input()
 
arr = list(n)
output = ""
for e in arr:
  if e == '1':
    output += '9'
  else:
    output += '1'
 
print(output)

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N,x=map(int,input().split())
l=list(map(int,input().split()))
ans=0
l.sort()

for n in range(N):
    if n!=N-1:
        if l[n]<x:
            x-=l[n]
            ans+=1
        elif l[n]==x:
            x-=l[n]
            ans+=1
            break
        else:
            break
    else:
        if l[n]==x:
            x-=l[n]
            ans+=1
        else:
            break

print(ans)

N=int(input())
n=list(map(int,str(N)))
for i in range(3):
    if n[i]==1:
        n[i]=9
    elif n[i]==9:
        n[i]=1
print(n[0]*100+n[1]*10+n[2])

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
line = list(input())
j = 0
print(line)
for i in range(3):
    if line[j] == "1":
        line[j] = "9"
    else:
        line[j] = "1"
    j +=1
print(int(line[0] + line[1] + line[2]))

line = list(input())
j = 0
print(line)
for i in range(3):
    if line[j] == "1":
        line[j] = "9"
    else:
        line[j] = "1"
    j +=1
print(line[0] + line[1] + line[2])

line = list(input())
j = 0
for i in range(3):
    if line[j] == "1":
        line[j] = "9"
    else:
        line[j] = "1"
    j +=1
print(int(line[0] + line[1] + line[2]))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
print(n.replace("19", "91"))

n = input()
print(n.replace("1", "x").replace("9", "1").replace("x", "9"))

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = str(input())

ans = 0
if n[0] == "1":
    ans += 900
else:
    ans += 100

if n[0] == "1":
    ans += 90
else:
    ans += 10

if n[0] == "1":
    ans += 9
else:
    ans += 1

print(ans)

n = str(input())

ans = 0
if n[0] == "1":
    ans += 900
else:
    ans += 100

if n[1] == "1":
    ans += 90
else:
    ans += 10

if n[2] == "1":
    ans += 9
else:
    ans += 1

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
num = str(input())
for i in range(3):
    if num[i] == '1':
        num[i] = '9'
    else:
        num[i] = '1':
answer = num[0]+num[1]+num[2]
print(int(answer))

a = input()
b = []
for i in range(3):
    if a[i] == '1':
        b.append('9')
    else:
        b.append('1')
print(''.join(b))

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
print(n.replace('1','x').replace('9','1').replace('x','9')

n = input()
print(n.replace('1','x').replace('9','1').replace('x','9'))


Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N = input()

list_N  = list(N) 
#list_N = list(map(int,list_N))
print(list_N)



def swap(i):
    if i == "9":
        re = "1"
    elif i=="1":
        re = "9"
    return re

swap_N = list(map(swap, list_N))
print(int("".join(swap_N)))

N = input()

list_N  = list(N) 
#list_N = list(map(int,list_N))
print(list_N)



def swap(i):
    if i == "9":
        re = "1"
    elif i=="1":
        re = "9"
    return re

swap_N = list(map(swap, list_N))
print("".join(swap_N))

N = input()
#N=119
list_N  = list(str((N)))
#list_N = list(map(int,list_N))
#print(list_N)



def swap(i):
    if i == "9":
        re = "1"
    elif i=="1":
        re = "9"
    return re

swap_N = list(map(swap, list_N))
print(int("".join(swap_N)))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
a = input()
print(a.replace("1", "9")+a.replace("9", "1"))

a = input()
print(a.replace("1", "2")+a.replace("9", "1") + a.replace("2", "9"))

a = input()
print(a.replace("1", "9") + a.replace("9", "1"))

a = input()
print(a.replace("1", "2").replace("9", "1").replace("2", "9"))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
s = ''
for c in n:
  if c == '1':
    s += '9'
  else:
  	if c == '9':
    	s += '1'
    else:
      s += c
print(s)
  

n = input()
s = ''
for c in n:
  if c == '1':
    s += '9'
  else:
    if c == '9':
        s += '1'
    else:
        s += c
print(s)

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
print(input()[::-1])

print("".join("9" if x=="1" else "1" for x in input()))

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
a=input()
for i in RANGE(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]=='1'
print(a)


a=input()
if int(a) <= int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111)


a=list(input())
for i in RANGE(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]='1'
print(a[0]+a[1]+a[2])


a=list(input())
for i in range(3):
  if a[i]=='1':
    a[i]='9'
  elif a[i]=='9':
    a[i]='1'
print(a[0]+a[1]+a[2])


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
import collections
N=int(input())
A=list(map(int,input().split()))

A1=[]
A2=[]
for i in range(len(A)):
    if i%2==0:
        A1.append(A[i])
    else:
        A2.append(A[i])
        
B1=collections.Counter(A1)
B2=collections.Counter(A2)


if B1.most_common(2)[0][1]==B2.most_common(2)[0][1] and B1.most_common(2)[0][1]==int(N/2):
    print(int(N/2))
else:
    
    if B1.most_common(1)==B2.most_common(1):
        if B1.most_common(2)[1][1]>=B2.most_common(2)[1][1]:
            ans=N-B1.most_common(2)[1][1]-B2.most_common(2)[0][1]
        else:
            ans=N-B2.most_common(2)[1][1]-B1.most_common(2)[0][1]
    elif B1.most_common(2)[0][0]==B2.most_common(2)[0][0]:
        if B1.most_common(2)[0][1]>=B1.most_common(2)[0][1]:
            ans=N-B1.most_common(2)[0][1]-B2.most_common(2)[1][1]
        else:
            ans=N-B2.most_common(2)[0][1]-B1.most_common(2)[1][1]
    else:
        ans=N-B1.most_common(2)[0][1]-B2.most_common(2)[0][1]
    print(ans)

n=input()
N=[]
for i in range(3):
    N.append(n[i])
for j in range(3):
    if N[j]=="1":
        N[j]="9"
    else:
        N[j]="1"
print("".join(N))

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n=int(input())
print(100*(10-n[0])+10*(10-n[1])+10-n[2])

n=input()
print(100*(10-n[0])+10*(10-n[1])+10-n[2])

n = input()
n = n.replace("9","4").replace("1","9").replace("4","1")
print(n)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):

n =  input()

true_num = []
if '1' in n or '9' in n:
    for i in range(3):
        if n[i] == '1' :
            true_num.append('9')
        elif n[i] == "9":
            true_num.append('1')
        else:
            true_num.append(n[i])
    print(true_num)
else:
    print(n)


n = input()
 
n = n.replace("1","x")
n = n.replace("9","1")
n = n.replace("x","9")
 
print(n)


Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
def main(n:int,lst:list)->int:
    b = True
    lst1 = []
    lst2 = []
    for e in lst:
        if b:
            lst1.append(e)
        else:
            lst2.append(e)
        b = not b
    lst1.sort()
    lst2.sort()
    c1 = [["",0],0]
    c2 = [["",0],0]
    last =lst1[0]
    a = 0
    for e in lst1:
        if last == e:
            a +=1
        else:
            if a >= c1[0][1]:
                c1[1] = c1[0][1]
                c1[0][0] = e
                c1[0][1] = a
            elif a > c1[1]:
                c1[1] = a
            last = e
            a = 1
    if a >= c1[0][1]:
        c1[1] = c1[0][1]
        c1[0][0] = e
        c1[0][1] = a
    elif a > c1[1]:
        c1[1] = a

    last =lst2[0]
    a = 0
    for e in lst2:
        if last == e:
            a +=1
        else:
            if a >= c2[0][1]:
                c2[1] = c2[0][1]
                c2[0][0] = e
                c2[0][1] = a
            elif a > c2[1]:
                c2[1] = a
            last = e
            a = 1
    if a >= c2[0][1]:
        c2[1] = c2[0][1]
        c2[0][0] = e
        c2[0][1] = a
    elif a > c2[1]:
        c2[1] = a

    if c1[0][0] == c2[0][0]:
        if c1[0][1] > c2[0][1] or(c1[0][1] == c2[0][1] and c2[1] > c1[1]):
            return n - c1[0][1] - c2[1]
        else:
            return n - c2[0][1] - c1[1]
    else:
        return n - c1[0][1] - c2[0][1]

n = int(input())
lst = input().split()
print(main(n,lst))


import collections
def main(n:int,lst:list)->int:
    b = True
    lst1 = []
    lst2 = []
    for e in lst:
        if b:
            lst1.append(e)
        else:
            lst2.append(e)
        b = not b
    c1 = collections.Counter(lst1).most_common()
    c2 = collections.Counter(lst2).most_common()
    if c1[0][0] == c2[0][0]:
        if c1[0][1] > c2[0][1]:
            if len(c2) == 1:
                return n - c1[0][1]
            else:
                return n - c1[0][1] - c2[1][1]
        else:
            if len(c1) == 1:
                return n - c2[0][1]
            else:
                return n - c2[0][1] - c1[1][1]
    else:
        return n - c1[0][1] - c2[0][1]

n = int(input())
lst = list(map(int,input().split()))
print(main(n,lst))


print(input().replace("1","a").replace("9","1").replace("a","9"))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = int(input())
a = [int(aa) for aa in input().split()]

def add_entry(hist, aa):
    if aa in hist:
        hist[aa] += 1
    else:
        hist[aa] = 1


def make_hist(a):
    even_hist = {}
    odd_hist = {}

    for i in range(len(a)//2):
        add_entry(even_hist, a[2*i])
        add_entry(odd_hist, a[2*i+1])

    return even_hist, odd_hist


def get_sorted_hist(hist):
    return sorted(hist.items(), key=lambda x: -x[1])

eh, oh = make_hist(a)
seh = get_sorted_hist(eh)
soh = get_sorted_hist(oh)

print(seh, soh)

if seh[0][0] != soh[0][0]:
    print(len(a) - seh[0][1] - soh[0][1])
else:
    if len(seh) == 1 and len(soh) == 1:
        print(len(a)//2)
    elif len(seh) == 1:
        print(len(a) - seh[0][1] - soh[1][1])
    elif len(soh) == 1:
        print(len(a) - soh[0][1] - seh[1][1])
    else:
        print(min(len(a) - seh[0][1] - soh[1][1], len(a) - soh[0][1] - seh[1][1]))


n = input()

ans = ""
for nn in n:
    if nn == "1":
        ans += "9"
    elif nn == "9":
        ans += "1"

print(ans)


Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N = input()
for i in range(3):
  if N[i] == '1':
    N[i] = '9'
  elif N[i] == '9':
    N[i] == '1'
print(N)

N = input()
S = ''
for i in range(3):
  if N[i] == '1':
    S += '9'
  elif N[i] == '9':
    S += '1'
  else:
    S += N[i]
print(S)


Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
#coding:utf-8


n = input()

print(n.replace('1','9').replace('9','1'))


#coding:utf-8


n = input()
result = ''

for i in n:
    if i=='9':
        result+='1'
    elif i=='1':
        result +='9'

print(result)        


Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
for ans in range(111, 1000, 111):
    if n <= ans:
        break
print(ans)


s.replace('1','a')
s.replace('9','1')
s.replace('a','9')
print(str(n))


n = int(input())
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)


n = input()
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
n = list(n)
if n[0] == "1":
    print(9, end='')
if n[1] == str(1):
    print(9, end="")
if n[2] == str(1):
    print(9, end="")
if n[0] == str(9):
    print(1, end="")
if n[1] == str(9):
    print(1, end="")
if n[2] == str(9):
    print(1, end="")


n = input()
n = list(n)
if n[0] == "1":
    print(9, end='')
if n[0] == str(9):
    print(1, end="")
if n[1] == str(1):
    print(9, end="")
if n[1] == str(9):
    print(1, end="")
if n[2] == str(1):
    print(9)
if n[2] == str(9):
    print(1)


Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
from sys import stdin

n = stdin.readline().rstrip()

list = []
for i in range(3):
    list.append(n[i])

if list[0] == '1':
    list[0] = '9'
if list[1] == '1':
    list[1] = '9'
if list[2] == '1':
    list[2] = '9'

ans = ''.join(list)

print(ans)


import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def split_even_or_odd(vv, n, start):
    res = {}
    for i in range(start,n,2):
        v = vv[i]
        if not v in res.keys(): res[v] = 1
        else: res[v] += 1
    return res

def find_fs(target):
    maxk1 = maxv1 = 0
    for k, v in target.items():
        if maxv1 < v:
            maxk1, maxv1 = k, v
    maxk2 = maxv2 = 0
    for k, v in target.items():
        if maxv2 < v and maxk1 != k:
            maxk2, maxv2 = k, v
    return (maxk1, maxv1), (maxk2, maxv2)

def main():
    n = II()
    vv = MII()
    ee = split_even_or_odd(vv, n, 0)
    oo = split_even_or_odd(vv, n, 1)

    e1kv, e2kv = find_fs(ee)
    o1kv, o2kv = find_fs(oo)

    minv = 10**5
    if e1kv[0] != o1kv[0]:
        minv = min(minv, n - (e1kv[1] + o1kv[1]))
    else:
        minv = min(minv, n - (e1kv[1] + o2kv[1]))
        minv = min(minv, n - (e2kv[1] + o1kv[1]))
    print(minv)

if __name__ == '__main__':
    main()


from sys import stdin

n = stdin.readline().rstrip()

list = []
for i in range(3):
    list.append(n[i])

if list[0] == '1':
    list[0] = '9'
else:
    list[0] = '1'
if list[1] == '1':
    list[1] = '9'
else:
    list[1] = '1'
if list[2] == '1':
    list[2] = '9'
else:
    list[2] = '1'

ans = ''.join(list)

print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
S=list(input())
S=[if s=="1" s="9" else s="1" for s in S]
print(S)

S=input()
ans=""
for s in S:
  if s=="1":ans+="9"
  else:ans+="1"
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
a,b,c=map(int,list(input(),split()))
if a==1:
  a=9
elif a==9:
  a=1
if b==1:
  b=9
elif b==9:
  b=1
if c==1:
  c=9
elif c==9:
  c==1
print({}{}{}.format(a,b,c))

a=str(input())
b=int(a[0])
c=int(a[1])
d=int(a[2])
if b==1:
  b="9"
elif b==9:
  b="1"
if c==1:
  c="9"
elif c==9:
  c="1"
if d==1:
  d="9"
elif d==9:
  d=="1"
e=int(b+c+d)
print(e)

a=int(input())
print(1110-a)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
s = input()
 
ss = ""
for i in s:
  if s == "1"
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)

s = input()

ss = ""
for i in range(len(S)):
  if s[i] == "1"
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)

s = input()
 
ss = ""
for i in s:
  if s == "1"
  		ss += "9"	
  else:
    	ss += "1"
    
print(ss)

s = input()
 
ss = ""
for i in range(len(s)):
  if s[i] == "1"
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)

s = input()
 
ss = ""
for i in s:
  if s[i] == "1":
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)


s = input()
 
ss = ""
for i in s:
  if s == "1":
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)

from corections import Counter 
n = int(input())
v = list(map(int,input().split()))
 
odd = []
even = []
for i in range(n//2):
	odd.append(v[2*i+1])
	even.append(v[2*i])
 
odd = sorted(odd)
even = sorted(even)
ac = Counter(odd).most_common(2)
bc = Counter(even).most_common(2)
def cnt(X):
	count = 0
	ans = 0
	for i in range(len(X)-1):
		if X[i+1] == X[i]:
			count += 1
			ans = max(ans,count)
		else:
			count = 0
	return ans+1
            
if ac[0][0] != bc[0][0]:
  print(len(v)-cnt(odd)-cnt(even))
elif len(ac) == 1 and len(bc) == 1:
	print(n//2)
else:
	print(n-max(ac[0][1]+bc[1][1],ac[1][1]+bc[0][1]))

s = input()
 
ss = ""
for i in range(len(s)):
  if s[i] == "1":
  	ss += "9"	
  else:
    ss += "1"
    
print(ss)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
snk = input()

snk = snk.replace("1", "a").replace("9", "b")
print(int(snk.replace("a", "9").replace("b", "9")))

snk = input()

print(int(snk.replace("1", "9").replace("9", "1")))

snk = input()

snk = snk.replace("1", "a").replace("9", "b")
print(int(snk.replace("a", "9").replace("b", "1")))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
num = int(n)
ans = 0
for digit in range(1,10):
    if int(num/digit) == 111:
        ans = num
        break
    elif int(num/digit) < 111:
        ans = digit*100+digit*10+digit
        break
print(str(ans))

n = input()
num = int(n)
ans = 0
for digit in range(1,10):
    if int(num/digit) == 111:
        ans = num
        break
    elif int(num/digit) < 111:
        ans = digit*100+digit*10+digit
        break
print(ans)

n = input()
ans = n.replace("1", "2")
ans = ans.replace("9","1")
ans = ans.replace("2","9")
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n=int(input())
if n==111:
    print(999)
if n==119:
    prit(991)
if n==191:
    print(919)
if n==199:
    print(911)
if n==911:
    print(199)
if n==919:
    print(191)
if n==991:
    print(119)
if n==999:
    print(111)


n = input()
n = n.replace('1', '#')
n = n.replace('9', '1')
n = n.replace('#', '9')
print(int(n))

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N = int(input())
i = int(N/111)
if N % 111 != 0:
  i = i + 1
else:
  i = 1
print(i*111)


n = input()
print(n.replace('1', 'x').replace('9', '1').replace('x', '9'))

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
# -*- coding: utf-8 -*-
def solve():
    #n = input()
    n = '999'
    n = n.replace('1', '.')
    n = n.replace('9', '1')
    n = n.replace('.', '9')
    res = n
    return str(res)

if __name__ == '__main__':
    print(solve())



print(1110-int(input()))

Verdicts: Wrong Answer

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
n = input()
ans = ''
for i in n:
    if n[i] == '1':
        ans += '9'
    elif n[i] == '9':
        n[i] += '1'
    else:
        ans += n[i]
print(ans)

n = input()
ans = []
for i in range(len(n)):
    if n[i] == '1':
        ans.append('9')
    elif n[i] == '9':
        ans.append('1')
    else:
        ans.append(n[i])
print(''.join(ans))

Verdicts: Runtime Error

Accepted
Problem: Cat Snuke is learning to write characters. Today, he practiced writing digits `1` and `9`, but he did it the other way around.  You are given a three-digit integer n written by Snuke. Print the integer obtained by replacing each digit `1` with `9` and each digit `9` with `1` in n.

Submission attempts (in order):
N=input()
ans=[]
for i in range(len(N)):
  if N[i]=="0":
    ans.append(9)
  else:
    ans.append(0)
print(*ans,sep="")

N=input()
ans=[]
for i in range(len(N)):
  if N[i]=="1":
    ans.append(9)
  else:
    ans.append(1)
print(*ans,sep="")


Verdicts: Wrong Answer

Accepted