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):
import collections
 
n = int(input())
vs = [int(i) for i in input().split()]
evens = []
odds = []
for i,num in enumerate(vs):
    if i % 2 == 0:
        evens.append(num)
    elif i % 2 == 1:
        odds.append(num)
 
def plana():
    if (len(set(vs)) == 2) and (len(set(evens)) == 1) and (len(set(odds)) == 1):
        return 0
    elif (len(set(vs)) == 1):
        return len(evens)
    return 0
    ec = collections.Counter(evens)
    oc = collections.Counter(odds)
 
    count = 0
    count += (len(evens) - ec.most_common()[0][1])
    count += (len(odds) - oc.most_common()[0][1])
    return count
 
# if len(set(vs)) == 1:
#     print(int(len(vs)/2))
# elif (len(set(evens)) == 1) and (len(set(odds)) == 1):
#     print(0)
# else:
print(int(plana()))

import collections

n = int(input())
vs = [int(i) for i in input().split()]
evens = []
odds = []
for i,num in enumerate(vs):
    if i % 2 == 0:
        evens.append(num)
    elif i % 2 == 1:
        odds.append(num)

def plana():
    if (len(set(vs)) == 2) and (len(set(evens)) == 1) and (len(set(odds)) == 1):
        return 0
    elif (len(set(vs)) == 1):
        return len(evens)
    ec = collections.Counter(evens)
    oc = collections.Counter(odds)

    count = 0
    count += (len(evens) - ec.most_common()[0][1])
    count += (len(odds) - oc.most_common()[0][1])
    return count

# if len(set(vs)) == 1:
#     print(int(len(vs)/2))
# elif (len(set(evens)) == 1) and (len(set(odds)) == 1):
#     print(0)
# else:
print(len(odds))



inums = input()

nums = []
for i in inums:
    nums.append(int(i))
o = []
for n in nums:
    if n == 1:
        o.append("9")
    elif n==9:
        o.append("1")
    else:
        o.append(str(n))
print("".join(o))


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()
if int(n) < int(n[0]) * 111:
  print(int(n[0]) * 111)
else:
  print((int(n[0]) + 1) * 111)

n = input()
ans = ""
for i in n:
  if i == "1":
    ans += "9"
  elif i == "9":
    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):
s = input()
r = 0
if s[0] == '1':
  r += 900
else:
  r += 100
if s[1] == '1':
  r += 90
else:
  r += 10 
if s[2] == '1':
  r += 9
else:
  r += 1 

s = input().split()
r = 0
if s[0] == '1':
  r += 900
else:
  r += 100
if s[1] == '1':
  r += 90
else:
  r += 10 
if s[2] == '1':
  r += 9
else:
  r += 1 

print(r)

s = input()
r = 0
if s[0] == '1':
  r += 900
else:
  r += 100
if s[1] == '1':
  r += 90
else:
  r += 10 
if s[2] == '1':
  r += 9
else:
  r += 1 
print(r)

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):
n = int(input())
s = str(n)
a = list(map(int,s))
for i in range(0,2):
    if a[i] == 1:
        a[i] = 9
    elif a[i] == 9:
        a[i] = 1

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

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

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

s = input()
n = ""
for i in s:
  if i == "9":
    n+="1"
  else:
    n+="9"
print(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()
ans = ""
	for c in n:
		if c == "1":
            ans += "9"
        elif c == "9":
            ans += "1"
        else:
            ans += c
print(ans)

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

S = input()

ans = ""

for i in S:
  if i == "1":
    ans += "9"
  else:
    ans += "1"

print(ans)


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

n = input()
ans = n.replace('1', '2').replace('9', '1').replace('2', '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):
print(1100-int(input())

print(1100-int(input()))

print(1110-int(input()))

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

suuji = ""
for i in narray:
    if i == "3":
        i = "9"
    elif i == "9":
        i = "3"
    suuji += i
print(suuji)

narray = list(input())

suuji = ""
for i in narray:
    if i == "3":
        i = "9"
    elif i == "9":
        i = "3"
    suuji += i
print(int(suuji))


narray = list(input())

suuji = ""
for i in narray:
    if i == "1":
        i = "9"
    elif i == "9":
        i = "1"
    suuji += i
print(suuji)

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):
from collections import Counter
n = int(input().strip())
a = list(map(int, input().strip().split()))

c1 = Counter(a[::2])
c2 = Counter(a[1::2])
c1f1 = max(c1, key = lambda k:c1[k])
c2f1 = max(c2, key = lambda k:c2[k])

if c1f1 != c2f1:
  return n - c1[c1f1] - c2[c2f1]
else:
  if c1[c1f1] > c2[c2f1]:
    del c2[c2f1]
    if not c2: return n-c1[c1f1]
    c2f1 = max(c2, key = lambda k:c2[k])
    return n-c1[c1f1] - c2[c2f1]
  else:
    del c1[c1f1]
    if not c1: return n-c2[c2f1]
    c1f1 = max(c1, key = lambda k:c1[k])
    return n-c1[c1f1] - c2[c2f1]

s = input()
for c in s:
  if c == '1': print('9', end='')
  elif c == '9': print('1', 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):
import sys
n=int(input())
arr=input().split(" ")
arr_s=set(arr)
if len(arr_s)==1:
    print(int(n/2))
    sys.exit()
#print(arr)
a=0
most_e=0
most_o=0
arr_e=[0 for i in range(int(n/2))]
arr_o=[0 for i in range(int(n/2))]
for i in range(int(n/2)):
    arr_e[i]=arr[a]
    arr_o[i]=arr[a+1]
    a+=2
#print(arr_e,arr_o)
arr_es=set(arr_e)
arr_os=set(arr_o)
#print(arr_es,arr_os)

for i in arr_es:
    cnt_e=arr_e.count(i)
    if cnt_e>most_e:
        most_e=cnt_e
        
for i in arr_os:
    cnt_o=arr_o.count(i)
    if cnt_o>most_o:
        most_o=cnt_o

#print(most_e,most_o)
else:
    print(n-most_e-most_o)

n=int(input())
arr=input().split(" ")
arr_s=set(arr)
#print(arr)
a=0
most_e=0
most_o=0
arr_e=[0 for i in range(int(n/2))]
arr_o=[0 for i in range(int(n/2))]
for i in range(int(n/2)):
    arr_e[i]=arr[a]
    arr_o[i]=arr[a+1]
    a+=2
#print(arr_e,arr_o)
arr_es=set(arr_e)
arr_os=set(arr_o)
#print(arr_es,arr_os)

for i in arr_es:
    cnt_e=arr_e.count(i)
    if cnt_e>most_e:
        most_e=cnt_e
        if cnt_e>=n/4:
            break
        
for i in arr_os:
    cnt_o=arr_o.count(i)
    if cnt_o>most_o:
        most_o=cnt_o
        if cnt_o>=n/4:
            break

#print(most_e,most_o)
if len(arr_s)==1:
    print(int(n/2))
else:
    print(n-most_e-most_o)

import collections
n=int(input())
arr=input().split(" ")
arr_s=set(arr)
a=0
arr_e=[0 for i in range(int(n/2))]
arr_o=[0 for i in range(int(n/2))]
for i in range(int(n/2)):
    arr_e[i]=arr[a]
    arr_o[i]=arr[a+1]
    a+=2
ce=collections.Counter(arr_e).most_common()
co=collections.Counter(arr_o).most_common()
if len(arr_s)==1:
    print(int(n/2))
else:
    if ce[0][0]!=co[0][0]:
        print(n-ce[0][1]-co[0][1])
    else:
        print(n-max(ce[0][1]+co[1][1],ce[1][1]+co[0][1]))

num=input()
num_str=list(num)
lengh=len(num_str)
tmp=num_str
for i in range(lengh):
    if num_str[i]=="1":
        tmp[i]="9"
    elif num_str[i]=="9":
        tmp[i]="1"
ans="".join(tmp)
print(ans)

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()
ans = ""

for i in range(n):
    if n[i] == 1:
        ans += "9"
    else:
        ans += "1"
print(int(ans))



n = input()
ans = ""

for i in range(len(n)):
    if n[i] == "1":
        ans += "9"
    else:
        ans += "1"
print(int(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):
print(1100-int((input()))

n = int(input())
a = [111,222,333,444,555,666,777,888,999]
b = 0
for i in a:
  if i >= n:
    b = i
    break
print(b)

print(1100-int((input()))

print(1100-int(input()))

print(1110-int(input()))

Verdicts: Runtime Error

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

print(str(input()).replace('1','0').replace('9','1').replace('0','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):
c=list(input())
ans=str()
for i in range(len(c)):
    if c[i]=='9':
        c[i]='1'
    ans+=c[i]
print(int(ans))

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

S=input()
S = S.replace("1", "Z")
S = S.replace("9", "1")
S = S.replace("Z", "9")
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):
import collections
n=int(input())
v=[int(i) for i in input().split(' ')]

v_odd = v[1::2]
v_even = v[0::2]

vo = collections.Counter(v_odd).most_common()
ve = collections.Counter(v_even).most_common()


if vo[0][0] == ve[0][0]:
    
    if vo[0][1] > ve[0][1]:
        result = len(v_odd) - vo[0][1] + len(v_even) - ve[1][1]
    elif vo[0][1] < ve[0][1]:
        result = len(v_odd) - vo[1][1] + len(v_even) - ve[0][1]
    else:
        result = len(v_odd) - vo[0][1] + len(v_even) 
else:
    result = len(v_odd) - vo[0][1] + len(v_even) - ve[0][1]

print(result)

n=input()
n = n.replace('1','a')
n = n.replace('9','b')
n = n.replace('a','9')
n = n.replace('b','1')
print(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()
str = list(N)
for i in range(3):
  if str[i] == 9:
    str[i] = 1
  elif str[i] == 1:
    str[i] = 9
str2 = "".join(str)
print(str2)

N = input()
str = list(N)
for i in range(3):
  if str[i] == "9":
    str[i] = "1"
  elif str[i] == "1":
    str[i] = "9"
print(str)
str2 = "".join(str)
print(str2)

N = input()
str = list(N)
for i in range(3):
  if str[i] == "9":
    str[i] = "1"
  elif str[i] == "1":
    str[i] = "9"
str2 = "".join(str)
print(str2)

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):
ret = ''
for a in input():
  if a = '1':
    ret += '9'
  elif a = '9':
    ret += '1'
  else:
    ret += a
print(ret)

ret = ''
for a in input():
  if a == '1':
    ret += '9'
  elif a == '9':
    ret += '1'
  else:
    ret += a
print(ret)


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())
count = 0

for i in n:
    if i == "1":
        n[count] = "9"
    elif i == "9":
        n[count] = "1"
    count += 1

print("".job(n))

n = list(input())
count = 0

for i in n:
    if i == "1":
        n[count] = "9"
    elif i == "9":
        n[count] = "1"
    count += 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 = input()
N = list(n)
for i in N:
  if i == "1":
    i = "9"
  else:
    i = "1"
print(n)

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

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

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

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

def main():
  s=["9" if x=="1" else "1" for x in input()]
  print("".join(s))
if __name__=="__main__":
  main()

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

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

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


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

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

Verdicts: Wrong Answer

Runtime Error

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 = list(map( int, sinput()))
 
h = 3
for i in range(h):
  if( n[i] == 1):
    n[i] = 9
    n[i] = str(n[i])   
  else:
    n[i] = 1
    n[i] = str(n[i])
    
a = "".join(n)
 
print(a)

N = int( input())
 
n = N // 100
 
if( N % 100 <= n * 10 + n):
	print(n * 100 + n * 10 + n )
  
else:
  	print( n * 100 + n * 10 + n + 111)

N = int( input())

n = N // 100

if( N % 100 <= n * 10 + n):
	print(n * 100 + n * 10 + n )
  
else:


n = list(map( int, split()))

h = 3
for i range(h):
  if( n[i] == 1):
    n[i] = 9
    n[i] = str(n[i])   
  else:
    n[i] = 1
    n[i] = str(n[i])
    
a = "".join(n)

print(a)

n = list(map( int, split()))
 
h = 3
for i in range(h):
  if( n[i] == 1):
    n[i] = 9
    n[i] = str(n[i])   
  else:
    n[i] = 1
    n[i] = str(n[i])
    
a = "".join(n)
 
print(a)

N = int( input())
 
n = N // 100
 
if( N % 100 <= n * 10 + n):
	print(n * 100 + n * 10 + n )
  
else:
  	print( (n + 1)* 100 + (n + 1)* 10 + (n + 1))


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

Verdicts: Runtime Error

Wrong Answer

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

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

#112a
s=list(input())
for i in range(3):
    if s[i]==1:
        s[i]=9
    else:
        s[i]=1
print(s)

s=list(input())
for i in range(s):
	if s[i]==1:
    	s[i]=9
    else:
    	s[i]=1

s=list(input())
for i in range(3):
    if s[i]=="1":
        s[i]=9
    else:
        s[i]=1
print(s[0]*100+s[1]*10+s[2])

Verdicts: Wrong Answer

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

n = input()
print(n.replace('1', '_').replace('9', '1').replace('_', '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 = int(input())
XY = [list(map(int, input().split())) for _ in range(n)]
mod = sum(XY[0])%2
for x, y in XY:
    if mod != (x+y)%2:
        print(-1)
        exit()

m = 33-mod
print(m)
D = [2**i for i in range(31, -1, -1)]
if mod:
    D.append(1)

print(" ".join(map(str, D)))
for x, y in XY:
    w = " "
    for d in D:
        if x-y >= 0 and x+y >= 0:
            w += "R"
            x -= d
        elif x-y < 0 and x+y >= 0:
            w += "U"
            y -= d
        elif x-y >= 0 and x+y < 0:
            w += "D"
            y += d
        else:
            w += "L"
            x += d
    print(w)



from collections import Counter
n = int(input())
k = n//2
a = list(map(int, input().split()))
p = []
q = []
for i in range(k):
    p.append(a[2*i])
    q.append(a[2*i+1])
s = Counter(p).most_common()
t = Counter(q).most_common()
u, v = len(s), len(t)
ans = 0
if s[0][0] == t[0][0]:
    if u == 1 and v == 1:
        ans = k
    elif u == 1:
        ans = k - t[1][1]
    elif v == 1:
        ans = k - s[1][1]
    else:
        comp = max(s[1][1], t[1][1])
        ans = n - s[0][1] - comp
else:
    ans = n - s[0][1] - t[0][1]
print(ans)



s = input()
s = s.replace("1","2")

s = s.replace("9","1")

s = s.replace("2","9")

print(s)

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(str(int(input())))
ans = ""
for i in n :
	if i == 1 :
		ans += "9"
	else :
		ans += "1"
print(int(ans))

n = list(str(int(input())))
ans = ""
for i in n :
	if i == "1" :
		ans += "9"
	else :
		ans += "1"
print(int(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):
# -*- coding: utf-8 -*-
n = input()
n = n.replace('9', '1')
print(n.replace('1', '9'))

# -*- coding: utf-8 -*-
s = input()
print(s.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()
for i in range(len(n)):
  if n[i]=="9":
    n[i]="1"
  else:
    n[i]="9"
print(n)

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

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] == '9':
        n[i] = '1'
    else:
        n[i] = '9'
print(int(n))


n = input()
ans = ''
for i in range(3):
    if n[i] == '9':
        ans += '1'
    else:
        ans +=  '9'
print(int(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())
i = int(n / 111)
if n % 111 != 0:
    i += 1
print(i * 111)

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

int a
while a < 3:
  if s[a] == "1":
    s[a] = "9"
  else s[a] == "9":
    s[a] = "1"
  a += 1

print(int(s))

s=list(input())


a = 0
while a < 3:
  if s[a] == "1":
    s[a] = "9"
  elif s[a] == "9":
    s[a] = "1"
  a += 1

print(int(s))

s=list(input())

int a = 0
while a < 3:
  if s[a] == "1":
    s[a] = "9"
  else s[a] == "9":
    s[a] = "1"
  a += 1

print(int(s))

s=list(input())


a = 0
while a < 3:
  if s[a] == "1":
    s[a] = "9"
  elif s[a] == "9":
    s[a] = "1"
  a += 1

s = ''.join(s)


print(s)

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

n = input()
ans = ""
for i in n:
  if i == "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):
N = str(input())

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

N = str(input())

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



N = input()
L = list(N)

for i in range(3):
  if L[i] == "1":
    L[i] = "9"
  else:
    L[i] = "1"
print("".join(L))

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()
n = [‘1’ for a in n if a==‘9’ else ‘9’]
print(“”.join(n))

n = input()
ans = “”
for a in n:
  if a == “1”:
    ans  = ans + “9”
  else:
    ans = ans + “1”
print(ans)


n = input()
ans = “”
for a in n:
  if a == “1”:
    ans  = ans + “9”
  else:
    ans = ans + “1”
print(ans)

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


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):
x=input()
out=""
for i in x:
  if i==9:
    out+="1"
  else:
    out+="9"
print(out)

x=input()
out=""
for i in x:
  if i=="9":
    out+="1"
  else:
    out+="9"
print(out)


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=str()
for i in n:
  if i==1:
    ans+='9'
  else:
    ans+='1'
print(ans)

n=input()
ans=str()
for i in n:
  if 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):
n_str = input()
res = 0
for i in range(3):
  s = 10**i - int(n_str[i])
  res = res + s

print(res)

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

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

n_str = input()
res = 0
for i in range(3):
  s = (10 - int(n_str[i])) * 10**i
  res = res + s

print(res)

n_str = input()
res = 0
for i in range(3):
  s = 10**i + int(n_str[i])
  res = res + s
  
print(res)

n_str = input()
res = 0
for i in range(3):
  s = (10 - int(n_str[i])) * 10**(2-i)
  res = res + s


print(res)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

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):
s = input()
l = []
for i in range(3):
  l += s[i]
for i in range(3):
  if l[i] == '1':
    l[i] == '9'
  elif l[i] == '9':
    l[i] == '1'
print(l[0] + l[1] + l[2])

s = input()
l = []
for i in range(3):
  l += s[i]
for i in range(3):
  if l[i] == '1':
    l[i] = '9'
  elif l[i] == '9':
    l[i] = '1'
print(l[0] + l[1] + l[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):
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()
l = list(a)
for i in range(len(a)):
    if l[i] == "9":
        l[i] = "1"
    elif l[i] == "1":
        l[i] = "9"
print("".join(l))

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() )
n.replace( "1", "0" )
n.replace( "9", "1" )
n.replace( "0", "9" )

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

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

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

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

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

print(s)

s = input()
s = s.replace('1','2')
s = s.replace('9','1')
s = s.replace('2','9')
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(int(input())-N)


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())
print(1100-N)

N = int(input())
print(1110-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):
n = int(input())
v = list(map(int,input().split()))
l1 = []
l2 = []
for i,v_ in enumerate(v):
    if i%2==0:
        l1.append(v_)
    else:
        l2.append(v_)

from collections import Counter
if set(l1)==set(l2):
    print(n//2)
else:
    c1 = Counter(l1).most_common(2)
    c2 = Counter(l2).most_common(2)
    if c1[0][0]==c2[0][0]:
        print(n-max(c1[0][1]+c2[1][1], c1[1][1]+c2[0][1]))
    else:
        print(n-c1[0][1]-c2[0][1])


n = input()
for n_ in n:
    if n_=='1':
        print('9',end='')
    else:
        print('1',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=int(input())
a,b=[None]*100000,[None]*100000
for i in range(100000):
    a[i]=[None]*2
    a[i][0]=0
    a[i][1]=i
    b[i]=[None]*2
    b[i][0]=0
    b[i][1]=i
l=list(map(int,input().split()))
for i in range(n//2):
    a[l[2*i]-1][0]+=1
    b[l[2*i+1]-1][0]+=1
a.sort(reverse=True)
b.sort(reverse=True)
if a[0][1]==b[0][1]:
    print(n-max(a[0][0]+b[1][0],a[1][0]+b[0][0]))
else:
    print(n-a[0][0]-b[0][0])

n=input()
l=""
for i in range(3):
    if n[i]=="1":
        l+="9"
    elif n[i]=="9":
        l+="1"
    else:
        l+=n[i]
print(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):
text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))
~                     

text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))

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

def answer(list,n):
    Even = collections.Counter(list[::2]).most_common(2)
    Odd = collections.Counter(list[1::2]).most_common(2)

    if Even[0][0] != Odd[0][0]:
        return n - Even[0][1] - Odd[0][1]
    else:
        if len(Even) == 1 or len(Odd) == 1:
            return n // 2
        else:
            return n - max(Even[0][1]+Odd[1][1],Even[1][1]+Odd[0][1])

N = int(input())
list = input().split(" ")
print(answer(list,N))


ans = int(input())
print(1110-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 x in n:
  if x == '1':
    ans += '9'
   else:
    ans += '1'
print(ans)

n = input()
ans = ''
for x in n:
  if x == '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):
N = input()
print(N)
n=0
if N == "111":
    n = 999
elif N == "119":
    n = 991
elif N == "199":
    n= 911
elif N == "999":
    n = 111
elif N == "911":
    n = 199
elif N == "991":
    n = 119

print(n)

N = input()
n=0
if N == "111":
    n = 999
elif N == "119":
    n = 991
elif N == "199":
    n= 911
elif N == "999":
    n = 111
elif N == "911":
    n = 199
elif N == "991":
    n = 119
elif N == "191":
    n = 919
elif N == "919":
    n = 191

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):
n = int(input())
AllList = list(map(int, input().split()))
OddList = [0 for i in range(100001)]
EvenList = [0 for i in range(100001)]
for i in range(n):
    if i % 2 == 0:
        OddList[AllList[i]] += 1
    else:
        EvenList[AllList[i]] += 1

OddMax = max(OddList)
EvenMax = max(EvenList)
OddMaxNum = OddList.index(OddMax)
EvenMaxNum = EvenList.index(EvenMax)

if OddMaxNum == EvenMaxNum:
    if OddMax > EvenMax:
        EvenList[EvenMaxNum] = 0
    else:
        OddList[OddMaxNum] = 0

OddMax = max(OddList)
EvenMax = max(EvenList)

ans = n - OddMax - EvenMax

print(ans)



print(str(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):
print(1110-int(inpout()))

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

result = n.replace('1', '2').replace('9','1').replace('2','9')

return result


n = str(input())

result = n.replace('1', '2').replace('9','1').replace('2','9')

print(result)


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 = input()
line = input().split()
odd = line[::2]
even = line[1::2]
o = collections.Counter(odd)
e = collections.Counter(even)
maxoddcnt = o.most_common()[0][1]
maxevencnt = e.most_common()[0][1]


if odd == even:
    print(len(odd))
    exit(0)


if o.most_common()[0][0] == e.most_common()[0][0]:
    if len(o.most_common()) > 1 and len(e.most_common()) <= 1:
        maxoddcnt = o.most_common()[1][1]
    if len(o.most_common()) <= 1 and len(e.most_common()) > 1:
        maxevencnt = e.most_common()[1][1]
    if o.most_common()[1][1] + e.most_common()[0][1] >= o.most_common()[0][1] + e.most_common()[1][1]:
        maxoddcnt = o.most_common()[1][1]
    else: #if o.most_common()[1][1] + e.most_common()[0][1] <= o.most_common()[0][1] + e.most_common()[1][1] :
        maxevencnt = e.most_common()[1][1]
        input()

print(len(odd)-maxoddcnt+len(even)-maxevencnt)


import collections

n = input()
line = input().split()
odd = line[::2]
even = line[1::2]
o = collections.Counter(odd)
e = collections.Counter(even)
maxoddcnt = o.most_common()[0][1]
maxevencnt = e.most_common()[0][1]


if odd == even:
    print(len(odd))
    exit(0)


if o.most_common()[0][0] == e.most_common()[0][0]:
    if o.most_common()[1][1] + e.most_common()[0][1] > o.most_common()[0][1] + e.most_common()[1][1]:
        maxoddcnt = o.most_common()[1][1]
    else: #if o.most_common()[1][1] + e.most_common()[0][1] <= o.most_common()[0][1] + e.most_common()[1][1] :
        maxevencnt = e.most_common()[1][1]

print(len(odd)-maxoddcnt+len(even)-maxevencnt)


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

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


n = int(input())
v = list(map(int, input().split()))
odd = []
even = []
for i in range(int(n/2)):
    even.append(v[2*i])
    odd.append(v[2*i + 1])
evencount = collections.Counter(even)
oddcount = collections.Counter(odd)


def hoge(i):
    global ans
    try:
        if evencount.most_common()[i][0] == oddcount.most_common()[i][0]:

            if evencount.most_common()[i][1] > oddcount.most_common()[i][1]:
                ans = n - evencount.most_common()[i][1] - oddcount.most_common()[i][1]
                print(ans)
            elif evencount.most_common()[i][1] < oddcount.most_common()[i][1]:
                ans = n - evencount.most_common()[i][1] - oddcount.most_common()[i][1]
                print(ans)
            else:
                if len(evencount) == 1:
                    ans = int(n/2)
                    print(ans)
                else:
                    hoge(i+1)

        else: 
            ans = n - evencount.most_common()[i][1] - oddcount.most_common()[i][1]
            print(ans)
    except IndexError:   
        ans = n - evencount.most_common()[0][1] - oddcount.most_common()[1][1]
        print(ans) 


hoge(0)

import numpy as np

n = int(input())

ans = 0

if n % 10 == 9:
    ans += 1
else:
    ans += 9
n = int(n/10)


if n % 10 == 9:
    ans += 10
else:
    ans += 90
n = int(n/10)
if n % 10 == 9:
    ans += 100
else:
    ans += 900


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

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

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

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

n = input()

print(n.replace('1', 'a').replace('9', 'b').replace('a', '9').replace('b', '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 = 0
for l in n:
  if l == '1':
    ans += 9
  else:
    ans += 1
print(ans)

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

Verdicts: Wrong Answer

Accepted