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()
ans = []
for i in n:
    if i == '1':
        ans.append('9')
    elif i == '9':
        ans.append('1')
    else:
        ans.append(i)
print(ans)

n = input()
ans = []
for i in n:
    if i == '1':
        ans.append('9')
    elif i == '9':
        ans.append('1')
    else:
        ans.append(i)
print(''.join(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):
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):
n=input()
result=''
for i in n:
    if i=='1':
        result+='9'
    else:
        result+='1'
    print(result)

n=input()
result=''
for i in n:
    if i==1:
        result+=9
    else:
        result+=1
    print(result)

n=input()
result=''
for i in n:
    if i=='1':
        result+=9
    else:
        result+=1
    print(result)

n=input()
result=''
for i in n:
    if i=='1':
        result.append('9')
    else:
        result.append('1')
    print(result)

n=input()
result=''
for i in n:
    if i==1:
        result+=9
    else:
        result+=1
print(result)

n=input()
result=''
for i in n:
    if i=='1':
        result+='9'
    else:
        result+='1'
print(result)

Verdicts: Wrong Answer

Runtime Error

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 = int(input())
for i in range(1,10):
    if 111 * i >= n:
        print(111*i)
        exit(0)

for i in input():
    if i == '9':
        print('1',end='')
    else:
        print('9',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):
a=int(input())
if (a//100)%9==0:
  b=100
else:
  b=900
if ((a-(a//100)*100)//10)%9==0:
  c=10
else:
  c=90
if (a-(a//100)*100-(a//10)*10)%9==0:
  d=1
else:
  d=9
print(b+c+d)

a=input()
if a[0]=="1":
  a[0]=="9"
elif a[0]=="9":
  a[0]=="1"
if a[1]=="1":
  a[1]=="9"
elif a[1]=="9":
  a[1]=="1"
if a[2]=="1":
  a[2]=="9"
elif a[2]=="9":
  a[2]=="1"
print(a)

a=input()
print(a.replace(1,8),replace(9,1),replace(8,9))

a=input()
a.replace(9,8)
a.replace(1,9)
a.replace(8,1)
print(a)

a=input()
if a[0]=="1":
  a[0]="9"
if a[0]=="9":
  a[0]=="1"
if a[1]=="1":
  a[1]=="9"
if a[1]=="9":
  a[1]=="1"
if a[2]=="1":
  a[2]=="9"
if a[2]=="9":
  a[2]=="1"
print(a)

a=input()
if a[0]=="1":
  a[0]="9":
else:
  a[0]=="1"
if a[1]=="1":
  a[1]="9"
else:
  a[1]="1"
if a[2]=="1":
  a[2]="9"
else:
  a[2]="1"
print(a)

a=input()
a.replace(1,8)
a.replace(9,1)
a.replace(8,9)
print(a)

a=input()
print(a.replace(1,8).replace(9,1).replace(8,9))

a=int(input())
if (a//100)%9==0:
  b=100
else:
  b=900
if ((a-(a//100)*100)//10)%9==0:
  c=10
else:
  c=90
if (a-(a//10)*10)%9==0:
  d=1
else:
  d=9
print(b+c+d)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

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):
print(input().replace("9","1"))

print(input().replace("9","a").replace("1","9").replace("a","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):
n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
print(111 * i)

N = str(input())
l = list(N)
a_l = []
for i in range(len(N)):
    a_l.append(10 - int(l[i]))
ans = "".join([str(i) for i in a_l])
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):
a=input()
print(a.replace('1','9').replace('9','1'))

a=input()
print(a.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()
a = ""
for i in range(len(s)):
  if i == 1:
    a += 9
  elif i == 9:
    a += 1
print(a)

s = input()

a = ""
for i in range(len(s)):
  if s[i] == str(1):
    a += str(9)
  elif s[i] == str(9):
    a += str(1)
print(a)

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):
S=str(input())
if S[0]=='1':S[0]='9'
if S[0]=='9':S[0]='1'
if S[1]=='1':S[1]='9'
if S[1]=='9':S[1]='1'
if S[2]=='1':S[2]='9'
if S[2]=='9':S[2]='1'
print(S)

S=str(input())
if S[0]=='1':s[0]='9'
if S[0]=='9':s[0]='1'
if S[1]=='1':s[1]='9'
if S[1]=="9":s[1]="1"
if S[2]=='1':s[2]='9'
if S[2]=='9':s[2]='1'
print(s)


S = str(input())
print( 100*(10-int(S[0])) + 10*(10-int(S[1])) + 1*(10-int(S[2])) )

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):
input().replace('9','1').replace('1','9')

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


s = input()
res = ''
for c in s:
  if(c=='1'):
    res +='9'
  elif(c=='9'):
    res +='1'
  else:
    res += c

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

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','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):
n=int(input())

l=list(map(int,input().split()))
l1=[]
l2=[]

for i in range(n):
	if i%2==0:
		l1.append(l[i])
	else:
		l2.append(l[i])

count1=[]
count2=[]

for i in range(100000):
	count1.append(0)
	count2.append(0)

for i in range(n//2):
	count1[l1[i]-1]+=1
	count2[l2[i]-1]+=1

max1=0
max2=0

maxc1=[]
maxc2=[]

for i in range(100000):
	if count1[i]>=max1:
		max1=count1[i]
		maxc1.append(i)

	if count2[i]>=max2:
		max2=count2[i]
		maxc2.append(i)

# print('maxc1',maxc1)
# print('maxc2',maxc2)
# print('max1',max1)
# print('max2',max2)

# if len(maxc2)+len(maxc1)>2 or (len(maxc2)+len(maxc1)==2 and maxc1[0]!=maxc2[0]):
# 	final=max1+max2

# else :
max3=0
max4=0
for i in range(100000):
	if i!=maxc1[0]:
		if count1[i]>=max3:
			max3=count1[i]
			maxc1.append(i)

	if i!=maxc2[0]:
		if count2[i]>=max4:
			max4=count2[i]
			maxc2.append(i)

final=max(max1+max4,max2+max3)

print(n-final)


n=input()
l=[]

for i in n:
	if i=='9':
		l.append('1')
	elif i=='1':
		l.append('9')
	else:
		l.append(i)

print(''.join(l))



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 = str(input())
print(n.replace('1', 'a').replace('9', '1').replace('a', '1'))


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


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


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())
for i in n:
    if i == 1:
        i = 9
    elif i == 9:
        i = 1
print(n)


n = int(input())
print(1110 - 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):
text = input()
str = ['1' if c == '9' else '1' for c in text]
print(''.join(str))

text = input()
str = ['1' if c == '9' else '9' for c in text]
print(''.join(str))

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):
print(1110-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 = input()
n.replace('1','x')
n.replace('9','1')
n.replace('x','9')
print(n)

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

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()
print(a.replace("1","x"),replace("9","1").replace("x","9"))

a = int(input())
print(a.replace(1,x),replace(9,1).replace(x,9))

a = int(input())
print(a.replace(1,x).replace(9,1).replace(x,9))

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

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

Verdicts: Runtime Error

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):
print(int(int(input())/111)*111)

print(999+111-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 = int(input())
A = []
A.append(N//100)
A.append(N//10-A)
A.append(N-A-B)
for i in range(3):
    if A[i]==1:
        A[i]=9
    if A[i]==9:
        A[i]=1
print(A[0]*100+A[1]*10+A[2])

N = int(input())
A = []
a = N//100
b = N//10-a*10
c = N - a*100 - b*10
A.append(a)
A.append(b)
A.append(c)
for i in range(3):
    if A[i]==1:
        A[i]=9
    elif A[i]==9:
        A[i]=1
print(A[0]*100+A[1]*10+A[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):
from collections import Counter


def solve(V):
    n = len(V)
    odd = Counter()
    even = Counter()
    total = Counter()
    for i, c in enumerate(V):
        total.update([c])
        if i % 2 == 0:
            even.update([c])
        else:
            odd.update([c])

    total_max = total.most_common()[0]
    if total_max[1] == len(V):
        return len(V) / 2

    even_maxs = even.most_common(2)
    odd_maxs = odd.most_common(2)
    if len(odd_maxs) > 1:
        odd_max, odd_2nd_max = odd_maxs[0], odd_maxs[1]
    else:
        odd_max, odd_2nd_max = odd_maxs[0], None

    if len(even_maxs) > 1:
        even_max, even_2nd_max = even_maxs[0], even_maxs[1]
    else:
        even_max, even_2nd_max = even_maxs[0], None

    ans = 0
    if odd_max[0] != even_max[0]:
        odd_max = odd_max[0]
        even_max = even_max[0]
    elif odd_2nd_max != None and even_2nd_max == None:
        even_max = even_max[0]
        odd_max = odd_2nd_max[0]
    elif odd_2nd_max == None and even_2nd_max != None:
        odd_max = odd_max[0]
        even_max = even_2nd_max[0]
    else:  # odd_2nd_max != None and even_2nd_max != None:
        return n - max(even_maxs[0][1] + odd_maxs[1][1], 
                       even_maxs[1][1] + odd_maxs[0][1])

    for key, count in even.items():
        if key != even_max:
            ans += count
    for key, count in odd.items():
        if key != odd_max:
            ans += count
    return ans


if __name__ == "__main__":
    n = int(input())
    l = input()
    print(solve(l.split(" ")))


def solve(N):
    return l.replace("1", "8").replace("9", "1").replace("8", "9")

if __name__ == "__main__":
    l = input()
    print(solve(l))


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):
s = input()
for i in range(3):
  if s[i] =="1":
    s[i] = "9"
  else:
    s[i] = "1"
print(s)

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

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

Verdicts: 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):
from collections import Counter

n = int(input())
v = list(map(int, input().split(' ')))

v1 = v[::2]
v2 = v[1::2]

counter = Counter(v1)
x1 = counter.most_common()[0][0]
counter = Counter(v2)
x2 = counter.most_common()[0][0]

x1_count = v1.count(x1)
x2_count = v2.count(x2)

n = n//2
ans = (n - x1_count) + (n - x2_count)
print(ans)

s = list(input())
ans = ''
for i in range(len(s)):
    if s[i] == '1':
        ans += '9'
    elif s[i] == '9':
        ans += '1'
    else:
        ans += s[i]
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 = input()
for i in range(len(a)):
    if a[i] == '1':
        a[i] = '9'
    elif a[i] == '9':
        a[i] = '1'
print(a)


a = input()
for i in range(len(a)):
    if a[i] == '1':
        a = a[:i] + '9' + a[i+1:]
    elif a[i] == '9':
        a = a[:i] + '1' + a[i+1:]
print(a)


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):
x = input ()
x = x.replace('1', '9')
x = x.replace('9', '1')
print (x)

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

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,b,c=map(int,input().split())
if a*10+b>b*10+c:
  print(a*10+b+c)
else:
  print(b*10+c+a)

a=input()
b=a.replace((1,9)and(9,1))
print(b)

a=input()
b=a.replace(1,9)
c=b.replace(9,1)
print(b)

N=int(input())
a=N%111
if a==0:
   print(N)
else:
  b=N//111
  c=b+1
  print(c*111)

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

a=input()
b=a.translate("1":"9","9":"1")
print(b)

a=str(input())
b=a.replace(1,9)
c=b.replace(9,1)
print(b)

a=input()
b=a.replace("1","2")
c=b.replace("9","8")
d=c.replace("2","9")
e=d.replace("8","1")
print(e)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

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):
s = input()
t = ''
for c in s:
    if c = '1':
        t += '9'
    elif c = '9':
        t += '1'
print(t)


if __name__ == "__main__":
    n = input()

    t = ''
    for c in n:
        if c == '1':
            t += '9'
        elif c == '9':
            t += '1'

    print(t)


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=list(input())

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

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: 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[::-1])

n = input()

print('{}{}{}'.format(n[2],n[1],n[0]))


n = input()

mapping_table = str.maketrans({'1': '9', '9': '1'})

print(n.translate(mapping_table))


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()))

A=[[0,i] for i in range(10**5+3)]
B=[[0,i] for i in range(10**5+3)]

for i in range(0,n,2):
    A[V[i]][0]+=1
for i in range(1,n,2):
    B[V[i]][0]+=1

A.sort(reverse=1)
B.sort(reverse=1)

#print(A[:10])
#print(B[:10])

Ma=[]
Mb=[]

ma=A[0][0]
mb=B[0][0]
i=0
j=0
while A[i][0]==ma :
    Ma.append(A[i][1])
    i+=1

while B[j][0]==mb :
    Mb.append(B[j][1])
    j+=1

if Ma==Mb :
    print(min(n-ma-B[j][0],n-mb-A[i][0]))
else :
    print(n-ma-mb)


n=input()

ans=""
for i in range(len(n)):
  if n[i]=="1" :
    ans+="9"
  elif n[i]=="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):
def f(c):
  if c == "1":
    return "9"
  elif c == "9":
    return 1
  else:
    return c
  
print(''.join(list(map(f, input()))))

f = lambda c : "1" if c == "9" else "9"
  
print(''.join(list(map(f, 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):
import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E).most_common()
o = collections.Counter(O).most_common()
if e[0][0] != o[0][0]:
    print(N - e[0][1] - o[0][1])
else:
    if len(e) == 1 or len(o) == 1:
        print(N // 2)
    else:
        a = N - e[1][1] - o[0][1]
        b = N - e[0][1] - o[1][1]
        print(min(a, b))

import collections
N=int(input())
L=list(map(int,input().split()))
E=[i for i in L[::2]]
O=[i for i in L[1::2]]
e = collections.Counter(E)
o = collections.Counter(O)
e1=e.most_common()[0][1]
e2=e.most_common()[-1][1]
o1=o.most_common()[0][1]
o2=o.most_common()[-1][1]

Ans=[N-e1-o2,N-e2-o1,N-e2-o2,N-o1-e1]

if len(set(L))==1:
  print(N//2)
else:
  print(min(Ans))

print(1110-int(input()))

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())
c=111
while True:
    if n<=c:
        print(c)
        break
    c+=111

for i in input():
    print([1,9][i=="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):
a =list(input())
for v in a:
  if v =='9':
    v=='1'
  elif v =='1':
    v =='9'
print(a)

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

a =input()
aa =a.replace('9','1').replace('1','9')
print(aa)

a =input()
aa=''
for i in range(a):
  if a[i]=='9':
    aa +='1'
  elif a[i]=='1':
    aa +='9'
print(aa)

a =list(input())
for v in a:
  if v =='9':
    v=='1'
  elif v =='1':
    v =='9'
print(str(a))

a =input()
aa =a.replace(('9','1'),('1','9'))
print(aa)

s = input()
a=''
for i in range(len(s)):
  if s[i]=='9':
    a += '1'
  elif s[i]=='1':
    a += '9'
  else:
    a += s[i]
print(a)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

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):
n=int(input())

N=[0]*3
m=[0]*3

N[0]=int(n/10)
N[1]=int(N[0]/10)
N[2]=int(N[1]/10)

m[0]=int(n%10)
m[1]=int(N[0]%10)
m[2]=int(N[1]%10)

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

n=int(input())

N=[0]*3
m=[0]*3

N[0]=int(n/10)
N[1]=int(N[0]/10)
N[2]=int(N[1]/10)

m[0]=int(n%10)
m[1]=int(N[0]%10)
m[2]=int(N[1]%10)

for i in range(0,3):
    if m[i]==1:
        m[i]=9
    elif m[i]==9:
        m[i]=1

print(int(m[2]*100+m[1]*10+m[0]))

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):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

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


#! /usr/bin/env python3
# -*- coding: utf-8 -*-

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


#! /usr/bin/env python3
# -*- coding: utf-8 -*-


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

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=list(map(int,list(input())))
no=[] 

for ni in n:
    no.append(10-ni)

print("".join(no))



n=list(map(int,list(input())))
no=[] 

for ni in n:
    no.append(str(10-ni))

print("".join(no))

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()

result = ''
for x in n:
  if n == '1':
    result += '9'
  else:
    result += '1'
    
print(result)

n = input()

result = ''
for x in n:
    if x == '1':
        result += '9'
    else:
        result += '1'
    
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()
n.replace(1,x)
n.replace(9,1)
print(n.replace(x,9))

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


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

Verdicts: 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):
n = input()
ans = []
for i in n:
    if i == '1':
        ans.append('9')
    elif i == '9':
        ans append('1')
    else:
        ans.append(i)
print(''.join(ans))

n = input()
ans = []
for i in n:
    if i == '1':
        ans.append('9')
    elif i == '9':
        ans.append('1')
    else:
        ans.append(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 n:
    if i==1:
        ans.append(9)
    elif i==9:
        ans.append(1)
    else:
        ans.append(i)
print("".join(x for x in ans))

n=int(input())
l=[111,222,333,444,555,666,777,888,999]
ans=[]
for i in range(9):
    if l[i]-n>=0:
        ans.append(i)
        
print(l[ans[0]])

n=input()
ans=[]
for i in n:
    if i==1:
        ans.append(9)
    elif i==9:
        ans.append(1)
    else:
        ans.append(i)
print(str(ans[0])+str(ans[1])+str(ans[2]))


n=int(input())

print(((n-1)//111+1)*111)

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

Verdicts: Wrong Answer

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):
# coding : UTF-8

from sys import stdin

N = stdin.readline().rstrip()

def main():
    if int(N) <= int(N[0]*len(N)):
        print(N[0]*len(N))
    else:
        print((str(int(N[0])+1))*len(N))

if __name__ == '__main__':
    main()

# coding : UTF-8

from sys import stdin

n = stdin.readline().rstrip()

def main():
    ans = ""
    
    for _ in range(len(n)):
        if n[_] == '1':
            ans = ans + '9'
        else:
            ans = ans + '1'
    
    print(ans)

if __name__ == '__main__':
    main()

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()
i = 0
for number in n:
    if number == '1':
        m[i] = '9'
        i = i + 1
    elif number == '9':
        m[i] = '1'
        i = i + 1
    else:
        m[i] = n[i]
        i = i + 1

print(n)

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

n = input()
i = 0
for number in n:
    if number == '1':
        n[i] = '9'
        i = i + 1
    elif number == '9':
        n[i] = '1'
        i = i + 1
    else:
        i = i + 1

print(n)

n = list(input())
i = 0
while i < 3:
    if n[i] == '1':
        n[i] == '9'
        i = i + 1
    else:
        n[i] == '1'
        i = i + 1

print(''.join(n))

n = list(input())
i = 0

while i < 3:
    if n[i] == '1':
        n[i] = '9'
        i = i + 1
    else:
        n[i] = '1'
        i = i + 1

print(''.join(n))

Verdicts: Runtime Error

Runtime Error

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):
n = input()

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

n = input()

print(n.translate(str.maketrans({'1':'9','9':'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):

def answer(in0, in1):
    even = {}
    odd = {}

    list = in1.split(" ")

    for i in range(len(list)):
        n = list[i]
        if i % 2 == 0:
            odd[n] = odd.get(n, 0) + 1
        else:
            even[n] = even.get(n, 0) + 1

    odd = sorted(
        [{'key': k, 'value': odd[k]} for k in odd],
        key=lambda x: (-x['value'], int(x['key'])))

    even = sorted(
        [{'key': k, 'value': even[k]} for k in even],
        key=lambda x: (-x['value'], int(x['key'])))

    oddMax = odd[0]
    evenMax = even[0]

    #print(odd)
    #print(even)

    
    if oddMax['key'] == evenMax['key']:
        
        if len(even) == 1 and len(odd) == 1:
            return int(int(in0) / 2)

        if oddMax['value'] > evenMax['value']:
            evenMax = even[1]
        else:
            oddMax = odd[1]

    oddCount = 0
    evenCount = 0

    for v in odd:
        if v['key'] != oddMax['key']:
            oddCount += v['value']

    for v in even:
        if v['key'] != evenMax['key']:
            evenCount += v['value']

    return oddCount + evenCount

print(answer(input(), input()))


def answer(in0):

    result = ''

    for ch in str(in0):
        if ch == '9':
            result += '1'
        elif ch == '1':
            result += '9'

    return result


print(answer(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 = input()
n.replace('2','9')
  

n = input()
for i in range(len(n)):
    if n[i] == '1':
        print('9', end = '')
    else:
        print('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):
s = input()
changer = {"1":"9", "9":"1"}
answer = ""
for chr in s:
  answer = changer[chr] + answer
print(int(answer))

s = input()
changer = {"1":"9", "9":"1"}
answer = ""
for chr in s:
    answer += changer[chr] #+ answer
print(int(answer))

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()
S.replace('1', 'x').replace('9', '1').replace('x', '9')
print(S)

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=int(input())
ans=0
a=n//100
b=n//10-(a*10)
c=a%10
if a==1:
    ans+=900
else:
    ans+=100
if b==1:
    ans+=90
else:
    ans+=10
if c==1:
    ans+=9
else:
    ans+=1
print(ans)


n=int(input())
ans=0
a=n//100
b=n//10-(a*10)
c=n%10
if a==1:
    ans+=900
else:
    ans+=100
if b==1:
    ans+=90
else:
    ans+=10
if c==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):
n = input()

lst = []
res = []

while n > 0:
    lst.append(n%10)
    n //= 10
lst.reverse()

for i in lst:
    if i == 1:
        res.append(9)
    elif i == 9:
        res.append(1)
    else:
        res.append(i)

S = ""

for j in res:
    Str += str(j)

print(S)



n = input()

lst = []
res = []

while n > 0:
    lst.append(n%10)
    n //= 10
lst.reverse()

for i in lst:
    if i == 1:
        res.append(9)
    elif i == 9:
        res.append(1)
    else:
        res.append(i)

Str = ""

for j in res:
    Str += str(j)

print(Str)


N = list(str(input()))
if N[0] == '9':
    N[0] = '1'
else : 
    N[0] = '9'
if N[1]=='9':
    N[1] = '1'
else:
    N[1] = '9'
if N[2] == '9':
    N[2] = '1'
else:
    N[2] = '9'
print(N[0]+N[1]+N[2])

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):
a = input()
for i in range(a):
  if a[i] == "1":
    a[i] = "9"
  else:
    a[i] = "1"
print(a)

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

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

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

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 = list(input())
for i range(len(n)):
  n[i] = "1" if n[i]==9 else "9"
ans = ','.join(n)
print(ans)

n = list(input())
for i in range(len(n)):
  n[i] = "1" if n[i]=="9" else "9"
ans = ''.join(n)
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,input().split())
a=10-a
b=10-b
c=10-c
s=[a,b,c]
print("".join(s))

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 = list(str(input()))

for i in range(3):
  if n[i] == 1:
    n[i]=9
  elif n[i] == 9:
    n[i]=1
print(''.join(n))

n = list(input())

for i in n:
  if n[i] == 1:
    n[i]=9
  elif n[i] == 9:
    n[i]=1
print(''.join(n))

n = list(str(input()))

for i in range(3):
  if n[i] == 1:
    n[i]=9
  elif n[i] == 9:
    n[i]=1
print(int(''.join(n)))

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

for i in n:
  if n[i] == 1:
    n[i]=9
  elif n[i] == 9:
    n[i]=1
print(''.join(n))

n = input()
ans = 0
for i in range(3):
  if n[i] == '1':
    ans += 10**(2-i) * 9
  else:
    ans += 10**(2-i) * 1
print(ans)

Verdicts: Wrong Answer

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):
from collections import*
n, *v = map(int, open(0).read().split())
a, b = [Counter(v[i::2]).most_common() + [(0,0)] for i in (0,1)]
s, x = a[0]
t, y = b[0]
print(n - [x+y, max(x+b[1][1], y+a[1][1])][s==t])

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):
a=input()
b1,b2,b3=0,0,0
if a[0]==9:
    b1='1'
else:
    b1='9'
if a[1]==9:
    b2='1'
else:
    b2='9'
if a[2]==9:
    b3='1'
else:
    b3='9'
print(b1+b2+b3)

a=input()
b1,b2,b3=0,0,0
if a[0]=='9':
    b1='1'
else:
    b1='9'
if a[1]=='9':
    b2='1'
else:
    b2='9'
if a[2]=='9':
    b3='1'
else:
    b3='9'
print(b1+b2+b3)

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 = list(input())
for i in range(3):
    if n[i] == '1':
        n[i] = '9'
    else:
        n[i] = '1'



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


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):
import collections
n = (int)(input())
l = list(map(int,input().split()))
a = l[::2]
b=l[1::2]

a_c=collections.Counter(a).most_common()
b_c=collections.Counter(b).most_common()
if a_c[0][0]==b_c[0][0]:
    if a_c[0][1]==b_c[0][1]:
        print(n//2)
    elif a_c[0][1]>b_c[0][1]:
        if len(b_c)>1:
            print(n-a_c[0][1]-b_c[1][1])
        else:
            print(n-a_c[0][1])
    else:
        if len(a_c)>1:
            print(n-a_c[1][1]-b_c[0][1])
        else:
            print(n-b_c[0][1])
else:
    print(n-a_c[0][1]-b_c[0][1])


s=str(input())
dst=s.translate({
    ord('1'):'9',
    ord('9'):'1',
    })
print(dst)


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()

n.replace("9", "a")
n.replace("1", "b")
n.replace("a", "1")
n.replace("b", "9")

print(n)

n = input()
print(n.translate(str.maketrans({'1':'9', '9':'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):
n = input()

ans = ''
for i in n:
    ans += '1' if i == '1' else '9'
print(ans)

n = input()

ans = ''
for i in n:
    ans += '1' if i == '9' else '9'
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):
n = list(input())
for i in range(len(n)):
    if n[i] == 1:
        n[i] = 9
    elif n[i] == 9:
        n[i] = 1
    if i == 0:
        s = str(n[i])
    else:
        s += str(n[i])
print(int(s))
        

n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
    if i == 0:
        s = str(n[i])
    else:
        s = s+ str(n[i])
print(int(s))


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()
ln = list(n)

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

n = input()
ln = list(n)
 
for i in range(len(ln)):
    if ln[i] == '1':
        ln[i] = '9'
    elif ln[i] == '9':
        ln[i] = '1'
        
n = ''.join(ln)
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=input()

answer=[]
for i in range(len(n)):
    if n[i]=='1':
        answer.append(9)
    else:
        answer.append(1)
        
final_answer=0
for i in range(len(answer)):
    final_answer+=answer[-(i+1)]*pow(10,i)
    
final_answer    

n=input()

def change_1_9(n):
    answer=[]
    for i in range(len(n)):
        if n[i]=='1':
            answer.append(9)
        else:
            answer.append(1)   

    final_answer=''
    for n in range(len(answer)):
        final_answer+=str(answer[n])
    
    return final_answer  
  
print(int(change_1_9(n)))
 

Verdicts: Wrong Answer

Accepted