problem_id
stringlengths 6
6
| user_id
stringlengths 10
10
| time_limit
float64 1k
8k
| memory_limit
float64 262k
1.05M
| problem_description
stringlengths 48
1.55k
| codes
stringlengths 35
98.9k
| status
stringlengths 28
1.7k
| submission_ids
stringlengths 28
1.41k
| memories
stringlengths 13
808
| cpu_times
stringlengths 11
610
| code_sizes
stringlengths 7
505
|
---|---|---|---|---|---|---|---|---|---|---|
p03242 | u393881437 | 2,000 | 1,048,576 | 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. | ["n = input()\nnl =[]\n\nfor i in range(3):\n if n[i] == '1':\n nl.append('9')\n else:\n nl.append('1')\nprint(nl)\n\n", "n = list(input())\nnl =[]\n\nfor i in n:\n if i == '1':\n nl.append('9')\n else:\n nl.append('1')\nprint(''.join(nl))"] | ['Wrong Answer', 'Accepted'] | ['s300006909', 's968804647'] | [2940.0, 2940.0] | [18.0, 17.0] | [126, 129] |
p03242 | u395761272 | 2,000 | 1,048,576 | 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. | ["input_line = str(input())\ns = []\n\nfor i in range(len(input_line)):\n if input_line[i] == '9':\n s.append('1')\n elif input_line[i] == '1':\n s.append('9')\n else:\n s.append(input_line[i])\n\nprint(s)\n\nmojiretu = ''\n\nfor x in s:\n mojiretu += x\n\nprint(int(mojiretu)\n", "input_line = str(input())\ns = []\n\nfor i in range(len(input_line)):\n if input_line == '9':\n s.append('1')\n elif input_line == '1':\n s.append('9')\n else:\n s.append(input_line[i])\n\nfor x in s:\n mojiretu += x\n \nprint(mojiretu)\n", "input_line = str(input())\ns = []\n\nfor i in range(len(input_line)):\n if input_line[i] == '9':\n s.append('1')\n elif input_line[i] == '1':\n s.append('9')\n else:\n s.append(input_line[i])\n\nprint(s)\n\nmojiretu = ''\n\nfor x in s:\n mojiretu += x\n\nprint(mojiretu)\n", "input_line = input()\ndef gen(n):\n if n < 10:\n yield n\n else:\n for m in gen(n/10):\n yield m\n yield n%10\n\na = [str(i) for i in gen(int(input_line))]\nd = []\nfor s in a:\n if s == '9':\n s = '1'\n elif s == '1':\n s = '9'\n d.append(s)\n\nprint(d)\n \nmojiretu = ''\n\nfor x in d:\n mojiretu += x\n\nprint(mojiretu)", "input_line = str(input())\ns = []\n\nfor i in range(len(input_line)):\n if input_line == '9':\n s.append('1')\n elif input_line == '1':\n s.append('9')\n else:\n s.append(input_line[i])\n\nmojiretu = ''\n\nfor x in s:\n mojiretu += x\n\nprint(mojiretu)\n", "input_line = str(input())\ns = []\n\nfor i in range(len(input_line)):\n if input_line[i] == '9':\n s.append('1')\n elif input_line[i] == '1':\n s.append('9')\n else:\n s.append(input_line[i])\n\nprint(s)\n\nmojiretu = ''\n\nfor x in s:\n mojiretu += x\n\nprint(int(mojiretu))\n", "input_line = str(input())\ns = []\n\nfor i in range(len(input_line)):\n if input_line[i] == '9':\n s.append('1')\n elif input_line[i] == '1':\n s.append('9')\n else:\n s.append(input_line[i])\n\nmojiretu = ''\n\nfor x in s:\n mojiretu += x\n\nprint(int(mojiretu))\n"] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s011086693', 's057218608', 's247332132', 's393604135', 's598479585', 's876177060', 's302003158'] | [2940.0, 2940.0, 2940.0, 3064.0, 2940.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [290, 241, 286, 326, 270, 291, 281] |
p03242 | u396824275 | 2,000 | 1,048,576 | 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. | ['def cal(n,v):\n k=n//2\n even=range(0,2*k,2)\n odd=range(1,2*k+1,2)\n\n el=[]\n for i in even:\n el.append(v[i])\n ol=[]\n for i in odd:\n ol.append(v[i])\n\n d={}\n for i in el:\n if((i in d) is False):\n d[i]=0\n else:\n d[i]+=1\n\n f={}\n for i in ol:\n if((i in f) is False):\n f[i]=0\n else:\n f[i]+=1\n\n while(True):\n e = max(d, key=d.get)\n o = max(f, key=f.get)\n if(e==o):\n if(d[e]>f[e]):\n del f[e]\n elif(d[e]<f[e]):\n del d[e]\n else:\n return print(k)\n else:\n break\n\n sum=0\n for i in el:\n if(i!=e):\n sum+=1\n for i in ol:\n if(i!=o):\n sum+=1\n return print(sum)\n\nn=int(input())\nv=list(map(int,input().split()))\ncal(n,v)', 'n=int(input())\nv=list(map(int,input().split()))\n \nk=n//2\neven=range(0,2*k,2)\nodd=range(1,2*k+1,2)\n \nel=[]\nfor i in even:\n el.append(v[i])\nol=[]\nfor i in odd:\n ol.append(v[i])\n \nd={}\nfor i in el:\n if((i in d)is False ):\n d[i]=0\n else:\n d[i]+=1\ne = max(d, key=d.get)\n \nd={}\nfor i in ol:\n if((i in d)is False ):\n d[i]=0\n else:\n d[i]+=1\no = max(d, key=d.get)\n \nif(el==ol):\n print(k)\nelse:\n sum=0\n for i in el:\n if(i!=e):\n sum+=1\n for i in ol:\n if(i!=o):\n sum+=1\n print(sum)', 'N=input()\na=[]\nfor i in range(3):\n if(N[i]=="1"):\n a.append("9")\n elif(N[i]=="9"):\n a.append("1")\n else:\n a.append(N[i])\nprint("".join(a))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s000104816', 's008874569', 's776388934'] | [3064.0, 3064.0, 3060.0] | [18.0, 17.0, 17.0] | [884, 566, 168] |
p03242 | u396890425 | 2,000 | 1,048,576 | 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. | ["print(int(input().replace('1', '9').replace('9','1')))", 'print(1110-int(input()))'] | ['Wrong Answer', 'Accepted'] | ['s859916755', 's158615261'] | [2940.0, 2940.0] | [17.0, 17.0] | [54, 24] |
p03242 | u398437835 | 2,000 | 1,048,576 | 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. | ["s = input()\nif s[0] == '1':\n s[0] = '9'\nelse:\n s[0] = '1'\nif s[1] == '1':\n s[1] = '9'\nelse:\n s[1] = '1'\nif s[2] == '1':\n s[2] = '9'\nelse:\n s[2] = '1'\nprint(s)", "s = input()\ns = list(s)\nif s[0] == '1':\n s[0] = '9'\nelse:\n s[0] = '1'\nif s[1] == '1':\n s[1] = '9'\nelse:\n s[1] = '1'\nif s[2] == '1':\n s[2] = '9'\nelse:\n s[2] = '1'\n\nprint(''.join(s))\n"] | ['Runtime Error', 'Accepted'] | ['s992740087', 's317229327'] | [2940.0, 3060.0] | [18.0, 18.0] | [164, 187] |
p03242 | u398942100 | 2,000 | 1,048,576 | 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. | ["print(input().replace('1','9'))", "print(input().replace('1','a').replace('9','1').replace('a','9'))"] | ['Wrong Answer', 'Accepted'] | ['s760702996', 's647042336'] | [2940.0, 2940.0] | [17.0, 17.0] | [31, 65] |
p03242 | u399721252 | 2,000 | 1,048,576 | 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. | ['s = list(input())\nfor i in range(s):\n if s[i] == "1":\n s[i] = "9"\n elif s[i] == "9":\n s[i] = "1"\n\n\nprint("".join(s))', 's = list(input())\nfor i in range(len(s)):\n if s[i] == "1":\n s[i] = "9"\n elif s[i] == "9":\n s[i] = "1"\n\n\nprint("".join(s))'] | ['Runtime Error', 'Accepted'] | ['s581032167', 's024393958'] | [2940.0, 2940.0] | [17.0, 17.0] | [124, 129] |
p03242 | u403436880 | 2,000 | 1,048,576 | 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. | ['N = input()\n\nprint(N.replace("1","x").replace("9","1").replace("x","1"))', 'n = input()\nprint(n.replace("1", "x").replace("9", "1").replace("x", "9"))'] | ['Wrong Answer', 'Accepted'] | ['s006147765', 's792097885'] | [8996.0, 8800.0] | [26.0, 26.0] | [72, 74] |
p03242 | u403832169 | 2,000 | 1,048,576 | 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. | ['n=input()\nv=input().split()\n\nnlis=list(n)\nnint=int(n)\npart_num=int((nint/2))\nev_num=[]\nfor i in range(part_num):\n ev = 2*i\n ev_num.extend(v[ev])\ncount_ev=[]\nfor i in range(part_num):\n count=0\n count_ev.append(ev_num.count(ev_num[i]))\n \nans_ev=min(count_ev)\n\nod_num=[]\nfor i in range(part_num):\n od = (2*i) + 1\n od_num.extend(v[od])\ncount_od=[]\nfor i in range(part_num):\n count=0\n count_od.append(od_num.count(od_num[i]))\nans_od=min(count_od)\n\nif v.count(v[0]) == len(v):\n ans=part_num\nelse:\n ans=ans_ev+ans_od\nprint(ans) ', 'n=input()\nn=list(n)\nif n[0]==\'1\':\n n[0]=\'9\'\nelif n[0]==\'9\':\n n[0]=\'1\'\nif n[1]==\'1\':\n n[1]=\'9\'\nelif n[1]==\'9\':\n n[1]=\'1\'\nif n[2]==\'1\':\n n[2]=\'9\'\nelif n[2]==\'9\':\n n[2]=\'1\'\nans=int("".join(n))\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s949311993', 's532763775'] | [3064.0, 3064.0] | [17.0, 18.0] | [579, 218] |
p03242 | u403984573 | 2,000 | 1,048,576 | 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. | ['S=input()\nfor i in range(len(S)):\n if S[i]=="1":\n S[i]="9"\n else:\n S[i]="1"\nprint(S)', 'S=input()\nA=""\nfor i in range(len(S)):\n if S[i]=="1":\n A+="9"\n else:\n A+="1"\nprint(int(S))', 'S=input()\nA=""\nfor i in range(len(S)):\n if S[i]=="1":\n A+="9"\n else:\n A+="1"\nprint(int(A))'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s090712499', 's661898791', 's347998524'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [92, 98, 98] |
p03242 | u408620326 | 2,000 | 1,048,576 | 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. | ["n=list(input())\nfor i in n:\n if n[i] == '1':\n n[i] = '9'\n elif n[i] == '9':\n n[i] = '1'\n\nprint(int(''.join(n)))", "n=list(input())\nfor i in range(len(n)):\n if n[i] == '1':\n n[i] = '9'\n elif n[i] == '9':\n n[i] = '1'\n\nprint(int(''.join(n)))"] | ['Runtime Error', 'Accepted'] | ['s445953558', 's617049643'] | [2940.0, 2940.0] | [17.0, 20.0] | [119, 131] |
p03242 | u409831002 | 2,000 | 1,048,576 | 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. | ['#################################\n\n\n\n\n\n\n#################################\ndef separate(values,a,b):\n for v in values:\n a.append(v)\n a,b = b,a\n\n\n##############################\n\n\n\n\n\n##############################\ndef getCount(values):\n currentNum=0\n currentCount=0\n ret={\'First\' :{\'Num\':[],\'Cnt\':0},\n \'Second\':{\'Num\':[],\'Cnt\':0}}\n for v in values:\n if v==currentNum:\n currentCount+=1\n else:\n \n if ret[\'First\'][\'Cnt\'] < currentCount:\n \n ret[\'Second\']=ret[\'First\'].copy()\n ret[\'First\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'First\'][\'Cnt\'] == currentCount:\n \n ret[\'First\'][\'Num\'].append(currentNum)\n elif ret[\'Second\'][\'Cnt\'] < currentCount:\n \n ret[\'Second\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'Second\'][\'Cnt\'] == currentCount:\n \n ret[\'Second\'][\'Num\'].append(currentNum)\n\n currentNum=v\n currentCount=1\n\n \n if ret[\'First\'][\'Cnt\'] < currentCount:\n ret[\'Second\']=ret[\'First\'].copy()\n ret[\'First\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'First\'][\'Cnt\'] == currentCount:\n ret[\'First\'][\'Num\'].append(currentNum)\n elif ret[\'Second\'][\'Cnt\'] < currentCount:\n ret[\'Second\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'Second\'][\'Cnt\'] == currentCount:\n ret[\'Second\'][\'Num\'].append(currentNum)\n\n return ret\n\n\n#############################\n\n#############################\nvars = input ()\na=[]\nb=[]\nvarArray=vars.split(" ")\nseparate(varArray,a,b)\na.sort()\nb.sort()\na_result=getCount(a)\nb_result=getCount(b)\nif (len(a_result[\'First\'][\'Num\'])>1 or\n len(b_result[\'First\'][\'Num\'])>1):\n \n xa=len(a)-a_result[\'First\'][\'Cnt\']\n xb=len(b)-b_result[\'First\'][\'Cnt\']\n x=xa+xb\nelse:\n \n if a_result[\'First\'][\'Num\'][0]!=b_result[\'First\'][\'Num\'][0]:\n \n xa=len(a)-a_result[\'First\'][\'Cnt\']\n xb=len(b)-b_result[\'First\'][\'Cnt\']\n x=xa+xb\n else:\n \n xaa=len(a)-a_result[\'First\'][\'Cnt\']\n xab=len(b)-b_result[\'Second\'][\'Cnt\']\n xa=xaa+xab\n xba=len(a)-a_result[\'Second\'][\'Cnt\']\n xbb=len(b)-b_result[\'First\'][\'Cnt\']\n xb=xba+xbb\n x=xa if xa<xb else xb\n\nprint(x)\n', '\n#################################\n\n\n\n\n\n\n#################################\ndef separate(values,a,b):\n for v in values:\n a.append(v)\n a,b = b,a\n\n\n##############################\n\n\n\n\n\n##############################\ndef getCount(values):\n currentNum=0\n currentCount=0\n ret={\'First\' :{\'Num\':[],\'Cnt\':0},\n \'Second\':{\'Num\':[],\'Cnt\':0}}\n for v in values:\n if v==currentNum:\n currentCount+=1\n else:\n \n if ret[\'First\'][\'Cnt\'] < currentCount:\n \n ret[\'Second\']=ret[\'First\'].copy()\n ret[\'First\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'First\'][\'Cnt\'] == currentCount:\n \n ret[\'First\'][\'Num\'].append(currentNum)\n elif ret[\'Second\'][\'Cnt\'] < currentCount:\n \n ret[\'Second\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'Second\'][\'Cnt\'] == currentCount:\n \n ret[\'Second\'][\'Num\'].append(currentNum)\n\n currentNum=v\n currentCount=1\n\n \n if ret[\'First\'][\'Cnt\'] < currentCount:\n ret[\'Second\']=ret[\'First\'].copy()\n ret[\'First\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'First\'][\'Cnt\'] == currentCount:\n ret[\'First\'][\'Num\'].append(currentNum)\n elif ret[\'Second\'][\'Cnt\'] < currentCount:\n ret[\'Second\']={\'Num\':[currentNum],\'Cnt\':currentCount}\n elif ret[\'Second\'][\'Cnt\'] == currentCount:\n ret[\'Second\'][\'Num\'].append(currentNum)\n\n return ret\n\n\n#############################\n\n#############################\nn = input()\nvars = input ()\na=[]\nb=[]\nvarArray=vars.split(" ")\nseparate(varArray,a,b)\na.sort()\nb.sort()\na_result=getCount(a)\nb_result=getCount(b)\nif (len(a_result[\'First\'][\'Num\'])>1 or\n len(b_result[\'First\'][\'Num\'])>1):\n \n xa=len(a)-a_result[\'First\'][\'Cnt\']\n xb=len(b)-b_result[\'First\'][\'Cnt\']\n x=xa+xb\nelse:\n \n if a_result[\'First\'][\'Num\'][0]!=b_result[\'First\'][\'Num\'][0]:\n \n xa=len(a)-a_result[\'First\'][\'Cnt\']\n xb=len(b)-b_result[\'First\'][\'Cnt\']\n x=xa+xb\n else:\n \n xaa=len(a)-a_result[\'First\'][\'Cnt\']\n xab=len(b)-b_result[\'Second\'][\'Cnt\']\n xa=xaa+xab\n xba=len(a)-a_result[\'Second\'][\'Cnt\']\n xbb=len(b)-b_result[\'First\'][\'Cnt\']\n xb=xba+xbb\n x=xa if xa<xb else xb\n\nprint(x)\n', 'n=int(input())\nd=1\nfor i in range(3):\n x=n//d%10\n if x==1:\n n+=8*d\n elif x==9:\n n-=8*d\n d*=10\n\nprint(n)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s598994056', 's735934483', 's306983047'] | [3192.0, 3192.0, 2940.0] | [18.0, 18.0, 17.0] | [3093, 3106, 129] |
p03242 | u410118019 | 2,000 | 1,048,576 | 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. | ['n=list(map(int,input().split()))\nfor i in range(3):\n if n[i] == 1:\n n[i] = 9\n else:\n n[i] = 1\nprint("".join(n))', 'n=list(input())\nfor i in range(3):\n if n[i] == "1":\n n[i] = "9"\n else:\n n[i] = "1"\nprint("".join(n))'] | ['Runtime Error', 'Accepted'] | ['s887577395', 's451424757'] | [2940.0, 2940.0] | [17.0, 17.0] | [119, 108] |
p03242 | u411544692 | 2,000 | 1,048,576 | 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. | ['inp = input()\n\ncorrected = ""\nfor l in inp:\n if l == "1":\n corrected += "9"\n elif l == 9:\n corrected += "1"\n else:\n print("error")\n\nprint(int(corrected))', 'inp = input()\n\ncorrected = ""\nfor l in inp:\n if l == "1":\n corrected += "9"\n elif l == "9":\n corrected += "1"\n else:\n print("error")\n\nprint(int(corrected))'] | ['Runtime Error', 'Accepted'] | ['s341430058', 's882148269'] | [2940.0, 2940.0] | [17.0, 19.0] | [165, 167] |
p03242 | u411858517 | 2,000 | 1,048,576 | 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. | ['import collections\n\nN = int(input())\nl = list(map(int, input().split()))\n\na = []\nb = []\na_f = 0\nb_f = 0\na_s = 0\nb_s = 0\nfor i in range(N):\n if i%2 == 0:\n a.append(l[i])\n else:\n b.append(l[i])\n \nc_a = collections.Counter(a)\nc_b = collections.Counter(b)\n\na_f = c_a.most_common()[0]\nb_f = c_b.most_common()[0]\n\nif a_f[0] != b_f[0]:\n print(N - a_f[1] - b_f[1])\n\nelif len(set(a)) == 1 and len(set(b)) == 1:\n print(int(N/2))\nelif len(set(a)) == 1:\n print(int(N/2 - c_b.most_common()[1][1]))\nelif len(set(b)) == 1:\n print(int(N/2 - c_a.most_common()[1][1]))\nelif a_f[1] == b_f[1]:\n second_a = c_a.most_common()[1][1]\n second_b = c_b.most_common()[1][1]\n if second_a >= second_b:\n print(int(N - b_f[1] - second_a)\n else:\n print(int(N - a_f[1] - second_b)\nelif a_f[1] > b_f[1]:\n print(int(N - a_f[1] - c_b.most_common()[1][1]))\nelse:\n print(int(N - b_f[1] - c_a.most_common()[1][1]))', "N = input()\nres = ''\nfor i in range(len(N)):\n if N[i] == '1':\n res += '9'\n if N[i] == '9':\n res += '1'\n \nprint(res)"] | ['Runtime Error', 'Accepted'] | ['s171335929', 's192848262'] | [3064.0, 2940.0] | [18.0, 17.0] | [945, 142] |
p03242 | u415325136 | 2,000 | 1,048,576 | 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. | ["input = str(input())\ninput.replace('9', '_').replace('1', '9').replace('_', '1')\nprint(input)", 'input = str(input())\ninput = input.replace("9", "_")\ninput = input.replace("1", "9")\ninput = input.replace("_", "1")\nprint(input)\n'] | ['Wrong Answer', 'Accepted'] | ['s884299969', 's854892395'] | [2940.0, 2940.0] | [17.0, 17.0] | [93, 130] |
p03242 | u430414424 | 2,000 | 1,048,576 | 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. | ['N = str(input())\n\nfor n in N:\n n = str(eval(10 - n))\n \nprint(int(n))', 'N = str(input())\n\nans = ""\nfor n in N:\n formura = "10-{}".format(n)\n ans += str(eval(formura))\n\nprint(int(ans))'] | ['Runtime Error', 'Accepted'] | ['s434205691', 's739816569'] | [2940.0, 2940.0] | [17.0, 17.0] | [74, 117] |
p03242 | u430537811 | 2,000 | 1,048,576 | 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. | ['#Bad_Beast\nn=int(input())\nif n==111:\n print(111)\nif n>111 and n<=222:\n print(222)\nelif n>222 and n<=333:\n print(333)\nelif n>333 and n<=444:\n print(444)\nelif n>444 and n<=555:\n print(555)\nelif n>555 and n<=666:\n print(666)\nelif n>666 and n<=777:\n print(777)\nelif n>777 and n<=888:\n print(888)\nelif n>888 and n<=999:\n print(999)\n#print(res) \n \n ', '#Bad_Beast\nn=list(input())\nfor i in range(len(n)):\n if n[i]=="1":\n n[i]="9"\n elif n[i]=="9":\n n[i]="1"\nres=""\nfor i in range(len(n)):\n res+=n[i]\nprint(res) \n \n '] | ['Wrong Answer', 'Accepted'] | ['s786968485', 's720990704'] | [3060.0, 2940.0] | [17.0, 17.0] | [383, 196] |
p03242 | u434872492 | 2,000 | 1,048,576 | 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. | ["n = input()\ns = []\nfor i in range(len(n)):\n if n[i] == '1':\n s.append('9')\n elif n[i] == '9':\n s.append('1')\nprint(s)", "n = input()\ns = []\nans = 0\nfor i in range(len(n)):\n if n[i] == '1':\n ans += 9*(10**(2-i))\n elif n[i] == '9':\n ans += 1*(10**(2-i))\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s210734672', 's379710461'] | [2940.0, 2940.0] | [19.0, 17.0] | [137, 161] |
p03242 | u435314001 | 2,000 | 1,048,576 | 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. | ["n = input()\nprint(''.join(map(lambda c: '9' if c == '1' else '1' if c == '9' else c, n))", "print(input().replace('1','t').replace('9', '1').replace('t', '9'))"] | ['Runtime Error', 'Accepted'] | ['s841060195', 's267571766'] | [2940.0, 2940.0] | [17.0, 18.0] | [88, 67] |
p03242 | u440129511 | 2,000 | 1,048,576 | 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. | ["s=input()\nprint(s.translate({'1':'9', '9':'1'}))\n", "s=input()\nprint(s.replace('1', '9').replace('9', '1'))\n", "s=input()\nprint(s.replace('1', '9'))\n", "s=input()\nprint(s.translate(s.maketrans({'1':'9', '9':'1'})))\n"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s059417154', 's280678199', 's607219557', 's968233973'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [49, 55, 37, 62] |
p03242 | u440478998 | 2,000 | 1,048,576 | 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. | ["input().translate(str.maketrans({'1': '9', '9': '1'}))", "str(input()).translate(str.maketrans({'1': '9', '9': '1'}))", "print(input().translate(str.maketrans({'1': '9', '9': '1'})))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s648021607', 's970192257', 's268304455'] | [9080.0, 9032.0, 9072.0] | [26.0, 28.0, 28.0] | [54, 59, 61] |
p03242 | u441320782 | 2,000 | 1,048,576 | 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. | ['x = [int(i) for i in input()]\n\nfor i in range(len(x)):\n if x[i] == 1:\n x[i] = 9\n else:\n x[i] = 1\n \nprint(x)', 'x = [int(i) for i in input()]\n\nfor i in range(len(x)):\n if x[i] == 1:\n x[i] = 9\n elif x[i]==9:\n x[i] = 1\n \nprint(x)', 'x = [int(i) for i in input()]\n\nfor i in range(len(x)):\n if x[i] == 1:\n x[i] = "9"\n elif x[i] == 9:\n x[i] = "1"\n \nprint("".join(x))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s224443574', 's501745478', 's018882566'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [118, 126, 141] |
p03242 | u441575327 | 2,000 | 1,048,576 | 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. | ['print(1110-int(input))', 'print(1110-int(input()))'] | ['Runtime Error', 'Accepted'] | ['s835868101', 's766189109'] | [2940.0, 2940.0] | [17.0, 17.0] | [22, 24] |
p03242 | u445628522 | 2,000 | 1,048,576 | 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. | ['s=input()\nn=n.replace("1","X")\nn=n.replace("9","1")\nn=n.replace("X","9")\nn=int(n)\nprint(n)', 'n=input()\nn=n.replace("1","X")\nn=n.replace("9","1")\nn=n.replace("X","9")\nn=int(n)\nprint(n)'] | ['Runtime Error', 'Accepted'] | ['s137882168', 's000873079'] | [2940.0, 2940.0] | [17.0, 17.0] | [90, 90] |
p03242 | u446711904 | 2,000 | 1,048,576 | 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. | ["m=input()\ndef s(x):\n if x=='1':\n return '9'\n else:\n return '1'\nprint(s(m[0])+s(m[1])+s(m[2])", "m=input()\ndef s(x):\n if x=='1':\n \treturn '9'\n else:\n return '1'\nprint(s(m[0])+s(m[1])+s(m[2])", "m=input()\ndef s(x):\n if x=='1'\n \treturn '9'\n else:\n return '1'\nprint(s(m[0])+s(m[1])+s(m[2])", "m=input()\ndef s(x):\n if x=='1':\n return '9'\n else:\n return '1'\nprint(s(m[0])+s(m[1])+s(m[2]))"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s526225853', 's533389453', 's646015847', 's622788628'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [100, 99, 98, 101] |
p03242 | u449555432 | 2,000 | 1,048,576 | 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. | ['print(int(input()).replace(1,9).replace(9,1))\n', "a=int(input())\nprint(str(a).replace('1','9').replace('9','1'))\n", "a=int(input())\nprint(int(str(a).replace('1','9').replace('9','1')))\n", 'print(input().replace(1,9).replace(9,1))', "a=int(input())\nb=str(a).replace('1','9').replace('9','1')\nprint(int(b))\n", "a=int(input())\nb=str(a)\nprint(b.replace('1','9').replace('9','1'))\n", "print(input().replace('1','9').replace('9','1'))\n", 'a=int(input())\nprint(a.replace(1,9).replace(9,1))\n', 'a=int(input())\nfor i in a:\n if i ==1:\n i=9\n elif i ==9:\n i=1\n print(int(a))', "a = list(input())\nb = ''\nfor i in a:\n if i == '1':\n b += '9'\n else:\n b += '1'\nprint(str(b))"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s051522465', 's108899929', 's146317734', 's230545998', 's314261121', 's550064449', 's678779320', 's780510155', 's894196941', 's759823934'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [46, 63, 68, 40, 72, 67, 49, 50, 84, 99] |
p03242 | u452015170 | 2,000 | 1,048,576 | 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. | [' n = input()\n dict = {"1" : "9", "9" : "1"}\n ans = ""\nfor i in range(len(n)) :\n ans += dict[n[i]]\nprint(ans)', 'n = input()\ndict = {"1" : "9", "9" : "1"}\nans = ""\nfor i in range(len(n)) :\n ans += dict[n[i]]\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s004006396', 's971493491'] | [2940.0, 3064.0] | [17.0, 17.0] | [111, 108] |
p03242 | u453815934 | 2,000 | 1,048,576 | 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. | ['s = input()\nprint(s.replace("9","1").replace("1","9"))', 's = input()\nprint(s.replace("9","c").replace("1","9").replace("c"."1"))\n', 's = input()\nprint(s.replace("9","c").replace("1","9").replace("c","1"))\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s656867723', 's711994415', 's434401094'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [54, 72, 72] |
p03242 | u454481887 | 2,000 | 1,048,576 | 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. | ['n = input()\nif n = 999:\n print("111")\nelif n = 991:\n print("119")\nelif n = 911:\n print("199")\nelif n = 919:\n print("191")\nelif n = 199:\n print("911")\nelif n = 191:\n print("919")\nelif n = 199:\n print("911")\neise:\n print("999")', 'n = input()\nif n == 999:\n print("111")\nelif n == 991:\n print("119")\nelif n == 911:\n print("199")\nelif n == 919:\n print("191")\nelif n == 199:\n print("911")\nelif n == 191:\n print("919")\nelif n == 199:\n print("911")\neise:\n print("999")', 'n = input()\nif n == 999:\n print("111")\nelif n == 991:\n print("119")\nelif n == 911:\n print("199")\nelif n == 919:\n print("191")\nelif n == 199:\n print("911")\nelif n == 191:\n print("919")\nelif n == 199:\n print("911")\nelse:\n print("999")', 'n = int(input())\nprint(1110 - n)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s187448904', 's583251919', 's940763412', 's049407868'] | [2940.0, 2940.0, 3060.0, 2940.0] | [17.0, 17.0, 17.0, 18.0] | [248, 255, 255, 32] |
p03242 | u455642216 | 2,000 | 1,048,576 | 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. | ['n=input()\nprint(n.replace("1","x").replace("9","1").replace("x","1"))', 'n=input()\nprint(n.replace("9","x").replace("1","9").replace("x","1"))'] | ['Wrong Answer', 'Accepted'] | ['s863709889', 's643706866'] | [3064.0, 2940.0] | [17.0, 17.0] | [69, 69] |
p03242 | u455696302 | 2,000 | 1,048,576 | 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. | ['import collections\n \nn = int(input())\nv = [int(i) for i in input().split()]\n \nv1 = [v[i] for i in range(0,n,2)]\nv2 = [v[i] for i in range(1,n,2)]\n \ncount1 = collections.Counter(v1).most_common(2)\ncount2 = collections.Counter(v2).most_common(2)\n\nif max(count1.values()) != max(count2.values()):\n res = len(v1) - max(count1.values()) + len(v2) - max(count2.values())\n print(res)\nelse:\n if len(count1) == 1:\n print(len(v1))\n else:\n res1 = len(v1) - count1[0][1] + len(v2) - count2[1][1]\n res2 = len(v1) - count1[1][1] + len(v2) - count2[0][1]\n print(min(res1,res2))\n', "N = list(input())\n\nr = []\n\nfor i in N:\n if i == '1':\n r.append('9')\n else:\n r.append('1')\n\nprint(''.join(r))"] | ['Runtime Error', 'Accepted'] | ['s901967768', 's623779185'] | [3316.0, 2940.0] | [21.0, 17.0] | [603, 128] |
p03242 | u456566864 | 2,000 | 1,048,576 | 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. | ["n = input()\n\nfor i,v in enumerate(n):\n if v == '9':\n n[i] = '1'\n elif v == '1':\n n[i] = '9'\n \nprint(n)", "n = input()\n\nans = ''\nfor i, v in enumerate(n):\n if v == '9':\n ans += '1'\n elif v == '1':\n ans += '9'\n else:\n ans += v\n\nprint(ans)"] | ['Runtime Error', 'Accepted'] | ['s012778880', 's072925471'] | [2940.0, 2940.0] | [17.0, 17.0] | [113, 160] |
p03242 | u457957084 | 2,000 | 1,048,576 | 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. | ['n = input()\n\nprint(n.replace("1","9").repace("9","1"))\n \n', 'n = input()\n\nprint(n.translate(str.maketrans({"1":"9"}))\n', 'n = input()\n\nprint(n.replace("1","9").replace("9","1")\n \n', 'n = input()\n\nprint(n.replace("1","9").repace("9","1")\n \n', 'n = input()\n\nprint(n.translate(str.maketrans({"1":"9","9":"1"})))\n '] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s178842133', 's282383420', 's883676397', 's932503419', 's400513461'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0] | [62, 57, 62, 61, 72] |
p03242 | u466331465 | 2,000 | 1,048,576 | 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. | ['S = input()\nfor i in range(3):\n if S[i]=="9":\n S[i]="1"\n elif S[i]=="1":\n S[i] ="9"\nprint(S)', 'S = list(input())\nfor i in range(3):\n if S[i]=="9":\n S[i]="1"\n elif S[i]=="1":\n S[i] ="9"\nprint("".join(S))'] | ['Runtime Error', 'Accepted'] | ['s776820826', 's925915089'] | [2940.0, 2940.0] | [18.0, 17.0] | [100, 115] |
p03242 | u466335531 | 2,000 | 1,048,576 | 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. | ['print(1100-int(input())', 'print(1110-int(input()))'] | ['Runtime Error', 'Accepted'] | ['s193819589', 's889297916'] | [2940.0, 2940.0] | [17.0, 17.0] | [23, 24] |
p03242 | u466371843 | 2,000 | 1,048,576 | 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. | ['n = int(input())\n\nn = 1000 - n\n\nprint(n)\n', 'n = int(input())\nprint(1110 - n)\n'] | ['Wrong Answer', 'Accepted'] | ['s507493553', 's311542497'] | [2940.0, 3060.0] | [17.0, 19.0] | [41, 33] |
p03242 | u469953228 | 2,000 | 1,048,576 | 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. | ['n=input()\nfor i in range(3):\n n[i] = 10-n[i]\nprint(n)', 'n=int(input())\nfor i in range(3):\n n[i] = 10-n[i]\nprint(n)', "n=input()\nn.replace('1','x')\nn.replace('9','1')\nn.replace('x','9')\nprint(n)", "n=input()\nn=n.replace('1','x')\nn=n.replace('9','1')\nn=n.replace('x','9')\nprint(n)\n"] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s270430576', 's454240426', 's468820334', 's401747978'] | [3064.0, 2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0, 18.0] | [54, 59, 75, 82] |
p03242 | u475675023 | 2,000 | 1,048,576 | 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. | ['print(((int(input())-1)//111+1)*111)\n', "print(''.join(list(map(lambda x:['1','9'][x=='1'],list(input())))))"] | ['Wrong Answer', 'Accepted'] | ['s584202689', 's229347025'] | [2940.0, 2940.0] | [17.0, 17.0] | [37, 67] |
p03242 | u477343425 | 2,000 | 1,048,576 | 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. | ["n = input()\nans = n.replace('1','x').replace('9','1').replace('x','1')\nprint(ans)", "s = input()\nans = s.replace('9','temp').replace('1','9').replace('temp','1')\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s130752737', 's736921216'] | [2940.0, 2940.0] | [17.0, 17.0] | [81, 87] |
p03242 | u480200603 | 2,000 | 1,048,576 | 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. | ['# coding: utf-8\n# Your code here!\n\nimport collections\n\nn = int(input())\nv_l = list(map(int, input().split()))\n\nif len(set(v_l)) == 1:\n print(n // 2)\n exit()\n\nv_l_odd = []\nv_l_even = []\n\nfor i in range(n):\n if i % 2 == 0:\n v_l_odd.append(v_l[i])\n else:\n v_l_even.append(v_l[i])\n\nmax_odd = collections.Counter(v_l_odd)\nmon = max_odd.most_common(1)[0][0]\nmax_even = collections.Counter(v_l_even)\nmen = max_even.most_common(1)[0][0]\n\nif mon == men:\n if max(max_odd.most_common(2)[1][1], max_even.most_common(2)[1][1]) == max_odd.most_common(2)[1][1]:\n mon = max_odd.most_common(2)[1][1]\n else:\n men = max_even.most_common(2)[1][1]\n\nv_l_odd_l = []\nv_l_even_l = []\n\nfor i in range(n):\n if i % 2 == 0:\n if v_l[i] != mon:\n v_l_odd_l.append(v_l[i])\n else:\n if v_l[i] != men:\n v_l_even_l.append(v_l[i])\n\nprint(len(v_l_odd_l) + len(v_l_even_l))\n\n\n', "n = input()\nprint(n.translate(str.maketrans({'1': '9', '9': '1'})))"] | ['Runtime Error', 'Accepted'] | ['s627477594', 's545905852'] | [3316.0, 2940.0] | [20.0, 17.0] | [924, 67] |
p03242 | u481026841 | 2,000 | 1,048,576 | 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. | ["n = input()\nprint(n.replace('1','9').replace('9','1'))", "n = input()\nprint(n.translate(str.maketrans({'1': '9', '9': '1'})))"] | ['Wrong Answer', 'Accepted'] | ['s133913675', 's473621503'] | [2940.0, 2940.0] | [17.0, 17.0] | [54, 67] |
p03242 | u483005329 | 2,000 | 1,048,576 | 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. | ['n=input()\nd={"9":"1","1":"9"}\n"".join(d[x] for x in n)', 'n=input()\nd=["9":"1","1":"9"]\n"".join(d[x] for x in n)', 'n=input()\nd={"9":"1","1":"9"}\n"".join(d[x] for in n)', 'n=input()\nd={"9":"1","1":"9"}\nprint("".join(d[x] for x in n))'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s106372745', 's395046405', 's914338317', 's434486525'] | [2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 18.0] | [54, 54, 52, 61] |
p03242 | u484229314 | 2,000 | 1,048,576 | 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. | ["print(input().translate(str.maketrans({'1':'9','9':'1'}))", "print(input().replace('1','x').replace('9','1').replace('x','9'))"] | ['Runtime Error', 'Accepted'] | ['s845398580', 's991146674'] | [2940.0, 2940.0] | [17.0, 17.0] | [57, 65] |
p03242 | u485716382 | 2,000 | 1,048,576 | 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. | ["from collections import Counter\n\n\ndef main():\n n = int(input())\n v_n = input().split(' ')\n \n guusuu = Counter(v_n[::2])\n kisuu = Counter(v_n[1::2])\n\n guusuu = guusuu.most_common()\n kisuu = kisuu.most_common()\n\n\n if guusuu[0][0]==kisuu[0][0]:\n if len(guusuu)==1 and len(kisuu)==1:\n print(guusuu)\n else:\n print(min(n - guusuu[0][1] - kisuu[1][1], n- guusuu[1][1] - kisuu[0][1]))\n else:\n print(n - guusuu[0][1] - kisuu[0][1])\n \nmain()", 'n = list(input())\n\nresult = ""\n\nfor a in n:\n if a == \'1\':\n result += \'9\'\n else:\n result += \'1\'\n\n\nprint(result)'] | ['Runtime Error', 'Accepted'] | ['s697420535', 's527494989'] | [3316.0, 2940.0] | [21.0, 17.0] | [508, 118] |
p03242 | u489136758 | 2,000 | 1,048,576 | 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. | ['arr=[1,9]\nA,B,C=map(int,input())\nif A in arr and B in arr and C in arr :\n A=10-A\n B=10-B\n C=10-C\n print(A,B,C)\n', 'arr=[]\narr19=[\'1\',\'9\']\nn=int(input())\nif(n>=111 and n<=999):\n arr=list(str(n))\noutput=""\nfor i in range(3):\n if arr[i] in arr19 :\n output+=str(10-int(arr[i]))\nprint(output) \n'] | ['Wrong Answer', 'Accepted'] | ['s806702699', 's285639294'] | [2940.0, 3060.0] | [17.0, 17.0] | [126, 195] |
p03242 | u492447501 | 2,000 | 1,048,576 | 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. | ['n = list(input())\n\nfor i,s in enumerate(n):\n if s==1:\n n[i]=9\n elif s==9:\n \tn[i]=1\n\nprint(n,sep="")', 'n = list(input())\n\nfor i,s in enumerate(n):\n if s=="1":\n n[i]="9"\n elif s=="9":\n \tn[i]="1"\n\nprint(*n,sep="")\n\n'] | ['Wrong Answer', 'Accepted'] | ['s304110982', 's920283204'] | [2940.0, 2940.0] | [17.0, 17.0] | [105, 116] |
p03242 | u494058663 | 2,000 | 1,048,576 | 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. | ['n = list(map(int,input()))\nn_length=len(n)\n\n\nfor i in range(n_length):\n if n[i]==1:\n n[i]=9\n elif n[i]==9:\n n[i]=1\n else:\n pass\n\nprint(str(n))\n \n', 'import sys\nN=int(input())\nN_str = []\nfor i in range(N,999):\n N+=1\n N_new = N\n while N>0:\n N_str.append(N%10)\n N//=10\n N_str.reverse()\n \n N = N_new\n \n if N_str[0]==N_str[1] and N_str[1]==N_str[2]:\n print(N)\n break\n\nsys.exit()', "n = list(map(str,input()))\nn_length=len(n)\n\n\nfor i in range(n_length):\n if n[i]=='1':\n n[i]='9'\n elif n[i]=='9':\n n[i]='1'\n else:\n pass\nn_new=''.join(n)\nprint(str(n_new))\n "] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s604856276', 's894368281', 's128181913'] | [2940.0, 3060.0, 2940.0] | [17.0, 17.0, 18.0] | [178, 282, 205] |
p03242 | u497883442 | 2,000 | 1,048,576 | 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. | ['n = input()\nn = n.replace("1","a")\nn = n.replace("9","1")\nn = n.replace("a,"9")\nprint(n)', 'n = input()\nn = n.replace("1","a")\nn = n.replace("9","1")\nn = n.replace("a","9")\nprint(n)\n'] | ['Runtime Error', 'Accepted'] | ['s375027174', 's537708231'] | [2940.0, 2940.0] | [17.0, 17.0] | [88, 90] |
p03242 | u500297289 | 2,000 | 1,048,576 | 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. | ['""" AtCoder """\n\nimport sys\ninput = sys.stdin.readline\n\nn = input()\n\nans = []\n\nfor i in range(len(n)):\n if n[i] == \'1\':\n ans.append(\'9\')\n else:\n ans.append(\'1\')\nprint(\'\'.join(ans))\n', '""" AtCoder """\n\nimport sys\ninput = sys.stdin.readline\n\nn = input()\n\nans = []\n\nfor i in range(3):\n if n[i] == \'1\':\n ans.append(\'9\')\n else:\n ans.append(\'1\')\nprint(\'\'.join(ans))\n'] | ['Wrong Answer', 'Accepted'] | ['s328985760', 's815404738'] | [2940.0, 2940.0] | [17.0, 17.0] | [201, 196] |
p03242 | u501750652 | 2,000 | 1,048,576 | 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. | ['from functools import reduce\n\nN = int(input())\nN_list = [int(x) for x in list(str(N))]\n\nN_ = []\nfor i in N_list:\n print("i", i)\n if i == 1:\n i = 9\n elif i == 9:\n i = 1\n N_.append(i)\n\nnew_N = int(reduce(lambda x,y: x+y, [str(x) for x in N_]))\n\nprint(new_N)', 'from functools import reduce\n\nN = int(input())\nN_list = [int(x) for x in list(str(N))]\n\nN_ = []\nfor i in N_list:\n if i == 1:\n i = 9\n elif i == 9:\n i = 1\n N_.append(i)\n\nnew_N = int(reduce(lambda x,y: x+y, [str(x) for x in N_]))\n\nprint(new_N) \n'] | ['Wrong Answer', 'Accepted'] | ['s313686890', 's174054714'] | [3572.0, 3572.0] | [23.0, 23.0] | [281, 268] |
p03242 | u503111914 | 2,000 | 1,048,576 | 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. | ['a = [i for i in input()]\nfor j in range(3):\n if a[j] =="1":\n a[j] = "9"\n else:\n a[j] = "1"\nprint(a)', 'a = [i for i in input()]\nfor j in range(3):\n if a[j] =="1":\n a[j] = "9"\n else:\n a[j] = "1"\nprint(a[0]+a[1]+a[2])\n'] | ['Wrong Answer', 'Accepted'] | ['s989562608', 's543487716'] | [2940.0, 2940.0] | [17.0, 17.0] | [107, 121] |
p03242 | u505420467 | 2,000 | 1,048,576 | 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. | ['ans=[]\nn=int(input())\na=n//100\nb=(n-a*100)//10\nc=n-a*100-b-10\nans.append(a)\nans.append(b)\nans.append(c)\nfor i in ans:\n if i==1:\n print(9,end="")\n else:\n print(1,end="")\n', 'print(1110-int(input()))\n'] | ['Wrong Answer', 'Accepted'] | ['s247479145', 's192716626'] | [3316.0, 2940.0] | [21.0, 18.0] | [189, 25] |
p03242 | u506587641 | 2,000 | 1,048,576 | 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. | ['s = list(input())\n\nfor i in range(3):\n if s[i] == 1:\n s[i] = 9\n\n else:\n s[i] == 1\n\nprint(s)', 's = list(input())\n\nfor i in range(3):\n if s[i] == 1:\n s[i] = 9\n\n else:\n s[i] = 1\n\nprint(s)\n', "s = list(str(input()))\n\nfor i in range(3):\n if s[i] == '1':\n s[i] = '9'\n\n else:\n s[i] = '1'\n\nprint (''.join(s))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s106168535', 's488219632', 's040423674'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [111, 111, 131] |
p03242 | u506858457 | 2,000 | 1,048,576 | 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. | ["A=input()\nfor i in range(3):\n if A[i]=='1':\n A[i]='9'\n else if A[i]=='9':\n A[i]='1'\nprint(A)", 'A=int(input().split())\nfor i in range(3):\n if A[i]==1:\n A[i]=9\n else if A[i]==9:\n A[i]=1\nprint(A)', "A=input()\nfor i in range(3):\n if A[i]=='1':\n A[i]='9'\n else if A[i]=='9':\n A[i]='1'\nprint('A')", "n = input()\nfor c in n:\n if (c == '1'):\n print('9', end='')\n elif (c == '9'):\n print('1', end='')\n else:\n print(c, end='')\nprint()"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s139577318', 's525301398', 's756982566', 's703272877'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [100, 105, 102, 160] |
p03242 | u507116804 | 2,000 | 1,048,576 | 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. | ["n=str(input())\n\nprint(s.translate(str.maketrans({'9': '1', '1': '9'})))\n", "n=str(input())\n\nprint(n.translate(str.maketrans({'1': '9', '9': '1'})))"] | ['Runtime Error', 'Accepted'] | ['s308241740', 's718915618'] | [2940.0, 3188.0] | [17.0, 19.0] | [72, 71] |
p03242 | u508124369 | 2,000 | 1,048,576 | 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. | ['n = int(input())\ni = int(n / 111)\nif n % 111 != 0:\n i += 1\nprint(i * 111)', "number = list(input())\nanswer = []\nfor i in number:\n if i == 1:\n answer.append(9)\n elif i == 9:\n answer.append(1)\n else:\n answer.append(i)\nprint(''.join(answer))", "n = list(input())\nans = []\nfor i in n:\n if i=='9':\n ans.append('1')\n elif i=='1':\n ans.append('9')\n else:\n ans.append(i)\nprint(''.join(ans))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s086845551', 's369101109', 's508646235'] | [9156.0, 8912.0, 8936.0] | [26.0, 26.0, 28.0] | [76, 173, 170] |
p03242 | u512546018 | 2,000 | 1,048,576 | 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. | ["n = int(input())\n\nans = ''\nfor w in str(s):\n if w == '1':\n ans += '9'\n elif w == '9':\n ans += '1'\n else:\n ans += str(w)\n \nprint(int(ans))", "n = input()\n \nans = ''\nfor w in str(s):\n if w == '1':\n ans += '9'\n elif w == '9':\n ans += '1'\n else:\n ans += str(w)\n \nprint(int(ans))", "s = input()\n \nans = ''\nfor w in str(s):\n if w == '1':\n ans += '9'\n elif w == '9':\n ans += '1'\n \nprint(int(ans))"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s579180055', 's815844815', 's357390247'] | [3060.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0] | [174, 170, 138] |
p03242 | u512803662 | 2,000 | 1,048,576 | 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. | ['inp = int(input())\nret = 0\nfor i in range(1, 10):\n ret = i*111\n if ret >= inp:\n break\nprint(ret)', 'n=input()\ns=""\nfor i in n:\n if i==\'1\':\n s+=\'9\' \n elif i==\'9\':\n s+=\'1\'\n else:\n s+=i \nprint(s)'] | ['Wrong Answer', 'Accepted'] | ['s077355063', 's679139896'] | [2940.0, 3064.0] | [17.0, 17.0] | [109, 122] |
p03242 | u516242950 | 2,000 | 1,048,576 | 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. | ['kazu = list(input())\nfor k in range(len(kazu)):\n if kazu[k] == "1":\n kazu[k] == "9"\n elif kazu[k] == "9":\n kazu[k] == "1"\nprint("".join(kazu))', 'kazu = list(input())\nfor k in range(len(kazu)):\n if kazu[k] == "1":\n kazu[k] = "9"\n elif kazu[k] == "9":\n kazu[k] = "1"\nprint("".join(kazu))'] | ['Wrong Answer', 'Accepted'] | ['s894289268', 's104281090'] | [2940.0, 2940.0] | [17.0, 17.0] | [150, 148] |
p03242 | u518042385 | 2,000 | 1,048,576 | 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. | ['i=list(input())\nfor j in i:\n if j=="9":\n j=1\n else:\n j=9\nprint("".join(i))', 'print(1110-int(input()))'] | ['Wrong Answer', 'Accepted'] | ['s308331042', 's724982038'] | [2940.0, 2940.0] | [18.0, 17.0] | [82, 24] |
p03242 | u518064858 | 2,000 | 1,048,576 | 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. | ['n=input()\nfor i in range(len(n)):\n if n[i]=="1":\n n[i]="9"\n else:\n n[i]="1"\nprint(n)\n', 'n=input()\nans=""\nfor i in range(len(n)):\n if n[i]=="1":\n ans+="9"\n else:\n ans+="1"\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s413270255', 's297433111'] | [2940.0, 2940.0] | [17.0, 18.0] | [105, 114] |
p03242 | u518556834 | 2,000 | 1,048,576 | 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. | ['n = int(input())\na = list(str(n))\nm = int(a[0])*100 + int(a[0])*10 + int(a[0]) \no = (int(a[0])+1)*100 + (int(a[0])+1)*10 + (int(a[0])+1)\nif m < n: \n print(o)\nelse:\n print(m)\n\n\n', 'n = int(input())\nprint( 1110 - n )'] | ['Wrong Answer', 'Accepted'] | ['s384835113', 's842547333'] | [2940.0, 2940.0] | [17.0, 17.0] | [176, 34] |
p03242 | u519939795 | 2,000 | 1,048,576 | 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. | [".replace('1','9')\n", 'n = input()\nprint(n.replace("1", "x").replace("9", "1").replace("x", "9"))'] | ['Runtime Error', 'Accepted'] | ['s436311978', 's086456919'] | [2940.0, 2940.0] | [17.0, 17.0] | [18, 74] |
p03242 | u522205105 | 2,000 | 1,048,576 | 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. | ['from collections import Counter\na,b,n = 0,0,int(input())\nn1 = n//2 + n%2\nn2 = n//2\nz = list(map(int,input().split()))\na,b = Counter(z[0::2]).most_common(2),Counter(z[1::2]).most_common(2)\n\nif a[0] == b[0]:\n\tprint(n2)\nelif len(a) == 1 and len(b) == 1:\n print(int(n/2))\nelse:\n\tprint(n1 - a[0][1]+n2 - b[0][1])', 'n = int(input())\np = 1110\n\nprint(p-n)'] | ['Runtime Error', 'Accepted'] | ['s653108720', 's157693457'] | [3316.0, 2940.0] | [20.0, 17.0] | [310, 37] |
p03242 | u528606376 | 2,000 | 1,048,576 | 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. | ["n = input('')\ni == ''\n\nif i == 1:\n i = 9\nelsif i == 9:\n i = 1\n \nprint(n)", 'n =input()\nif 111 =< n <= 999:\n ', 's = input()\n\nr = ""\nfor i in s:\n if i ==\'1\':\n r += \'9\'\n else:\n r += \'1\'\nprint(r)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s134628011', 's491527546', 's651055180'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [75, 33, 88] |
p03242 | u536177854 | 2,000 | 1,048,576 | 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. | ["s=input()\nfor i in range(3):\n if s[i] =='9':\n s[i]='1'\n else:\n s[i]='9'\nprint(s)", 's=input()\nt=[]\nfor i in range(3):\n if s[i] ==\'9\':\n t.append(\'1\')\n else:\n t.append(\'9\')\nst="".join(t)\nprint(st)'] | ['Runtime Error', 'Accepted'] | ['s282463015', 's892224501'] | [2940.0, 2940.0] | [17.0, 17.0] | [88, 118] |
p03242 | u538956308 | 2,000 | 1,048,576 | 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. | ["N = input()\nfor i in range(3):\n if N[i] == '1':\n N[i] == '9'\n else:\n N[i] == '1'\n\nprint(N)", "N = input()\nfor i in range(2):\n if N[i] == '1':\n N[i] == '9'\n else:\n N[i] == '1'\nprint(N)", "N = input()\nfor i in range(2):\n if N[i] == '1':\n N[i] == '9'\n else:\n N[i] == '1'\n ", "N = input()\nfor i in range(3):\n if N[i] == '1':\n N[i] = '9'\n else:\n N[i] = '1'\n \nprint(N)", "N = input()\nfor i in range(3):\n if N[i] == '1':\n N[i] == '9'\n else:\n N[i] == '1'\nprint(N)", "N = input()\nprint(N.translate(str.maketrans({'1': '9', '9': '1'})))"] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s053159268', 's221753405', 's272145933', 's700851851', 's760957979', 's274070928'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [98, 97, 90, 97, 97, 67] |
p03242 | u544050502 | 2,000 | 1,048,576 | 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. | ['x=input()\nn=[x[i] for i in range(len(x))]\nfor i in range(len(n)):\n if n[i]=="1"or"9":\n if n[i]=="1":\n n[i]="9"\n else:\n n[i]=="1"\nprint(int("".join(n)))', 'n=input()\nprint(int("".join(["1" if n[i]==9 else "9" if n[i]==1 else n[i] for i in range(len(n))])))', 'x=input()\nn=[x[i] for i in range(len(n))]\nfor i in range(len(n)):\n if n[i]=="1"or"9":\n if n[i]=="1":\n n[i]="9"\n else:\n n[i]=="1"\nprint(int("".join(n)))', 'n=input()\nfor i in range(len(n)):\n if n[i]=="1"or"9":\n if n[i]=="1":\n n[i]="9"\n else:n[i]=="1"\nprint(int(n))\n ', 'n=input()\nprint(int("".join(["1" if n[i]=="9" else "9" if n[i]=="1" else n[i] for i in range(len(n))])))'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s304931422', 's531068398', 's670631855', 's718183363', 's684693126'] | [3060.0, 2940.0, 3060.0, 2940.0, 2940.0] | [18.0, 19.0, 17.0, 18.0, 17.0] | [168, 100, 168, 125, 104] |
p03242 | u545368057 | 2,000 | 1,048,576 | 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. | ['S = input()\nans = ""\nfor s in S:\n if s == 9:\n ans += "1"\n elif s == 1:\n ans += "9"\n else:\n ans += s\nprint(int(ans))', 'S = input()\nans = ""\nfor s in S:\n if s == 9:\n ans += "1"\n elif s == 1:\n ans += "9"\n else:\n ans += s\nprint(ans)', 'S = input()\nans = ""\nfor s in S:\n if s == "9":\n ans += "1"\n elif s == "1":\n ans += "9"\n else:\n ans += s\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s671253460', 's776148746', 's125356462'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [145, 140, 144] |
p03242 | u548303713 | 2,000 | 1,048,576 | 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. | ['n=int(input())\nv=list(map(int,input().split()))\nodd=[[0,0] for i in range(10**5+1)]\neven=[[0,0] for i in range(10**5+1)]\nfor i in range(1,10**5+1):\n odd[i][1]=i\n even[i][1]=i\nfor i in range(n):\n if (i+1)%2==1:\n odd[v[i]][0]+=1\n else:\n even[v[i]][0]+=1\nodd=sorted(odd,reverse=True)\neven=sorted(even,reverse=True)\nans=0\nif(odd[0][0]+even[0][0]==n): #odd[0][0]=n//2\n if(odd[0][1]==even[0][1]):\n ans=n//2\n else:\n ans=0\n\nelse:\n \n if(odd[0][1]==even[0][1]):\n if(odd[0][0]+even[1][0]<=odd[1][0]+even[0][0]):\n ans=(n//2-odd[1][0])+(n//2-even[0][0])\n else:\n ans=(n//2-odd[0][0])+(n//2-even[1][0])\n\n else:\n ans=(n//2-odd[0][0])+(n//2-even[0][0])\nprint(ans)\n', 'n=int(input())\nn2=list(str(n))\nfor i in range(3):\n if n2[i]=="1":\n n2[i]="9"\n else:\n n2[i]="1"\nnew_n="".join(n2)\nprint(new_n)'] | ['Runtime Error', 'Accepted'] | ['s334322296', 's992570227'] | [3064.0, 2940.0] | [18.0, 17.0] | [833, 145] |
p03242 | u548545174 | 2,000 | 1,048,576 | 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. | ['N = input()\n \nif int(N) <= int(N[0] * 3):\n print(int(N[0] * 3))\nelse:\n print(int(str((int(N[0]) + 1)) * 3))', "n = input()\nd = {'1':'9', '9':'1'}\nprint(''.join([d[c] for c in n]))"] | ['Wrong Answer', 'Accepted'] | ['s182398195', 's767614074'] | [2940.0, 2940.0] | [18.0, 17.0] | [113, 68] |
p03242 | u550146922 | 2,000 | 1,048,576 | 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. | ['#111a\nprint(input().replace(1,x).replace(9.1).replace(x,9))', 'print(input().replace("1","x").replace("9","1").replace("x","9"))'] | ['Runtime Error', 'Accepted'] | ['s927832904', 's610973284'] | [8928.0, 9036.0] | [25.0, 30.0] | [59, 65] |
p03242 | u550535134 | 2,000 | 1,048,576 | 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. | ['n = input()\nprint(n.replace("1", "9").replace("9", "1"))', 'n = input()\nprint(n.replace("1", "x").replace("9", "1").replace("x", "9"))'] | ['Wrong Answer', 'Accepted'] | ['s679637455', 's386766646'] | [2940.0, 2940.0] | [17.0, 17.0] | [56, 74] |
p03242 | u550943777 | 2,000 | 1,048,576 | 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. | ['s=input()\nfoi i in s:\n if i=="9":\n print(\'1\',end="")\n else:\n print("9",end="")\nprint()', 's=input()\nfor i in s:\n if i=="9":\n print(\'1\',end="")\n else:\n print("9",end="")\nprint()'] | ['Runtime Error', 'Accepted'] | ['s565396961', 's338825183'] | [2940.0, 2940.0] | [18.0, 17.0] | [94, 94] |
p03242 | u551692187 | 2,000 | 1,048,576 | 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. | ["n = input()\nprint(n.replace('1', '9').replace('9', '1'))\n", "n = input()\nprint(n.replace('9','1').replace('1','9'))\n", "n = input()\nprint(n.translate(str.maketrans({'1':'9', '9':'1'})))\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s468059217', 's557073463', 's249189720'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [57, 55, 66] |
p03242 | u552357043 | 2,000 | 1,048,576 | 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. | ['n = str(input())\nfor i in range(3):\n if n[i] == "1":\n n[i] = "9"\n else:\n n[i] = "1"\nprint(n) ', 'n = str(input())\nm = ""\nfor i in range(3):\n if n[i] == "1":\n m += "9"\n else:\n m += "1"\nprint(m) \n'] | ['Runtime Error', 'Accepted'] | ['s086335860', 's214146152'] | [2940.0, 2940.0] | [17.0, 17.0] | [122, 126] |
p03242 | u554954744 | 2,000 | 1,048,576 | 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. | ["n=input()\nans=''\nfor i in range(len(n)):\n if n[i]==1:\n ans+='9'\n else:\n ans+='1'\nprint(ans)", "n=input()\nans=''\nfor i in range(len(n)):\n if n[i]=='1':\n ans+='9'\n else:\n ans+='1'\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s096149582', 's902661142'] | [2940.0, 2940.0] | [17.0, 17.0] | [111, 113] |
p03242 | u556326496 | 2,000 | 1,048,576 | 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. | ["num = input()\nfor i in range(len(num)):\n if num[i] == '1':\n num[i] = '9'\n else:\n num[i] = '1'\nprint(num)", "num = input()\nout = ''\nfor i in range(len(num)):\n if num[i] == '1':\n out += '9'\n else:\n out += '1'\nprint(out)"] | ['Runtime Error', 'Accepted'] | ['s042097659', 's297596370'] | [2940.0, 2940.0] | [17.0, 18.0] | [112, 117] |
p03242 | u556589653 | 2,000 | 1,048,576 | 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. | ['for i in input():\n print(9 if i == "1" else 1, end = "")\n print()', 'for i in input():\n print(9 if i == "1" else 1, end = "")\nprint()'] | ['Wrong Answer', 'Accepted'] | ['s064976681', 's307499268'] | [2940.0, 2940.0] | [17.0, 17.0] | [67, 68] |
p03242 | u557437077 | 2,000 | 1,048,576 | 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. | ['n = input()\nfor i in range(n):\n if n[i] == "1":\n n[i] = "9"\n else:\n n[i] = "1"\nprint(n)', 'n = str(input())\nlis = ""\nfor i in range(len(n)):\n if n[i] == "1":\n lis += "9"\n else:\n lis += "1"\nprint(lis)\n'] | ['Runtime Error', 'Accepted'] | ['s615455304', 's366704673'] | [2940.0, 2940.0] | [17.0, 17.0] | [95, 129] |
p03242 | u558782626 | 2,000 | 1,048,576 | 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. | ['print(1110-int(input())', 'print(1110-int(input()))'] | ['Runtime Error', 'Accepted'] | ['s353015844', 's383941364'] | [2940.0, 2940.0] | [17.0, 18.0] | [23, 24] |
p03242 | u561083515 | 2,000 | 1,048,576 | 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. | ['N = int(input())\nV = [int(i) for i in input().split()]\n\nVodd = V[1::2]\nVeven = V[::2]\n\nfrom collections import Counter\n\nVodd = sorted(Counter(Vodd).items(), key=lambda x:x[1])\nVeven = sorted(Counter(Veven).items(), key=lambda x:x[1])\n\nif Vodd[-1][0] == Veven[-1][0]:\n if len(Vodd) == len(Veven) == 1:\n ans = N - Vodd[-1][1]\n elif len(Vodd) == 1:\n ans = N - Vodd[-1][1] - Veven[-2][1]\n elif len(Veven) == 1:\n ans = N - Vodd[-2][1] - Veven[-1][1]\n elif Vodd[-2][1] >= Veven[-2][1]:\n ans = N - Vodd[-2][1] - Veven[-1][1]\n else:\n ans = N - Vodd[-1][1] - Veven[-2][1]\nelse:\n ans = N - Vodd[-1][1] - Veven[-1][1]\n\n\nprint(ans)\n', 'n = list(input())\n\nfor i in range(3):\n if n[i] == "1":\n n[i] = "9"\n elif n[i] == "9":\n n[i] = "1"\n\nprint(*n,sep="")'] | ['Runtime Error', 'Accepted'] | ['s200765668', 's611568967'] | [3064.0, 2940.0] | [18.0, 17.0] | [673, 135] |
p03242 | u562767072 | 2,000 | 1,048,576 | 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. | ['import sys\nstdin = sys.stdin\n \nsys.setrecursionlimit(10**7) \n \ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.readline().rstrip()\ndef lc(): return list(ns())\ndef ni(): return int(stdin.readline())\ndef nf(): return float(stdin.readline())\n \n# h,w = li()\n# ss = [ns() for _ in range(h)]\n\nn = int(input())\n\nvs = li()\nv_odd = []\nv_even = []\n\ni=0\nfor v in vs:\n if i % 2 == 0:\n v_even.append(v)\n else:\n v_odd.append(v)\n i = i + 1\n\nmax_count_odd = 0\n\nm_odd = 0\nm_even = 0\nfor ss in set(v_odd):\n count = v_odd.count(ss)\n if count > max_count_odd:\n max_count_odd = count\n m_odd = ss\n# import pdb;pdb.set_trace() \nmax_count_even = 0\nfor ss in set(v_even):\n count = v_even.count(ss)\n if count > max_count_even:\n max_count_even = count\n m_even = ss\n# import pdb;pdb.set_trace() \nans = len(v_even)-max_count_even + len(v_odd)-max_count_odd\n\nm2_oddmax = 0\nm2_evenmax = 0\nimport copy\n# import pdb;pdb.set_trace()\nif(m_even==m_odd):\n temp = set(v_odd)\n temp.remove(m_odd)\n m2_odd = 0\n # import pdb;pdb.set_trace()\n for ss in temp:\n count = v_odd.count(ss)\n if count > m2_oddmax:\n m2_oddmax = count\n m2_odd = ss\n temp = set(v_even)\n temp.remove(m_even)\n m2_even = 0\n for ss in temp:\n count = v_even.count(ss)\n if count > m2_evenmax:\n m2_evenmax = count\n m2_even = ss\n if m2_evenmax > m2_oddmax:\n # import pdb;pdb.set_trace()\n ans = len(v_even)-m2_evenmax + len(v_odd)-max_count_odd\n elif m2_evenmax <= m2_oddmax:\n # import pdb;pdb.set_trace()\n ans = len(v_even)-max_count_even + len(v_odd)-m2_oddmax\n if m2_even == 0 and m2_odd == 0:\n ans = int(n/2)\n # import pdb;pdb.set_trace()\n\n\nprint(ans)\n', "import sys\nstdin = sys.stdin\n \nsys.setrecursionlimit(10**7) \n \ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x)-1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return stdin.readline().rstrip()\ndef lc(): return list(ns())\ndef ni(): return int(stdin.readline())\ndef nf(): return float(stdin.readline())\n\n\n\na = str(input())\nans=''\nfor c in a:\n if c=='1':\n ans = ans + '9'\n elif c=='9':\n ans = ans + '1'\n else:\n ans = ans + c\n\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s297208449', 's474060321'] | [3412.0, 3064.0] | [22.0, 18.0] | [1979, 593] |
p03242 | u569898420 | 2,000 | 1,048,576 | 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. | ['#\nn = int(input())\n\nif 111 <= n <1000:\n #main\n n1 = int (n / 100)\n# print(n1)\n# print(" ")\n \n n2 = n - (n1 *100)\n n2 = int (n2 / 10)\n# print(n2)\n# print(" ")\n \n n3 = n - n1 *100 - n2*10\n# print(n3)\n# print(" ")\n \n if n1 == 9:\n n1 = 1\n if n1 == 1:\n n1 = 9\n if n2 == 9:\n n2 = 1\n if n2 == 1:\n n2 = 9\n if n3 == 9:\n n1 = 1\n if n3 == 1:\n n3 = 9\n\n nn = n1 *100 + n2*10 + n3\n\n print(nn)', '\n#\nn = int(input())\n\nif 111 <= n <1000:\n #main\n n1 = int (n / 100)\n# print(n1)\n# print(" ")\n \n n2 = n - (n1 *100)\n n2 = int (n2 / 10)\n# print(n2)\n# print(" ")\n \n n3 = n - n1 *100 - n2*10\n# print(n3)\n# print(" ")\n \n if n1 == 9:\n n1 = 1\n elif n1 == 1:\n n1 = 9\n if n2 == 9:\n n2 = 1\n elif n2 == 1:\n n2 = 9\n if n3 == 9:\n n3 = 1\n elif n3 == 1:\n n3 = 9', '\n#\nn = int(input())\n\nif 111 <= n <1000:\n #main\n n1 = int (n / 100)\n# print(n1)\n# print(" ")\n \n n2 = n - (n1 *100)\n n2 = int (n2 / 10)\n# print(n2)\n# print(" ")\n \n n3 = n - n1 *100 - n2*10\n# print(n3)\n# print(" ")\n \n if n1 == 9:\n n1 = 1\n elif n1 == 1:\n n1 = 9\n if n2 == 9:\n n2 = 1\n elif n2 == 1:\n n2 = 9\n if n3 == 9:\n n1 = 1\n elif n3 == 1:\n n3 = 9\n\n nn = n1 *100 + n2*10 + n3\n\n print(nn)\n ', '\n#\nn = int(input())\n\nif 111 <= n <1000:\n #main\n n1 = int (n / 100)\n# print(n1)\n# print(" ")\n \n n2 = n - (n1 *100)\n n2 = int (n2 / 10)\n# print(n2)\n# print(" ")\n \n n3 = n - n1 *100 - n2*10\n# print(n3)\n# print(" ")\n \n if n1 == 9:\n n1 = 1\n elif n1 == 1:\n n1 = 9\n if n2 == 9:\n n2 = 1\n elif n2 == 1:\n n2 = 9\n if n3 == 9:\n n3 = 1\n elif n3 == 1:\n n3 = 9\n\n nn = n1 *100 + n2*10 + n3\n\n print(nn)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s024458971', 's126929185', 's714871985', 's987306474'] | [3064.0, 3064.0, 3188.0, 3060.0] | [17.0, 17.0, 19.0, 18.0] | [598, 551, 614, 605] |
p03242 | u573754721 | 2,000 | 1,048,576 | 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. | ['n=input()\n\nprint(n.replace("1","x").replace("9","1"),replace("x","9"))', 'n=input()\n\nprint(n.replace("1","x").replace("9","1").replace("x","9")) '] | ['Runtime Error', 'Accepted'] | ['s581269055', 's729189128'] | [2940.0, 2940.0] | [17.0, 17.0] | [70, 73] |
p03242 | u577579003 | 2,000 | 1,048,576 | 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. | ['n=input()\nswap=""\nfor i in n:\n if i=="1":\n swap+="9"\n elif i=="9":\n swap+="1"\n else:\n swap+=i\nprint(swap[-1::-1])\n', 'n=input()\nswap=""\nfor i in n:\n if i=="1":\n swap+="9"\n elif i=="9":\n swap+="1"\n else:\n swap+=i\nprint(swap)\n'] | ['Wrong Answer', 'Accepted'] | ['s631587176', 's581296199'] | [2940.0, 2940.0] | [17.0, 18.0] | [144, 136] |
p03242 | u586517439 | 2,000 | 1,048,576 | 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. | ['n = read()\n\narr = list(n)\noutput = ""\nfor e in arr\n if e == \'1\':\n output += \'9\'\n else:\n output += \'1\'\n\nprint(output)', 'n = input()\n \narr = list(n)\noutput = ""\nfor e in arr:\n if e == \'1\':\n output += \'9\'\n else:\n output += \'1\'\n \nprint(output)'] | ['Runtime Error', 'Accepted'] | ['s792810526', 's387701346'] | [2940.0, 2940.0] | [17.0, 17.0] | [124, 128] |
p03242 | u593005350 | 2,000 | 1,048,576 | 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. | ['N,x=map(int,input().split())\nl=list(map(int,input().split()))\nans=0\nl.sort()\n\nfor n in range(N):\n if n!=N-1:\n if l[n]<x:\n x-=l[n]\n ans+=1\n elif l[n]==x:\n x-=l[n]\n ans+=1\n break\n else:\n break\n else:\n if l[n]==x:\n x-=l[n]\n ans+=1\n else:\n break\n\nprint(ans)', 'N=int(input())\nn=list(map(int,str(N)))\nfor i in range(3):\n if n[i]==1:\n n[i]=9\n elif n[i]==9:\n n[i]=1\nprint(n[0]*100+n[1]*10+n[2])'] | ['Runtime Error', 'Accepted'] | ['s815450070', 's546330589'] | [3064.0, 3060.0] | [18.0, 17.0] | [393, 150] |
p03242 | u598684283 | 2,000 | 1,048,576 | 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. | ['line = list(input())\nj = 0\nprint(line)\nfor i in range(3):\n if line[j] == "1":\n line[j] = "9"\n else:\n line[j] = "1"\n j +=1\nprint(int(line[0] + line[1] + line[2]))', 'line = list(input())\nj = 0\nprint(line)\nfor i in range(3):\n if line[j] == "1":\n line[j] = "9"\n else:\n line[j] = "1"\n j +=1\nprint(line[0] + line[1] + line[2])', 'line = list(input())\nj = 0\nfor i in range(3):\n if line[j] == "1":\n line[j] = "9"\n else:\n line[j] = "1"\n j +=1\nprint(int(line[0] + line[1] + line[2]))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s112641101', 's128770525', 's188401561'] | [9092.0, 9088.0, 9140.0] | [30.0, 27.0, 26.0] | [184, 179, 172] |
p03242 | u600261652 | 2,000 | 1,048,576 | 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. | ['n = input()\nprint(n.replace("19", "91"))', 'n = input()\nprint(n.replace("1", "x").replace("9", "1").replace("x", "9"))'] | ['Wrong Answer', 'Accepted'] | ['s428100562', 's275762624'] | [3064.0, 2940.0] | [17.0, 17.0] | [40, 74] |
p03242 | u601082779 | 2,000 | 1,048,576 | 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. | ['print(1110-input())', 'print(1110-int(input()))'] | ['Runtime Error', 'Accepted'] | ['s736833189', 's147793642'] | [2940.0, 2940.0] | [17.0, 17.0] | [19, 24] |
p03242 | u603324902 | 2,000 | 1,048,576 | 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. | ['n = str(input())\n\nans = 0\nif n[0] == "1":\n ans += 900\nelse:\n ans += 100\n\nif n[0] == "1":\n ans += 90\nelse:\n ans += 10\n\nif n[0] == "1":\n ans += 9\nelse:\n ans += 1\n\nprint(ans)', 'n = str(input())\n\nans = 0\nif n[0] == "1":\n ans += 900\nelse:\n ans += 100\n\nif n[1] == "1":\n ans += 90\nelse:\n ans += 10\n\nif n[2] == "1":\n ans += 9\nelse:\n ans += 1\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s242862506', 's511754400'] | [2940.0, 2940.0] | [17.0, 17.0] | [189, 189] |
p03242 | u604412462 | 2,000 | 1,048,576 | 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. | ["num = str(input())\nfor i in range(3):\n if num[i] == '1':\n num[i] = '9'\n else:\n num[i] = '1':\nanswer = num[0]+num[1]+num[2]\nprint(int(answer))", "a = input()\nb = []\nfor i in range(3):\n if a[i] == '1':\n b.append('9')\n else:\n b.append('1')\nprint(''.join(b))"] | ['Runtime Error', 'Accepted'] | ['s318043659', 's785583057'] | [2940.0, 2940.0] | [19.0, 17.0] | [161, 129] |
p03242 | u611090896 | 2,000 | 1,048,576 | 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. | ["n = input()\nprint(n.replace('1','x').replace('9','1').replace('x','9')", "n = input()\nprint(n.replace('1','x').replace('9','1').replace('x','9'))\n"] | ['Runtime Error', 'Accepted'] | ['s024749751', 's287910610'] | [2940.0, 2940.0] | [17.0, 17.0] | [70, 72] |
p03242 | u611495846 | 2,000 | 1,048,576 | 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. | ['N = input()\n\nlist_N = list(N) \n#list_N = list(map(int,list_N))\nprint(list_N)\n\n\n\ndef swap(i):\n if i == "9":\n re = "1"\n elif i=="1":\n re = "9"\n return re\n\nswap_N = list(map(swap, list_N))\nprint(int("".join(swap_N)))', 'N = input()\n\nlist_N = list(N) \n#list_N = list(map(int,list_N))\nprint(list_N)\n\n\n\ndef swap(i):\n if i == "9":\n re = "1"\n elif i=="1":\n re = "9"\n return re\n\nswap_N = list(map(swap, list_N))\nprint("".join(swap_N))', 'N = input()\n#N=119\nlist_N = list(str((N)))\n#list_N = list(map(int,list_N))\n#print(list_N)\n\n\n\ndef swap(i):\n if i == "9":\n re = "1"\n elif i=="1":\n re = "9"\n return re\n\nswap_N = list(map(swap, list_N))\nprint(int("".join(swap_N)))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s162870198', 's165520162', 's793201293'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [309, 304, 323] |
p03242 | u612635771 | 2,000 | 1,048,576 | 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. | ['a = input()\nprint(a.replace("1", "9")+a.replace("9", "1"))', 'a = input()\nprint(a.replace("1", "2")+a.replace("9", "1") + a.replace("2", "9"))', 'a = input()\nprint(a.replace("1", "9") + a.replace("9", "1"))', 'a = input()\nprint(a.replace("1", "2").replace("9", "1").replace("2", "9"))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s381781959', 's608968990', 's981600645', 's744402145'] | [9028.0, 8908.0, 9024.0, 8976.0] | [27.0, 31.0, 25.0, 28.0] | [58, 80, 60, 74] |
p03242 | u617037231 | 2,000 | 1,048,576 | 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. | ["n = input()\ns = ''\nfor c in n:\n if c == '1':\n s += '9'\n else:\n \tif c == '9':\n \ts += '1'\n else:\n s += c\nprint(s)\n ", "n = input()\ns = ''\nfor c in n:\n if c == '1':\n s += '9'\n else:\n if c == '9':\n s += '1'\n else:\n s += c\nprint(s)"] | ['Runtime Error', 'Accepted'] | ['s805620633', 's153930411'] | [2940.0, 2940.0] | [17.0, 17.0] | [131, 134] |
p03242 | u617203831 | 2,000 | 1,048,576 | 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. | ['print(input()[::-1])', 'print("".join("9" if x=="1" else "1" for x in input()))'] | ['Wrong Answer', 'Accepted'] | ['s850393249', 's788156490'] | [2940.0, 2940.0] | [17.0, 17.0] | [20, 55] |
p03242 | u617225232 | 2,000 | 1,048,576 | 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. | ["a=input()\nfor i in RANGE(3):\n if a[i]=='1':\n a[i]='9'\n elif a[i]=='9':\n a[i]=='1'\nprint(a)\n", 'a=input()\nif int(a) <= int(a[0])*111:\n print(int(a[0])*111)\nelse:\n print((int(a[0])+1)*111)\n', "a=list(input())\nfor i in RANGE(3):\n if a[i]=='1':\n a[i]='9'\n elif a[i]=='9':\n a[i]='1'\nprint(a[0]+a[1]+a[2])\n", "a=list(input())\nfor i in range(3):\n if a[i]=='1':\n a[i]='9'\n elif a[i]=='9':\n a[i]='1'\nprint(a[0]+a[1]+a[2])\n"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s049022867', 's602422889', 's698171582', 's094810710'] | [2940.0, 3064.0, 3060.0, 2940.0] | [17.0, 17.0, 20.0, 17.0] | [99, 94, 117, 117] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.