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 | u620480037 | 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\nN=int(input())\nA=list(map(int,input().split()))\n\nA1=[]\nA2=[]\nfor i in range(len(A)):\n if i%2==0:\n A1.append(A[i])\n else:\n A2.append(A[i])\n \nB1=collections.Counter(A1)\nB2=collections.Counter(A2)\n\n\nif B1.most_common(2)[0][1]==B2.most_common(2)[0][1] and B1.most_common(2)[0][1]==int(N/2):\n print(int(N/2))\nelse:\n \n if B1.most_common(1)==B2.most_common(1):\n if B1.most_common(2)[1][1]>=B2.most_common(2)[1][1]:\n ans=N-B1.most_common(2)[1][1]-B2.most_common(2)[0][1]\n else:\n ans=N-B2.most_common(2)[1][1]-B1.most_common(2)[0][1]\n elif B1.most_common(2)[0][0]==B2.most_common(2)[0][0]:\n if B1.most_common(2)[0][1]>=B1.most_common(2)[0][1]:\n ans=N-B1.most_common(2)[0][1]-B2.most_common(2)[1][1]\n else:\n ans=N-B2.most_common(2)[0][1]-B1.most_common(2)[1][1]\n else:\n ans=N-B1.most_common(2)[0][1]-B2.most_common(2)[0][1]\n print(ans)', 'n=input()\nN=[]\nfor i in range(3):\n N.append(n[i])\nfor j in range(3):\n if N[j]=="1":\n N[j]="9"\n else:\n N[j]="1"\nprint("".join(N))'] | ['Runtime Error', 'Accepted'] | ['s653798712', 's233713911'] | [3316.0, 2940.0] | [21.0, 17.0] | [968, 151] |
p03242 | u620846115 | 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())\nprint(100*(10-n[0])+10*(10-n[1])+10-n[2])', 'n=input()\nprint(100*(10-n[0])+10*(10-n[1])+10-n[2])', 'n = input()\nn = n.replace("9","4").replace("1","9").replace("4","1")\nprint(n)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s583614374', 's951811978', 's079486786'] | [9100.0, 8944.0, 9084.0] | [30.0, 29.0, 26.0] | [56, 51, 77] |
p03242 | u623065116 | 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 = input()\n\ntrue_num = []\nif \'1\' in n or \'9\' in n:\n for i in range(3):\n if n[i] == \'1\' :\n true_num.append(\'9\')\n elif n[i] == "9":\n true_num.append(\'1\')\n else:\n true_num.append(n[i])\n print(true_num)\nelse:\n print(n)\n', 'n = input()\n \nn = n.replace("1","x")\nn = n.replace("9","1")\nn = n.replace("x","9")\n \nprint(n)\n'] | ['Wrong Answer', 'Accepted'] | ['s074620541', 's109471053'] | [2940.0, 2940.0] | [17.0, 17.0] | [281, 94] |
p03242 | u623601489 | 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 main(n:int,lst:list)->int:\n b = True\n lst1 = []\n lst2 = []\n for e in lst:\n if b:\n lst1.append(e)\n else:\n lst2.append(e)\n b = not b\n lst1.sort()\n lst2.sort()\n c1 = [["",0],0]\n c2 = [["",0],0]\n last =lst1[0]\n a = 0\n for e in lst1:\n if last == e:\n a +=1\n else:\n if a >= c1[0][1]:\n c1[1] = c1[0][1]\n c1[0][0] = e\n c1[0][1] = a\n elif a > c1[1]:\n c1[1] = a\n last = e\n a = 1\n if a >= c1[0][1]:\n c1[1] = c1[0][1]\n c1[0][0] = e\n c1[0][1] = a\n elif a > c1[1]:\n c1[1] = a\n\n last =lst2[0]\n a = 0\n for e in lst2:\n if last == e:\n a +=1\n else:\n if a >= c2[0][1]:\n c2[1] = c2[0][1]\n c2[0][0] = e\n c2[0][1] = a\n elif a > c2[1]:\n c2[1] = a\n last = e\n a = 1\n if a >= c2[0][1]:\n c2[1] = c2[0][1]\n c2[0][0] = e\n c2[0][1] = a\n elif a > c2[1]:\n c2[1] = a\n\n if c1[0][0] == c2[0][0]:\n if c1[0][1] > c2[0][1] or(c1[0][1] == c2[0][1] and c2[1] > c1[1]):\n return n - c1[0][1] - c2[1]\n else:\n return n - c2[0][1] - c1[1]\n else:\n return n - c1[0][1] - c2[0][1]\n\nn = int(input())\nlst = input().split()\nprint(main(n,lst))\n', 'import collections\ndef main(n:int,lst:list)->int:\n b = True\n lst1 = []\n lst2 = []\n for e in lst:\n if b:\n lst1.append(e)\n else:\n lst2.append(e)\n b = not b\n c1 = collections.Counter(lst1).most_common()\n c2 = collections.Counter(lst2).most_common()\n if c1[0][0] == c2[0][0]:\n if c1[0][1] > c2[0][1]:\n if len(c2) == 1:\n return n - c1[0][1]\n else:\n return n - c1[0][1] - c2[1][1]\n else:\n if len(c1) == 1:\n return n - c2[0][1]\n else:\n return n - c2[0][1] - c1[1][1]\n else:\n return n - c1[0][1] - c2[0][1]\n\nn = int(input())\nlst = list(map(int,input().split()))\nprint(main(n,lst))\n', 'print(input().replace("1","a").replace("9","1").replace("a","9"))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s569886891', 's886025806', 's454678392'] | [3192.0, 3316.0, 2940.0] | [18.0, 21.0, 18.0] | [1454, 765, 66] |
p03242 | u625554679 | 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 = [int(aa) for aa in input().split()]\n\ndef add_entry(hist, aa):\n if aa in hist:\n hist[aa] += 1\n else:\n hist[aa] = 1\n\n\ndef make_hist(a):\n even_hist = {}\n odd_hist = {}\n\n for i in range(len(a)//2):\n add_entry(even_hist, a[2*i])\n add_entry(odd_hist, a[2*i+1])\n\n return even_hist, odd_hist\n\n\ndef get_sorted_hist(hist):\n return sorted(hist.items(), key=lambda x: -x[1])\n\neh, oh = make_hist(a)\nseh = get_sorted_hist(eh)\nsoh = get_sorted_hist(oh)\n\nprint(seh, soh)\n\nif seh[0][0] != soh[0][0]:\n print(len(a) - seh[0][1] - soh[0][1])\nelse:\n if len(seh) == 1 and len(soh) == 1:\n print(len(a)//2)\n elif len(seh) == 1:\n print(len(a) - seh[0][1] - soh[1][1])\n elif len(soh) == 1:\n print(len(a) - soh[0][1] - seh[1][1])\n else:\n print(min(len(a) - seh[0][1] - soh[1][1], len(a) - soh[0][1] - seh[1][1]))\n', 'n = input()\n\nans = ""\nfor nn in n:\n if nn == "1":\n ans += "9"\n elif nn == "9":\n ans += "1"\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s574609269', 's747879390'] | [3188.0, 2940.0] | [18.0, 17.0] | [899, 123] |
p03242 | u626337957 | 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 elif N[i] == '9':\n N[i] == '1'\nprint(N)", "N = input()\nS = ''\nfor i in range(3):\n if N[i] == '1':\n S += '9'\n elif N[i] == '9':\n S += '1'\n else:\n S += N[i]\nprint(S)\n"] | ['Runtime Error', 'Accepted'] | ['s499206704', 's106761207'] | [2940.0, 2940.0] | [17.0, 17.0] | [108, 133] |
p03242 | u628583308 | 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\n\nn = input()\n\nprint(n.replace('1','9').replace('9','1'))\n", "#coding:utf-8\n\n\nn = input()\nresult = ''\n\nfor i in n:\n if i=='9':\n result+='1'\n elif i=='1':\n result +='9'\n\nprint(result) \n"] | ['Wrong Answer', 'Accepted'] | ['s409776933', 's130280755'] | [2940.0, 2940.0] | [17.0, 18.0] | [72, 149] |
p03242 | u634461820 | 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 ans in range(111, 1000, 111):\n if n <= ans:\n break\nprint(ans)\n', "s.replace('1','a')\ns.replace('9','1')\ns.replace('a','9')\nprint(str(n))\n", 'n = int(input())\nn = n.replace("1"," ").replace(\'9\',\'1\').replace(\' \',\'9\')\nprint(n)\n', 'n = input()\nn = n.replace("1"," ").replace(\'9\',\'1\').replace(\' \',\'9\')\nprint(n)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s173893509', 's228904499', 's350498164', 's999253828'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [88, 71, 83, 78] |
p03242 | u636492122 | 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 = list(n)\nif n[0] == "1":\n print(9, end=\'\')\nif n[1] == str(1):\n print(9, end="")\nif n[2] == str(1):\n print(9, end="")\nif n[0] == str(9):\n print(1, end="")\nif n[1] == str(9):\n print(1, end="")\nif n[2] == str(9):\n print(1, end="")\n', 'n = input()\nn = list(n)\nif n[0] == "1":\n print(9, end=\'\')\nif n[0] == str(9):\n print(1, end="")\nif n[1] == str(1):\n print(9, end="")\nif n[1] == str(9):\n print(1, end="")\nif n[2] == str(1):\n print(9)\nif n[2] == str(9):\n print(1)\n'] | ['Wrong Answer', 'Accepted'] | ['s114718873', 's946438135'] | [3064.0, 3064.0] | [17.0, 17.0] | [261, 245] |
p03242 | u638902622 | 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 sys import stdin\n\nn = stdin.readline().rstrip()\n\nlist = []\nfor i in range(3):\n list.append(n[i])\n\nif list[0] == '1':\n list[0] = '9'\nif list[1] == '1':\n list[1] = '9'\nif list[2] == '1':\n list[2] = '9'\n\nans = ''.join(list)\n\nprint(ans)\n", "import sys\nIS = lambda: sys.stdin.readline().rstrip()\nII = lambda: int(IS())\nMII = lambda: list(map(int, IS().split()))\n\ndef split_even_or_odd(vv, n, start):\n res = {}\n for i in range(start,n,2):\n v = vv[i]\n if not v in res.keys(): res[v] = 1\n else: res[v] += 1\n return res\n\ndef find_fs(target):\n maxk1 = maxv1 = 0\n for k, v in target.items():\n if maxv1 < v:\n maxk1, maxv1 = k, v\n maxk2 = maxv2 = 0\n for k, v in target.items():\n if maxv2 < v and maxk1 != k:\n maxk2, maxv2 = k, v\n return (maxk1, maxv1), (maxk2, maxv2)\n\ndef main():\n n = II()\n vv = MII()\n ee = split_even_or_odd(vv, n, 0)\n oo = split_even_or_odd(vv, n, 1)\n\n e1kv, e2kv = find_fs(ee)\n o1kv, o2kv = find_fs(oo)\n\n minv = 10**5\n if e1kv[0] != o1kv[0]:\n minv = min(minv, n - (e1kv[1] + o1kv[1]))\n else:\n minv = min(minv, n - (e1kv[1] + o2kv[1]))\n minv = min(minv, n - (e2kv[1] + o1kv[1]))\n print(minv)\n\nif __name__ == '__main__':\n main()\n", "from sys import stdin\n\nn = stdin.readline().rstrip()\n\nlist = []\nfor i in range(3):\n list.append(n[i])\n\nif list[0] == '1':\n list[0] = '9'\nelse:\n list[0] = '1'\nif list[1] == '1':\n list[1] = '9'\nelse:\n list[1] = '1'\nif list[2] == '1':\n list[2] = '9'\nelse:\n list[2] = '1'\n\nans = ''.join(list)\n\nprint(ans)\n"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s458036692', 's476677713', 's288880765'] | [3060.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [250, 1033, 322] |
p03242 | u639592190 | 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())\nS=[if s=="1" s="9" else s="1" for s in S]\nprint(S)', 'S=input()\nans=""\nfor s in S:\n if s=="1":ans+="9"\n else:ans+="1"\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s813702971', 's906981023'] | [2940.0, 2940.0] | [17.0, 20.0] | [66, 76] |
p03242 | u641460756 | 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,b,c=map(int,list(input(),split()))\nif a==1:\n a=9\nelif a==9:\n a=1\nif b==1:\n b=9\nelif b==9:\n b=1\nif c==1:\n c=9\nelif c==9:\n c==1\nprint({}{}{}.format(a,b,c))', 'a=str(input())\nb=int(a[0])\nc=int(a[1])\nd=int(a[2])\nif b==1:\n b="9"\nelif b==9:\n b="1"\nif c==1:\n c="9"\nelif c==9:\n c="1"\nif d==1:\n d="9"\nelif d==9:\n d=="1"\ne=int(b+c+d)\nprint(e)', 'a=int(input())\nprint(1110-a)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s010016655', 's760039605', 's545514147'] | [2940.0, 3060.0, 2940.0] | [18.0, 17.0, 17.0] | [161, 181, 28] |
p03242 | u648212584 | 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()\n \nss = ""\nfor i in s:\n if s == "1"\n \tss += "9"\t\n else:\n ss += "1"\n \nprint(ss)', 's = input()\n\nss = ""\nfor i in range(len(S)):\n if s[i] == "1"\n \tss += "9"\t\n else:\n ss += "1"\n \nprint(ss)', 's = input()\n \nss = ""\nfor i in s:\n if s == "1"\n \t\tss += "9"\t\n else:\n \tss += "1"\n \nprint(ss)', 's = input()\n \nss = ""\nfor i in range(len(s)):\n if s[i] == "1"\n \tss += "9"\t\n else:\n ss += "1"\n \nprint(ss)', 's = input()\n \nss = ""\nfor i in s:\n if s[i] == "1":\n \tss += "9"\t\n else:\n ss += "1"\n \nprint(ss)\n', 's = input()\n \nss = ""\nfor i in s:\n if s == "1":\n \tss += "9"\t\n else:\n ss += "1"\n \nprint(ss)', 'from corections import Counter \nn = int(input())\nv = list(map(int,input().split()))\n \nodd = []\neven = []\nfor i in range(n//2):\n\todd.append(v[2*i+1])\n\teven.append(v[2*i])\n \nodd = sorted(odd)\neven = sorted(even)\nac = Counter(odd).most_common(2)\nbc = Counter(even).most_common(2)\ndef cnt(X):\n\tcount = 0\n\tans = 0\n\tfor i in range(len(X)-1):\n\t\tif X[i+1] == X[i]:\n\t\t\tcount += 1\n\t\t\tans = max(ans,count)\n\t\telse:\n\t\t\tcount = 0\n\treturn ans+1\n \nif ac[0][0] != bc[0][0]:\n print(len(v)-cnt(odd)-cnt(even))\nelif len(ac) == 1 and len(bc) == 1:\n\tprint(n//2)\nelse:\n\tprint(n-max(ac[0][1]+bc[1][1],ac[1][1]+bc[0][1]))', 's = input()\n \nss = ""\nfor i in range(len(s)):\n if s[i] == "1":\n \tss += "9"\t\n else:\n ss += "1"\n \nprint(ss)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s105602599', 's141025013', 's303577380', 's320392375', 's607261827', 's623723611', 's961356494', 's613210187'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3064.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0, 17.0] | [98, 112, 100, 113, 103, 99, 608, 115] |
p03242 | u654536970 | 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. | ['snk = input()\n\nsnk = snk.replace("1", "a").replace("9", "b")\nprint(int(snk.replace("a", "9").replace("b", "9")))', 'snk = input()\n\nprint(int(snk.replace("1", "9").replace("9", "1")))', 'snk = input()\n\nsnk = snk.replace("1", "a").replace("9", "b")\nprint(int(snk.replace("a", "9").replace("b", "1")))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s192622077', 's617646422', 's187081163'] | [2940.0, 2940.0, 2940.0] | [21.0, 18.0, 17.0] | [112, 66, 112] |
p03242 | u661455670 | 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()\nnum = int(n)\nans = 0\nfor digit in range(1,10):\n if int(num/digit) == 111:\n ans = num\n break\n elif int(num/digit) < 111:\n ans = digit*100+digit*10+digit\n break\nprint(str(ans))', 'n = input()\nnum = int(n)\nans = 0\nfor digit in range(1,10):\n if int(num/digit) == 111:\n ans = num\n break\n elif int(num/digit) < 111:\n ans = digit*100+digit*10+digit\n break\nprint(ans)', 'n = input()\nans = n.replace("1", "2")\nans = ans.replace("9","1")\nans = ans.replace("2","9")\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s099377901', 's275133275', 's306633841'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [220, 215, 102] |
p03242 | u665038048 | 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())\nif n==111:\n print(999)\nif n==119:\n prit(991)\nif n==191:\n print(919)\nif n==199:\n print(911)\nif n==911:\n print(199)\nif n==919:\n print(191)\nif n==991:\n print(119)\nif n==999:\n print(111)\n', "n = input()\nn = n.replace('1', '#')\nn = n.replace('9', '1')\nn = n.replace('#', '9')\nprint(int(n))"] | ['Runtime Error', 'Accepted'] | ['s593991933', 's323298493'] | [2940.0, 2940.0] | [17.0, 17.0] | [222, 97] |
p03242 | u666844906 | 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 = i + 1\nelse:\n i = 1\nprint(i*111)\n', "n = input()\nprint(n.replace('1', 'x').replace('9', '1').replace('x', '9'))"] | ['Wrong Answer', 'Accepted'] | ['s688741658', 's045443427'] | [2940.0, 2940.0] | [17.0, 17.0] | [88, 74] |
p03242 | u667469290 | 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 -*-\ndef solve():\n #n = input()\n n = '999'\n n = n.replace('1', '.')\n n = n.replace('9', '1')\n n = n.replace('.', '9')\n res = n\n return str(res)\n\nif __name__ == '__main__':\n print(solve())\n\n", 'print(1110-int(input()))'] | ['Wrong Answer', 'Accepted'] | ['s032148196', 's169906823'] | [2940.0, 2940.0] | [17.0, 17.0] | [232, 24] |
p03242 | u670567845 | 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 n:\n if n[i] == '1':\n ans += '9'\n elif n[i] == '9':\n n[i] += '1'\n else:\n ans += n[i]\nprint(ans)", "n = input()\nans = []\nfor i in range(len(n)):\n if n[i] == '1':\n ans.append('9')\n elif n[i] == '9':\n ans.append('1')\n else:\n ans.append(n[i])\nprint(''.join(ans))"] | ['Runtime Error', 'Accepted'] | ['s255989403', 's374656850'] | [3060.0, 2940.0] | [17.0, 17.0] | [154, 189] |
p03242 | u671211357 | 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]=="0":\n ans.append(9)\n else:\n ans.append(0)\nprint(*ans,sep="")', 'N=input()\nans=[]\nfor i in range(len(N)):\n if N[i]=="1":\n ans.append(9)\n else:\n ans.append(1)\nprint(*ans,sep="")\n'] | ['Wrong Answer', 'Accepted'] | ['s773411648', 's466713683'] | [9092.0, 8952.0] | [28.0, 25.0] | [119, 120] |
p03242 | u671446913 | 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())\nvlist = list(map(int, input().split(" ")))\n\nhead = vlist[::2]\nfoll = vlist[1::2]\n\nimport collections\nch = collections.Counter(head).most_common()\ncf = collections.Counter(foll).most_common()\n\nh_ = ch[0]\nf_ = cf[0]\n\nif h_[0] == f_[0]:\n #if h_[1] == f_[1]:\n # if h_[0] == vlist[0]:\n # f_ = (-1.1, 0)\n # else:\n # h_ = (-1.1, 0)\n if h_[1] > f_[1]:\n if len(cf) != 1:\n f_ = cf[1]\n else:\n f_ = (-1.1, 0)\n else:\n if len(ch) != 1:\n h_ = ch[1]\n else:\n h_ = (-1.1, 0)\n\ncount = 0\nfor i in range(len(vlist)):\n if i % 2 == 0 and vlist[i] != h_[0]:\n count += 1\n if i % 2 == 1 and vlist[i] != f_[0]:\n count += 1\n\nprint(count)', 'import collections\n\nn = int(input())\nvlist = list(map(int, input().split(" ")))\n\nimport collections\nc = collections.Counter(vlist)\n\nhead = c.most_common()[0][0]\nif c.most_common()[0][1] == n:\n foll = -1\nelse:\n foll = c.most_common()[1][0]\n\n\nfor i in range(len(vlist)):\n if vlist[i] == head:\n break\n if vlist[i] == foll:\n head, foll == foll, head\n break\n\ncount = 0\nfor i in range(len(vlist)):\n if i % 2 == 0 and vlist[i] != head:\n count += 1\n if i % 2 == 1 and vlist[i] != foll:\n count += 1\n\nprint(count)', 'n = int(input())\nvlist = list(map(int, input().split(" ")))\n\nhead = vlist[::2]\nfoll = vlist[1::2]\n\nimport collections\nch = collections.Counter(head).most_common()\ncf = collections.Counter(foll).most_common()\n\nh_ = ch[0]\nf_ = cf[0]\n\nif h_[0] == f_[0]:\n if h_[1] > f_[1]:\n if len(cf) != 1:\n f_ = cf[1]\n else:\n f_ = (-1.1, 0)\n else:\n if len(ch) != 1:\n h_ = ch[1]\n else:\n h_ = (-1.1, 0)\nelif h_[1] == f_[1]:\n if h_[0] == vlist[0]:\n f_ = (-1.1, 0)\n else:\n h_ = (-1.1, 0)\n\ncount = 0\nfor i in range(len(vlist)):\n if i % 2 == 0 and vlist[i] != h_[0]:\n count += 1\n if i % 2 == 1 and vlist[i] != f_[0]:\n count += 1\n\nprint(count)', 'intput_ = list(input())\noutput = ""\nfor s_ in intput_:\n if s_ == \'1\':\n output += "9"\n elif s_ == \'9\':\n output += "1"\n else:\n output += s_\n\nprint(output)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s119767357', 's541054370', 's908884058', 's260975479'] | [3064.0, 3316.0, 3064.0, 2940.0] | [18.0, 21.0, 17.0, 17.0] | [759, 556, 736, 164] |
p03242 | u672898046 | 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. | ['w = input()\nc = ""\nfor i in w:\n if i == "9":\n i = 1\n c += i\n elif i == "1":\n i == 9\n c += i\n else:\n c += i\nprint(c)', 'w = input()\nc = ""\nfor i in w:\n if i == "9":\n i = 1\n c += i\n elif i == "1":\n i == 9\n c += i\n else:\n c += i\nprint(i)', 'w = input()\nc = ""\nfor i in w:\n if i == "9":\n i = "1"\n c += i\n elif i == "1":\n i = "9"\n c += i\nprint(c)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s658438538', 's940548787', 's069031278'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0] | [133, 133, 117] |
p03242 | u673338219 | 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())\nm = ""\nfor i in range(2):\n if n[i] == "9":\n m += "1"\n elif n[i] == "1":\n m += "9"\n else:\n m += n[i] \nprint(int(m))', 'n = str(input())\nm = ""\nfor i in range(3):\n if n[i] == "9":\n m += "1"\n elif n[i] == "1":\n m += "9"\n else:\n m += n[i] \nprint(int(m))'] | ['Wrong Answer', 'Accepted'] | ['s225512725', 's009642174'] | [2940.0, 3060.0] | [17.0, 17.0] | [143, 143] |
p03242 | u681110193 | 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]==1:s[i]=9\n elif s[i]==9:s[i]=1\nprint(s)', 's=list(input())\nfor i in range(3):\n if s[i]=="1":\n s[i]="9"\n else :s[i]="1"\na=s[0]+s[1]+s[2]\nprint(a)\n'] | ['Wrong Answer', 'Accepted'] | ['s989312094', 's966368704'] | [2940.0, 2940.0] | [17.0, 17.0] | [79, 107] |
p03242 | u691018832 | 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('9', '1').replace('1', '9'))", "s = input()\n\nans = s.translate(str.maketrans({'9':'1', '1':'9'}))\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s705998186', 's768678261'] | [2940.0, 2940.0] | [17.0, 17.0] | [56, 76] |
p03242 | u691896522 | 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 elif n[i] == '9':\n n[i] = '1'\nprint(n)\n", "n = 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'\nprint(n)\n", "n = 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'\nprint(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\'\nprint("".join(n))\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s222599440', 's261960332', 's458093266', 's812814324'] | [2940.0, 3064.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 18.0] | [113, 114, 111, 128] |
p03242 | u693933222 | 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())\nNA = int(input())\nNX = NA.split(" ")\nNW = []\nfor i in range (1,N+1):\n Ni = int(NX.count(i))\n NW.append(Ni)\nNN = NW.sort()\nprint(NW)\nS = 0\nfor x in range (0,N-2):\n S = S + NW[x]\nprint(S)', 'X = input()\nXn = X.replace("1","N")\nXo = Xn.replace("9","1")\nprint(Xo.replace("N","9"))\n'] | ['Runtime Error', 'Accepted'] | ['s998687743', 's237482366'] | [3060.0, 2940.0] | [17.0, 17.0] | [211, 88] |
p03242 | u696486967 | 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 elif s[i]=="9":\n s[i]="1"\n\nprint(s)', 's=input()\nt=s.replace("9","2")\nu=t.replace("1","3")\nv=u.replace("2","1")\nw=v.replace("3","9")\n\nprint(w)'] | ['Runtime Error', 'Accepted'] | ['s587320367', 's662057253'] | [2940.0, 2940.0] | [17.0, 17.0] | [103, 103] |
p03242 | u698501671 | 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)", "n = input\nans - ''\nfor i in range(len(n)):\n if n[i] == '1':\n ans += '9'\n else ans += '1'\nprint(ans)", "n = input()\nans = ''\nfor i in range(3):\n if n[i] == '1':\n ans += '9'\n else :\n ans += '1'\nprint(ans)"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s078785981', 's526328567', 's768951430', 's775408922'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [122, 122, 112, 119] |
p03242 | u698538366 | 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())\nl1=[1,2,3,4,5,6,7,8,9]\nx=111\nfor i in l1:\n if(i*x>=n):\n print(i*x)\n break', "n=int(input())\ns=str(n)\nl=list(s)\nl1=[]\nfor i in l:\n if(i=='1'):\n l1.append('9')\n elif(i=='9'):\n l1.append('1')\n else:\n l1.append(i)\nprint(''.join(l1))"] | ['Wrong Answer', 'Accepted'] | ['s323420692', 's005051632'] | [2940.0, 3060.0] | [17.0, 17.0] | [105, 181] |
p03242 | u700499791 | 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()\ncha = list(s)\nanswer = []\nfor hoge in int_cha:\n if hoge == '1':\n answer.append('9')\n else:\n answer.append('1')\nprint(''.join(answer))", "s = input()\ncha = list()\nanswer = []\nfor hoge in int_cha:\n if hoge == '1':\n answer.append('9')\n else:\n answer.append('1')\nprint(''.join(answer))\n", "s = input()\ncha = list(s)\nanswer = []\nfor hoge in cha:\n if hoge == '1':\n answer.append('9')\n else:\n answer.append('1')\nprint(''.join(answer))\n"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s401872458', 's813381990', 's695321636'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [153, 153, 150] |
p03242 | u701318346 | 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\nn.replace('1', 'w')\nn.replace('9', '1')\nn.replace('w', '9')\n\nprint(n)", "S = list(input())\n\nfor i in range(3):\n if S[i] == '1':\n S[i] = '9'\n else:\n S[i] = '1'\n\nprint(''.join(S))"] | ['Wrong Answer', 'Accepted'] | ['s223674584', 's343073994'] | [2940.0, 2940.0] | [17.0, 17.0] | [82, 124] |
p03242 | u702018889 | 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())\nfor i in range(100,1000):\n if i >= n and i%100//10 == i%10 == i//100:\n print(i)\n break', 'n=list(input())\nfor i in range(len(n)):\n if n[i]=="1":\n n[i]="9"\n else:\n n[i]="1"\nprint("".join(n))'] | ['Wrong Answer', 'Accepted'] | ['s359352104', 's902428929'] | [9160.0, 2940.0] | [27.0, 17.0] | [118, 119] |
p03242 | u703890795 | 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.replace('1', 'x')\nn.replace('9', '1')\nn.replace('x', '9')\nprint(int(n))", "n = input()\nn.replace('1', 'x')\nn.replace('9', '1')\nn.replace('x', '9')\nprint(n)", 'n = str(input())\nn = n.replace("1", "x")\nn = n.replace(\'9\', \'1\')\nn = n.replace(\'x\', \'9\')\nprint(int(n))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s426728015', 's647997252', 's627844875'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [85, 80, 102] |
p03242 | u705418271 | 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())\nalist = list(map(int,input().split()))\nlist1 = alist[1::2]\nlist2 = alist[0::2]\nfrom collections import Counter\ndic1 = Counter(list1).most_common()\ndic2 = Counter(list2).most_common()\n\nif dic1[0][0]!=dic2[0][0]:\n print(n - dic1[0][1] - dic2[0][1]+1)\nelse:\n print(min(n - dic1[0][1] - dic2[1][1]+1, n -dic1[1][1] - dic2[0][1]+1))', 'a=input()\nprint(a,replace("1","x").replace("9","1").replace("x","9"))', 'a=input()\nprint(a.replace("1","x").replace("9","1").replace("x","9"))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s276822951', 's624594863', 's944214201'] | [9060.0, 8936.0, 9020.0] | [26.0, 25.0, 26.0] | [347, 69, 69] |
p03242 | u706775459 | 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=int(n)\nprint(111*(int(n/111)+1))', 'n=input()\nn=int(n)\nnf= n%10\nns = (n-nf)%100\nnt = n-nf-ns\n\nif nf==1 :\n nf=9\nelif nf==9:\n nf=1\n\n\nif ns==10 :\n ns=90\nelif ns==90:\n ns=10\n\n\nif nt==100:\n nt=900\nelif nt==900:\n nt=100\n \nn=nf+ns+nt\n\n\nprint(n)'] | ['Wrong Answer', 'Accepted'] | ['s706521194', 's494259617'] | [2940.0, 3060.0] | [17.0, 17.0] | [44, 223] |
p03242 | u711295009 | 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())\nnumberL = list(map(int, input().split()))\n \nkisuuSyuL=[]\nkisuuKosuL=[]\nkisuuKosuL2=[]\ngusuSyuL=[]\ngusuKosuL=[]\ngusuKosuL2=[]\n \nindex=0\nwhile index<n:\n if index==0:\n gusuSyuL.append(numberL[index])\n gusuKosuL.append(1)\n gusuKosuL2.append(1)\n elif index==1:\n kisuuSyuL.append(numberL[index])\n kisuuKosuL.append(1)\n kisuuKosuL2.append(1)\n else:\n if index%2==0:\n if numberL[index] in gusuSyuL:\n tarI = gusuSyuL.index(numberL[index])\n gusuKosuL[tarI]+=1\n gusuKosuL2[tarI]+=1\n else:\n gusuSyuL.append(numberL[index])\n gusuKosuL.append(1)\n gusuKosuL2.append(1)\n else:\n if numberL[index] in kisuuSyuL:\n tarI = kisuuSyuL.index(numberL[index])\n kisuuKosuL[tarI]+=1\n kisuuKosuL2[tarI]+=1\n else:\n kisuuSyuL.append(numberL[index])\n kisuuKosuL.append(1)\n kisuuKosuL2.append(1)\n index+=1\n\n \nif len(kisuuSyuL)==1 and len(gusuSyuL)==1:\n if kisuuSyuL[0]==gusuSyuL[0]:\n print(int(n/2))\n else:\n print(0)\nelse:\n kiIndex = kisuuKosuL.index(max(kisuuKosuL))\n guIndex = gusuKosuL.index(max(gusuKosuL))\n if kisuuSyuL[kiIndex]!=gusuSyuL[guIndex]:\n noC=max(kisuuKosuL)+max(gusuKosuL)\n print(n-noC)\n else:\n if max(kisuuKosuL) < max(gusuKosuL):\n kisuuKosuL.sort()\n noC=kisuuKosuL[len(kisuuKosuL)-1]+max(gusuKosuL)\n print(n-noC)\n else:\n gusuKosuL.sort()\n noC=gusuKosuL[len(gusuKosuL)-1]+max(kisuuKosuL)\n print(n-noC)', 'listN = list(str(input()))\n\nindex=0\nwhile index < 3:\n if listN[index] == "1":\n listN[index]="9"\n elif listN[index]=="9":\n listN[index]="1"\n index+=1\n\nprint(listN[0]+listN[1]+listN[2])'] | ['Runtime Error', 'Accepted'] | ['s652645700', 's835280815'] | [3188.0, 2940.0] | [18.0, 17.0] | [1720, 206] |
p03242 | u716530146 | 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()\nl=[1,9]\nfor i in n:\n print(l[l.index(i)-1],end='')\nprint()\n ", "n=input()\nl=[1,9]\nfor i in n:\n print(l[l.index(i)-1],end='')\nprint()\n n=input()\nl=['1','9']\nfor i in n:\n print(l[l.index(i)-1], end = '')\nprint()\n ", "#!/usr/bin/env python3\nn=input()\nl=['1','9']\nfor i in n:\n print(l[l.index(i)-1], end = '')\nprint()\n "] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s287733097', 's750767582', 's255280317'] | [2940.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [76, 159, 106] |
p03242 | u716649090 | 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=list(input())\nfor i in range(len(a)):\n if a[i]=="1":\n a[i]="9"\n else:\n a[i]="1"\nprint(*a)', 'a=list(input())\nfor i in range(len(a)):\n if a[i]=="1":\n a[i]="9"\n else:\n a[i]="1"\nprint(*a,sep="")'] | ['Wrong Answer', 'Accepted'] | ['s754089167', 's080406699'] | [2940.0, 2940.0] | [18.0, 17.0] | [99, 106] |
p03242 | u716660050 | 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())\ns=''\nfor i in n: s=s+'1' if i=='9' else '9'\nprint(s)", "n=list(input())\ns=''\nfor i in n: s= s + ('1' if i=='9' else '9')\nprint(s)"] | ['Wrong Answer', 'Accepted'] | ['s261636486', 's590405897'] | [2940.0, 2940.0] | [19.0, 18.0] | [68, 73] |
p03242 | u723304131 | 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_letters = str(n)\n\nfor i in n_letters:\n if n_letters[i] == "1":\n n_letters[i] = "9"\n elif n_letters[i] == "9":\n n_letters[i] = "1"\n', 'n = int(input())\n\nn_letters = str(n)\n\nfor i in range(len(n_letters)):\n if n_letters[i] == "1":\n n_letters[i].replace("1","9")\n elif n_letters[i] == "9":\n n_letters[i].replace("9","1")\n print(n_letters[i])\n\nprint(int(n_letters))\n', "n = input()\nans = []\nfor i in range(len(n)):\n if n[i] == '1':\n ans.append('9')\n elif n[i] == '9':\n ans.append('1')\n\nprint(''.join(ans))"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s208424458', 's867371879', 's587029191'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [170, 251, 155] |
p03242 | u724184343 | 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 numpy as np\n\nx = input()\nx = str(x)\ny = 0\nfor i in range(len(x)):\n if x[i] == '1':\n y = y + 9 * (10 ** i)\n else:\n y = y + 1 * (10 ** i)\nprint(y)", "import numpy as np\n\nx = input()\nx = str(x)\ny = 0\nz = len(x)\nfor i in range(z):\n if x[i] == '1':\n y = y + 9 * (10 ** (z - i - 1))\n else:\n y = y + 1 * (10 ** (z - i - 1))\nprint(y)"] | ['Wrong Answer', 'Accepted'] | ['s085701439', 's162610921'] | [21692.0, 21156.0] | [1258.0, 1546.0] | [159, 185] |
p03242 | u729119068 | 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().replace('1','x').replace('9','1').replace('x',9)\nprint(S)", "S=input().replace('1','x').replace('9','1').replace('x','9')\nprint(S)"] | ['Runtime Error', 'Accepted'] | ['s471426499', 's877279233'] | [9008.0, 9012.0] | [21.0, 27.0] | [67, 69] |
p03242 | u729133443 | 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(''.join(map(lambda x:{'1':'9','9':'1'}[x],input().split())))", "print(''.join(map(lambda x:{'1':'9','9':'1'}[x],input())))"] | ['Runtime Error', 'Accepted'] | ['s655166936', 's667056600'] | [2940.0, 2940.0] | [18.0, 17.0] | [66, 58] |
p03242 | u731028462 | 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. | ['"".join(list(map(lambda x: "9" if x=="1" else "1", input())))', 'print("".join(list(map(lambda x: "9" if x=="1" else "1", input()))))'] | ['Wrong Answer', 'Accepted'] | ['s382558164', 's985297179'] | [2940.0, 2940.0] | [17.0, 17.0] | [61, 68] |
p03242 | u732870425 | 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.translate(str.maketrans({"1":"9", "9":"1"}))', 'n = input()\n\nprint(n.translate(str.maketrans({"1":"9", "9":"1"})))'] | ['Runtime Error', 'Accepted'] | ['s427050637', 's258474394'] | [2940.0, 2940.0] | [19.0, 18.0] | [65, 66] |
p03242 | u733774002 | 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().split()\nans = n.replace("1", "a")\nans = n.replace("9", "1")\nans = n.replace("a", "9")\nprint(int(ans))', 'n = int(input())\nprint(1110-n)'] | ['Runtime Error', 'Accepted'] | ['s391104975', 's052835435'] | [2940.0, 2940.0] | [24.0, 20.0] | [113, 30] |
p03242 | u736729525 | 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").replace("9", "1"))\n', 'N = input()\nprint(N.replace("1", "x").replace("9", "1").replace("x", "9")) \n'] | ['Wrong Answer', 'Accepted'] | ['s785953871', 's048771486'] | [2940.0, 2940.0] | [17.0, 17.0] | [51, 200] |
p03242 | u740047492 | 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, b, c =input().split()\na.replace("1","9")\nb.replace("1","9")\nc.replace("1","9")\nprint(a+b+c)', 'a=(input()\nprint(a.replace("1", "9"))', 'a=input()\nprint(a.replace("1", "9", 3))', 'a=int(input())\nprint(1110-a)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s592556497', 's683665128', 's747456691', 's981130722', 's951266611'] | [2940.0, 3188.0, 2940.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0, 20.0, 18.0] | [36, 94, 37, 39, 28] |
p03242 | u740767776 | 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 = list(input())\nprint(a)\nfor i, n in enumerate(a):\n if n == "1":\n a[i] = 9\n else:\n a[i] = 1\nl = a[0] *100 + a[1] * 10 + a[2] \nprint(int(l))', 'a = list(input())\nfor i, n in enumerate(a):\n if n == "1":\n a[i] = 9\n else:\n a[i] = 1\nl = a[0] *100 + a[1] * 10 + a[2] \nprint(int(l))'] | ['Wrong Answer', 'Accepted'] | ['s354807803', 's976980847'] | [2940.0, 2940.0] | [17.0, 18.0] | [162, 153] |
p03242 | u748135969 | 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 i in range(len(n)):\n if n[i] == '1':\n n.replace('1', '9')\n else:\n n.replace('9', '1')\nprint(n)", 'n = input()\n\nprint(n.replace(1, 9).replace(9, 1))\n\n', "n = str(input())\n\nprint(n.replace('1', '9').replace('9', '1'))", "n = str(input())\nnn = []\nfor i in n:\n if i == '1':\n nn.append('9')\n else:\n nn.append('1')\nprint(''.join(nn))"] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s042242057', 's433044351', 's740087420', 's029621850'] | [2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 18.0, 17.0, 17.0] | [124, 51, 62, 116] |
p03242 | u748311048 | 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\nA=''\nfor i in range(3):\n if N[i]==1:\n A=A+'9'\n else:\n A=A+'1'\n\nprint(int(A))", "N=str(input())\n\nA=''\nfor i in range(3):\n if N[i]=='9':\n A=A+'1'\n else:\n A=A+'9'\n\nprint(int(A))"] | ['Runtime Error', 'Accepted'] | ['s920198528', 's227886462'] | [2940.0, 2940.0] | [20.0, 17.0] | [100, 102] |
p03242 | u748377775 | 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 range(9):\n if(N>L[i] and N<=L[i+1]):\n print(L[i+1])\n break\n elif(N==L[i]):\n print(L[i])\n break\n elif(N<111):\n print(111)\n break\n else:\n continue\n', 'N=input()\n\nstr_output=""\n\nfor i in range(3):\n if(N[i]=="1"):\n str_output+="9"\n elif(N[i]=="9"):\n str_output+="1"\n \nprint(int(str_output))'] | ['Runtime Error', 'Accepted'] | ['s713046277', 's708896523'] | [2940.0, 2940.0] | [17.0, 17.0] | [215, 164] |
p03242 | u748540356 | 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())\nY=[111,222,333,444,555,666,777,888,999]\nfor i in range(9):\n if N<=Y[i]:\n print(Y[i])\n break', "n=list(str(input()))\n\nC=len(n)\nN=0\nfor i in range(C):\n if n[i]=='1':\n N+=10**(C-1-i)*9\n else:\n N+=10**(C-1-i)\n\nprint(N) "] | ['Wrong Answer', 'Accepted'] | ['s567029435', 's780251124'] | [3060.0, 2940.0] | [18.0, 17.0] | [113, 129] |
p03242 | u752522099 | 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()\nlis = ""\n\nfor i in num:\n if i == "1":\n lis+="9"\n else:\n lis+="1"\n\nprint(int(num))', 'num = input()\nlis = ""\n\nfor i in num:\n if i == "1":\n lis+="9"\n else:\n lis+="1"\n\nprint(int(lis))'] | ['Wrong Answer', 'Accepted'] | ['s492282045', 's906926312'] | [2940.0, 2940.0] | [17.0, 17.0] | [115, 115] |
p03242 | u754511616 | 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=list(input())\nfor i in range(3):\n if int(a[i])==1:\n a[i]='9'\n elif int(a[i])==9:\n a[i]=='1'\nprint(''.join(a))", "a=list(input())\nfor i in range(3):\n if int(a[i])==1:\n a[i]='9'\n elif int(a[i])==9:\n a[i]='1'\nprint(''.join(a))"] | ['Wrong Answer', 'Accepted'] | ['s002196765', 's435971859'] | [9116.0, 9112.0] | [26.0, 25.0] | [119, 118] |
p03242 | u756693875 | 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 n:\n if i == 1:\n s += '9'\n else:\n s += '1'\nprint(s)", "n = input()\ns = ''\nfor i in n:\n if i == '1':\n s += '9'\n else:\n s += '1'\nprint(s)"] | ['Wrong Answer', 'Accepted'] | ['s536550767', 's343172489'] | [3064.0, 2940.0] | [18.0, 17.0] | [98, 100] |
p03242 | u757274384 | 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 = 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()\nn = n.replace("1", "@")\nn = n.replace("9", "1")\nn = n.replace("@", "9")\n\nprint(n)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s184211076', 's430205294', 's683795844'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [102, 101, 94] |
p03242 | u758475901 | 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[0] == 1: N[0] == 9\nelif N[0] == 9: N[0] == 1\nelif N[1] == 1: N[1] == 9\nelif N[1] == 9: N[1] == 1\nelif N[2] == 1: N[2] == 9\nelif N[2] == 9: N[2] == 1\nprint(N) ', 'N = int(input())\nprint(1110-N)'] | ['Wrong Answer', 'Accepted'] | ['s998456323', 's580743704'] | [3064.0, 2940.0] | [18.0, 17.0] | [182, 30] |
p03242 | u759412327 | 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})))', 'import str\nprint(input().translate(str.maketrans({"1":9,"9":1})))', 'print(1110-int(input()))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s329200603', 's552990451', 's160469226'] | [2940.0, 2940.0, 8988.0] | [17.0, 17.0, 27.0] | [54, 65, 24] |
p03242 | u765325669 | 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())\nlst = str(input()).split(' ')\n\np1 = lst[0]\np2 = lst[1]\nnew_lst = []\nfor idx in range(n):\n\tif idx%2 == 0:\n \t\tnew_lst.append(p1)\n\telse:\n\t\tnew_lst.append(p2)\n\ncnt = 0\nfor o, l in zip(lst, new_lst):\n\tif not o == l:\n\t\tcnt +=1\nif p1 == p2:\n print(int(n/2))\nelse:\n print(cnt)", "n = str(input())\none_idx = []\nnine_idx = []\nprint(n)\nfor idx in range(len(n)):\n\tif n[idx]=='1':\n\t\tone_idx.append(idx)\n\tif n[idx]=='9':\n\t\tnine_idx.append(idx)\n\nout = ''\nfor idx in range(len(n)):\n\tif idx in one_idx:\n\t\tout += '9'\n\tif idx in nine_idx:\n\t\tout += '1'\n \nprint(out)", 'n = str(input())\n\nif int(n[0]) > int(n[1]):\n\tout = n[0]*3\nelif n[0] == n[1]:\n if int(n[1]) >= int(n[2]):\n out = n[0]*3\n else:\n out = str(int(n[0])+1)*3\nelse:\n out = str(int(n[0])+1)*3\n \nprint(out)', 'n = str(input())\n\nif int(n[0]) > int(n[1]):\n\tout = n[0]*3\nelif n[0] == n[1]:\n if int(n[1]) >= int(n[2]):\n out = n[0]*3\n else:\n out = str(int(n[0])+1)*3\nelse:\n out = str(int(n[0])+1)*3\n \nprint(out)', "n = int(input())\nlst = str(input()).split(' ')\n\np1 = [0]*(max([int(i) for i in lst])+1)\np2 = [0]*(max([int(i) for i in lst])+1)\nfor idx in range(n):\n\tif idx%2 == 0:\n\t\tp1[int(lst[idx])] += 1\n\telse:\n\t\tp2[int(lst[idx])] += 1\n\npp1 = p1.index(max(p1))\npp2 = p2.index(max(p2))\nif pp1 == pp2:\n\tif max(p1) >= max(p2):\n\t\tpp1 = p1.index(max(p1))\n\t\tpp2 = p2.index(sorted(p2)[-2])\n\telif max(p2) > max(p1):\n\t\tpp1 = p1.index(sorted(p1)[-2])\n\t\tpp2 = p2.index(max(p2))\n\ncnt1 = 0\ncnt2 = 0\nfor idx in range(n):\n\tif idx%2 == 0:\n\t\tif not lst[idx] == str(pp1):\n\t\t\tcnt1 += 1\n\telse:\n\t\tif not lst[idx] == str(pp2):\n\t\t\tcnt2 += 1\n\nprint(cnt1 + cnt2)", 'n = str(input())\n\nif int(n[0]) < int(n[1]):\n\tout = str(int(n[0])+1)*3\nelif n[0] == n[1]:\n if int(n[1]) >= int(n[2]):\n out = n[0]*3\n else:\n out = str(int(n[0])+1)*3\nelse:\n out = str(int(n[0])+1)*3\n \nprint(out)', "n = str(input())\none_idx = []\nnine_idx = []\nfor idx in range(n):\n\tif n[idx]=='1':\n\t\tone_idx.append(idx)\n if n[idx]=='9':\n\t\tnine_idx.append(idx)\n\nfor idx in range(n):\n\tif idx in one_idx:\n\t\tn[idx] = '9'\n if idx in nine_idx:\n\t\tn[idx] = '1'\n \nprint(n)\n", "n = str(input())\none_idx = []\nnine_idx = []\nfor idx in range(len(n)):\n\tif n[idx]=='1':\n\t\tone_idx.append(idx)\n\tif n[idx]=='9':\n\t\tnine_idx.append(idx)\n\nout = ''\nfor idx in range(len(n)):\n\tif idx in one_idx:\n\t\tout += '9'\n\tif idx in nine_idx:\n\t\tout += '1'\n \nprint(out)"] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s300641982', 's356184421', 's365120869', 's489943987', 's645015839', 's824307399', 's828191724', 's204320949'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3188.0, 3060.0] | [20.0, 18.0, 18.0, 18.0, 18.0, 19.0, 18.0, 17.0] | [288, 282, 208, 208, 623, 220, 263, 273] |
p03242 | u776871252 | 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. | ['list = [int(input(\'\'))for i in range(3)]\n\nfor i in range(3):\n if list[i] == 1:\n print(9, end="")\n elif list[i] == 9:\n print(9, end="")\n\nprint()\n', 'list = [int(input().splir\\t(\'\'))for i in range(3)]\n\nfor i in range(3):\n if list[i] == 1:\n print(9, end="")\n elif list[i] == 9:\n print(9, end="")\n\nprint()\n', 'list = [int(input().split(\'\'))for i in range(3)]\n\nfor i in range(3):\n if list[i] == 1:\n print(9, end="")\n elif list[i] == 9:\n print(9, end="")\n\nprint()\n', 'list(nyu = input())\n\nfor i in nyu:\n if i == "1":\n print("9", end="")\n elif i == "9":\n print("1", end="")\nprint()\n', 'list = [int(input())for i in range(3)]\n\nfor i in range(3):\n if list[i] == 1:\n print(9, end="")\n elif list[i] == 9:\n print(9, end="")\n\nprint()\n', 'nyu = input()\nlist(nyu)\n\nfor i in nyu:\n if i == "1":\n print("9", end="")\n elif i == "9":\n print("1", end="")\nprint()\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s275276971', 's313479118', 's770953469', 's790569965', 's910390538', 's519212827'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [164, 174, 172, 134, 162, 138] |
p03242 | u777394984 | 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={"1":"9","9":"1"}\nt=input()\nn=""\nfor i is range(3):\n n+=a[t[i]]\nprint(n)', 'a = {"1":9,"9":1}\nz = input()\nm = ""\nfor i in z:\n m += a[i]\n\nprint(m)', 'a = {"1":"9","9":"1"}\nz = input()\nm = ""\nfor i in z:\n m += a[i]\n\nprint(m)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s448787745', 's482496386', 's645797268'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [75, 70, 75] |
p03242 | u777864981 | 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'] | ['s375276488', 's989056395'] | [2940.0, 2940.0] | [17.0, 17.0] | [25, 26] |
p03242 | u782654209 | 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())\ns = ''\nfor i in range(2):\n if n[i] == '1':\n s += '9'\n elif n[i] == '9':\n s += '1'\n else:\n s += n[i]\nprint(s)\n", "n = str(input())\nfor i in range(2):\n if n[i] == '1':\n n[i] = '9'\n elif n[i] == '9':\n n[i] = '1'\nprint(n)", "n = str(input())\ns = ''\nfor i in range(3):\n if n[i] == '1':\n s += '9'\n elif n[i] == '9':\n s += '1'\n else:\n s += n[i]\nprint(s)"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s092689979', 's625775059', 's996601889'] | [2940.0, 2940.0, 2940.0] | [18.0, 18.0, 17.0] | [138, 112, 137] |
p03242 | u787383401 | 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\tprint(1110-N)', 'N=int(input())\nprint(1110-N)'] | ['Runtime Error', 'Accepted'] | ['s965820494', 's079874416'] | [2940.0, 2940.0] | [17.0, 17.0] | [29, 28] |
p03242 | u787562674 | 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 in range(len(N)):\n if N[i] == '9':\n N[i] == '1'\n elif N[i] == '1':\n N[i] == '9'\n\nprint(''.join(N))", "N = input()\n\nans =''\n\nfor i in range(len(N)):\n if N[i] == '1':\n ans += '9'\n else:\n ans += '1'\n\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s799051919', 's734971934'] | [2940.0, 2940.0] | [17.0, 17.0] | [143, 125] |
p03242 | u790877102 | 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\nS = (((N-1)//111))*111\n\nprint(S)\n', 'n = int(input())\nv = list(map(int,input().split()))\na = [v[i] for i in range(n) if i%2==0]\nb = [v[i] for i in range(n) if i%2==1]\n\nx = 0\ny = 0\np=0\nq=0\n\nfor i in range(10**5):\n if x<a.count(i):\n p=i\n x=a.count(i)\n if y<b.count(i):\n q=i\n y=b.count(i)\n\nprint(n-x-y)', 'N = int(input())\n\nS = (((N-1)//111)+1)*111\n\nprint(S)\n', 'n = int(input())\n\nm = 1110 - n\n\nprint m', 'N = int(input())\n\nS = ((N//111)+1)*111\n\nprint(S)', 'n = int(input())\n\nm = 1110 - n\n\nprint(m\n)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s050472676', 's050706493', 's079526715', 's397529396', 's786679634', 's892540845'] | [2940.0, 3064.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 18.0, 17.0, 16.0, 17.0, 17.0] | [51, 296, 53, 39, 48, 41] |
p03242 | u795187996 | 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 i is '1':\n i = '9'\n else:\n i = '1'\nprint(N[0] + N[1] + N[2])", "N = list(input())\nfor i in range(len(N)):\n if N[i] is '1':\n N[i] = '9'\n else:\n N[i] = '1'\nprint(N[0] + N[1] + N[2])"] | ['Wrong Answer', 'Accepted'] | ['s202473836', 's410030535'] | [2940.0, 2940.0] | [17.0, 17.0] | [102, 123] |
p03242 | u797016134 | 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").replace("9","1"))', 'print(input().replace("1","8").replace("9","1").replace("8","9"))'] | ['Wrong Answer', 'Accepted'] | ['s501309572', 's606527336'] | [2940.0, 2940.0] | [17.0, 17.0] | [48, 65] |
p03242 | u797550216 | 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 in range(n):\n\tif n[i] == '9':\n\t\tn[i] = '1'\n\telse:\n\t\tn[i] = '9'\nprint(n)", "n =input()\n\nn = n.replace('9','0')\nn = n.replace('1','9')\nn = n.replace('0','1')\nprint(n)"] | ['Runtime Error', 'Accepted'] | ['s446721533', 's693228936'] | [2940.0, 2940.0] | [18.0, 18.0] | [89, 89] |
p03242 | u803503672 | 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()\nl = ""\nfor i in range(3):\n if s[0] == "1":\n l += "9"\n else:\n l += "1"\n \nprint(l)', 's = input()\nl = ""\nfor i in range(3):\n if s[i] == "1":\n l += "9"\n else:\n l += "1"\n \nprint(int(l))'] | ['Wrong Answer', 'Accepted'] | ['s161746068', 's478008399'] | [8988.0, 9104.0] | [28.0, 24.0] | [103, 108] |
p03242 | u806855121 | 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\nprint(1000-n)', 'n = int(input())\n\nprint(1110-n)'] | ['Wrong Answer', 'Accepted'] | ['s899451592', 's300424446'] | [2940.0, 2940.0] | [17.0, 18.0] | [31, 31] |
p03242 | u807772568 | 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 = int(input())\n\nb = list(map(int,input().split()))\nd = max(b)\nc = [0 for i in range(pow(10,6)+1)]\ncc = [0 for i in range(pow(10,6)+1)]\nfor i in range(len(b)):\n if i % 2 == 0:\n cc[b[i]-1] += 1\n else:\n c[b[i]-1] += 1\n\none = 0\nonee = 0\ntwo = 0\ntwoo = 0\nk = 0\nkk = 0\nfor i in range(len(c)):\n if one <= c[i]:\n onee = one\n one = c[i]\n k = i\n if two <= cc[i]:\n twoo = two\n two = cc[i]\n kk = i\n\nt = max(one+twoo,onee+two)\n\nif k != kk:\n print(a-one-two)\nelse:\n print(a-t)\n', 'a = int(input())\n\nb = list(map(int,input().split()))\nd = max(b)\nc = [0 for i in range(pow(10,5)+100)]\ncc = [0 for i in range(pow(10,5)+100)]\nfor i in range(a):\n if i % 2 == 0:\n c[b[i]] += 1\n else:\n cc[b[i]] += 1\n\none = 0\nonee = 0\ntwo = 0\ntwoo = 0\nk = 0\nkk = 0\nfor i in range(len(c)):\n if one <= c[i]:\n onee = one\n one = c[i]\n k = i\n if two <= cc[i]:\n twoo = two\n two = cc[i]\n kk = i\n\nt = max(one+twoo,onee+two)\n\nprint(a-one-two)\n\n', 'a = list(input())\nfor i in range(3):\n\ta[i] = int(a[i])\n\tif a[i] ==1:\n\t\ta[i] = 9\n\telse:\n\t\ta[i] = 1\nprint(a[0]*100+a[1]*10+a[2])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s131029507', 's848842342', 's877240317'] | [3064.0, 3064.0, 2940.0] | [18.0, 17.0, 17.0] | [539, 498, 126] |
p03242 | u814986259 | 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 x in N:\n if x=="1":\n x="9"\n elif x=="9":\n x="1"\nprint(N)', 'N=input()\nfor x in range(len(N)):\n if N[x]=="1":\n N[x]="9"\n elif N[x]=="9":\n N[x]="1"\nprint(N)', 'N=list(input())\nfor x in range(len(N)):\n if N[x]=="1":\n N[x]="9"\n else:\n N[x]="1"\nprint("".join(N))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s563322447', 's833316607', 's280093717'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [78, 102, 107] |
p03242 | u815878613 | 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\n\nfrom collections import Counter\n\nn = int(input())\n\nv = []\nv1 = []\nv2 = []\n\nv = list(map(int, input().split()))\n\nfor i in range(int(n/2)):\n v1.append(v[2*i])\n v2.append(v[2*i+1])\n\ne = Counter(v1)\no = Counter(v2)\n\nee = e.most_common(2)\noo = o.most_common(2)\n\nif ee[0][0] != oo[0][0]:\n print(n - (ee[0][1]+oo[0][1]))\n sys.exit()\n\nif ee[0][0] == oo[0][0]:\n if len(ee) == 1 and len(oo) == 1:\n print(n - (ee[0][1]))\n sys.exit()\n\n if len(ee) == 1:\n print(n - (ee[0][1]+oo[1][1]))\n sys.exit()\n\n if len(oo) == 1:\n print(n - (ee[1][1]+oo[0][1]))\n sys.exit()\n\n if ee[0][1] == oo[0][1]:\n print(n - (ee[0][1] + min(ee[1][1],oo[1][1])))\n \n if ee[0][1] > oo[0][1]:\n print(n - (ee[0][1]+oo[1][1]))\n sys.exit()\n else:\n print(n - (ee[1][1]+oo[0][1]))\n sys.exit()\n', "i = input()\n\nk = []\n\nfor j in i:\n if j == '1':\n k.append('9')\n else:\n k.append('1')\n\nprint(''.join(k))\n"] | ['Runtime Error', 'Accepted'] | ['s408412007', 's173112583'] | [3316.0, 2940.0] | [24.0, 21.0] | [867, 123] |
p03242 | u820351940 | 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 a:\n print(i == "1" and "9" or "1" end="")\n', 'print(1110 - int(input()))'] | ['Runtime Error', 'Accepted'] | ['s584539352', 's799575324'] | [2940.0, 2940.0] | [17.0, 18.0] | [66, 26] |
p03242 | u822662438 | 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 n:\n if i == 9:\n n[i] = 1\n else:\n n[i] = 9\nprint(int(n))\n', 'n = str(input())\nans = ""\nfor i in n:\n if i == "9":\n ans += "1"\n else:\n ans += "9"\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s999144591', 's626140738'] | [2940.0, 2940.0] | [17.0, 17.0] | [102, 114] |
p03242 | u827141374 | 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 a in A:\n if a == 1:\n print("9", end="")\n else:\n print("1", end="")\nprint("")', 'A = input()\nfor a in A:\n if a is "1":\n print("9", end="")\n else:\n print("1", end="")\nprint("")\n'] | ['Wrong Answer', 'Accepted'] | ['s411205184', 's209440283'] | [2940.0, 2940.0] | [20.0, 18.0] | [100, 103] |
p03242 | u844005364 | 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()\n\nprint(s.replace("9", "x").replace("1", "9").replace("x", "1")', 's = input()\n\nprint(s.replace("9", "x").replace("1", "9").replace("x", "1"))'] | ['Runtime Error', 'Accepted'] | ['s454989396', 's937289228'] | [2940.0, 2940.0] | [18.0, 17.0] | [74, 75] |
p03242 | u844646164 | 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\nn = int(input())\nv = list(map(int, input().split()))\nfor_set_v = v \nset_v = set(v)\neven = []\nodd = []\ncount = 0 \ncount_list = []\nfor num in range(n):\n if num % 2 == 0:\n even.append(v[num])\n else:\n odd.append(v[num])\n\neven_most = Counter(even).most_common()\nodd_most = Counter(odd).most_common()\n#print(even_most)\n#print(odd_most)\nif len(set(v)) >= 2:\n if even_most[0][0] != odd_most[0][0]:\n if len(set(even)) != 1:\n count += (n/2) - int(even_most[0][1])\n if len(set(odd)) != 1:\n count += (n/2) - int(odd_most[0][1])\n else:\n try:\n count_list.append(n-int(even_most[0][1])-int(odd_most[1][1]))\n count_list.append(n-int(even_most[1][1])-int(odd_most[0][1]))\n #print(count_list)\n count += int(min(count_list))\n except:\n if len(even_most) == 1:\n count += (n/2)-int(odd_most[1][1])\n elif len(odd_most) == 1:\n count += (n/2)-int(even_most[1][1])\nelse:\n count += (n/2)\nprint(int(count))\n', "n = list(input())\nresult = ''\nfor num in n:\n if num == '1':\n result += '9'\n elif num == '9':\n result += '1'\nprint(int(result))"] | ['Runtime Error', 'Accepted'] | ['s735492074', 's195289019'] | [3316.0, 2940.0] | [20.0, 17.0] | [1118, 146] |
p03242 | u844697453 | 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().split()\nans = []\nfor i in a:\n if a == "1":\n ans.append("9")\n elif a == "9":\n ans.append("1")\n else:\n ans.append(a)\nprint(ans.join())', 'a = input().split()\nans = []\nfor i in a:\n if a == "1":\n ans.append("9")\n elif a == "9":\n ans.append("1")\n else:\n ans.append(a)\nprint("".join(ans))', 'a = list(input())\nans = []\nfor i in a:\n if i == "1":\n ans.append("9")\n elif i == "9":\n ans.append("1")\n else:\n ans.append(i)\nprint(\'\'.join(ans))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s561486888', 's563246409', 's718514473'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [156, 158, 156] |
p03242 | u845333844 | 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 = 1100-n\nprint(a)', 'n = int(input())\na = 1110-n\nprint(a)'] | ['Wrong Answer', 'Accepted'] | ['s955411943', 's150770709'] | [2940.0, 2940.0] | [17.0, 17.0] | [36, 36] |
p03242 | u846041485 | 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, 9):\n ret = i*111\n if ret >= inp:\n break\nprint(ret)', 'inp = input()\nret = ""\nfor i in range(3):\n if inp[i] == \'1\':\n ret += "9"\n if inp[i] == \'9\':\n ret += "1"\nprint(ret)'] | ['Wrong Answer', 'Accepted'] | ['s586126174', 's748766609'] | [2940.0, 2940.0] | [17.0, 17.0] | [108, 134] |
p03242 | u847033024 | 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()\npirnt(a.replace('1', '9'))", "a = input()\nprint(a.replace('1', 'x').replace('9', '1').replace('x', '9'))"] | ['Runtime Error', 'Accepted'] | ['s139334044', 's994304268'] | [9096.0, 8952.0] | [24.0, 27.0] | [38, 74] |
p03242 | u853900545 | 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 ==111:\n print(999)\nelif n ==119:\n print(991)\nelif n == 191:\n print(919)\nelif n == 199:\n print(911)\nelif n== 911:\n print(199)\nelif n == 919:\n print(191)\nelif n== 991:\n print(119)\nelse:\n print(111)', "s = input()\nfor i in range(3):\n if s[i] == '1':\n s[i] = '9'\n elif s[i] == '9':\n s[i] = '1'\nprint(s)", 'n = int(input())\nif n ==111:\n print(999)\nelif n ==119:\n print(991)\nelif n == 191:\n print(919)\nelif n == 199:\n print(911)\nelif n== 911:\n print(199)\nelif n == 919:\n print(191)\nelif n== 991:\n print(119)\nelse:\n print(111)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s278998515', 's369679815', 's211003667'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [236, 119, 241] |
p03242 | u855380359 | 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 n == 111:\n print(999)\nelif n == 119:\n print(991)\nelif n == 191:\n print(919)\nelif n == 199:\n print(911)\nelif n == 911:\n print(199)\nelif n == 919:\n print(191)\nelif n == 991:\n print(119)\nelse:\n print(111)', 'n = input()\n\nif n = 111:\n print(999)\nelif n = 119:\n print(991)\nelif n = 191:\n print(919)\nelif n = 199:\n print(911)\nelif n = 911:\n print(199)\nelif n = 919:\n print(191)\nelif n = 991:\n print(199)\nelse:\n print(111)', 'n = int(input())\n \nif n == 111:\n print(999)\nelif n == 119:\n print(991)\nelif n == 191:\n print(919)\nelif n == 199:\n print(911)\nelif n == 911:\n print(199)\nelif n == 919:\n print(191)\nelif n == 991:\n print(119)\nelif n == 999:\n print(111)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s121556722', 's707964824', 's181387958'] | [9076.0, 8888.0, 9076.0] | [30.0, 20.0, 30.0] | [226, 218, 256] |
p03242 | u855985627 | 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())\nfor i in range(1, 10):\n if((i-1)*111<N and N<=i*111):\n print(i*111)', 'n = input()\nn = n.replace("1", "3")\nn = n.replace("9", "1")\nn = n.replace("3", "9")\nprint(n)'] | ['Wrong Answer', 'Accepted'] | ['s720621224', 's868362021'] | [2940.0, 2940.0] | [17.0, 17.0] | [94, 92] |
p03242 | u857673087 | 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()\n\nprint(n.replace('1','x').replace('9','1').replace('x','9'))\n"] | ['Wrong Answer', 'Accepted'] | ['s820534604', 's245686669'] | [2940.0, 2940.0] | [17.0, 17.0] | [72, 73] |
p03242 | u858670323 | 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())\ndix = {'1':'9','9':'1'}\nfor x in n:\n if x=='1' or x=='9':\n x = dix[x]\nprint(n)", 'n = str(input())\ndix = {\'1\':\'9\',\'9\':\'1\'}\nans = ""\nfor x in n:\n if x==\'1\' or x==\'9\':\n ans += dix[x]\n else:\n ans += x\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s346965655', 's897523027'] | [9000.0, 9048.0] | [24.0, 24.0] | [99, 135] |
p03242 | u860546679 | 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]=='1':\n s[i]='9'\n else:\n s[i]='1'\nprint(s)", "print(input().replace('1','a').replace('9','1').replace('a','9'))"] | ['Runtime Error', 'Accepted'] | ['s728856941', 's779283334'] | [2940.0, 2940.0] | [18.0, 17.0] | [87, 65] |
p03242 | u865413330 | 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().split()\nresult = ""\nfor i in num:\n if num[i] == 1:\n result += \'9\'\n if num[i] == 9:\n result += \'1\'\nprint(result)\n\n', 'num = list(input())\nresult = ""\nfor i in range(len(num)):\n if num[i] == \'1\':\n result += \'9\'\n if num[i] == \'9\':\n result += \'1\'\nprint(result)\n\n'] | ['Runtime Error', 'Accepted'] | ['s778947676', 's033947059'] | [2940.0, 2940.0] | [17.0, 17.0] | [147, 161] |
p03242 | u866769581 | 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 s in range(3):\n if s == '9':\n ans += '1'\n else:\n ans += '9'\nprint(ans)\n", "n = input()\nans = ''\nfor s in n:\n if s == '9':\n ans += '1'\n else:\n ans += '9'\nprint(ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s719183958', 's035695823'] | [2940.0, 2940.0] | [17.0, 17.0] | [116, 109] |
p03242 | u869154953 | 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\n\nans=""\n\nif n[0]=="1":\nans=ans+"9"\nelse:\nans=ans+"1" \n\nif n[1]=="1":\nans=ans+"9"\nelse:\nans=ans+"1" \n\n\nif n[2]=="1":\nans=ans+"9"\nelse:\nans=ans+"1"\n\n\nprint(ans) ', 'n=input()\n\n\nans=""\n\nif n[0]=="1":\n\tans=ans+"9"\nelse:\n\tans=ans+"1" \n\nif n[1]=="1":\n\tans=ans+"9"\nelse:\n\tans=ans+"1" \n\nif n[2]=="1":\n\tans=ans+"9"\nelse:\n\tans=ans+"1"\n\n\nprint(ans) '] | ['Runtime Error', 'Accepted'] | ['s329372122', 's924062818'] | [8984.0, 9036.0] | [20.0, 24.0] | [170, 175] |
p03242 | u869728296 | 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()\n\na=list(a)\n\n\n\nfor i in range(3):\n if(a[i]=='1'):\n a[i]='9'\n elif(a[i]=='9'):\n a[i]='9'\ns=''.join(a)\n\nprint(s)\n\n", "a=input()\n\na=list(a)\n\n\n\nfor i in range(3):\n if(a[i]=='1'):\n a[i]='9'\n elif(a[i]=='9'):\n a[i]='1'\ns=''.join(a)\n\nprint(s)\n"] | ['Wrong Answer', 'Accepted'] | ['s029823044', 's141573582'] | [2940.0, 2940.0] | [18.0, 19.0] | [163, 162] |
p03242 | u870518235 | 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())\nans = ""\nfor i in range(3):\n if s[i] == 1:\n ans = ans + "9"\n else:\n ans = ans + "1"\nprint(ans)\n', 's = list(str(input()))\nans = ""\nfor i in range(3):\n if s[i] == 1:\n ans = ans + "9"\n else:\n ans = ans + "1"\nprint(ans)\n', 's = str(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 = str(input())\nans = ""\nfor i in range(len(s)):\n if s[i] == 1:\n ans += 9\n else:\n ans += 1\nprint(ans)\n', 's = list(str(input()))\nans = ""\nfor i in range(3):\n if s[i] == "1":\n ans = ans + "9"\n else:\n ans = ans + "1"\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s373565595', 's425704460', 's517135686', 's740292612', 's879564820'] | [8992.0, 8964.0, 8908.0, 9032.0, 9032.0] | [27.0, 25.0, 26.0, 23.0, 32.0] | [133, 138, 111, 123, 140] |
p03242 | u877415670 | 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 if n[i]=='9':\n n[i]='1'\nprint(n)", "n=list(input())\nfor i in range(3):\n if n[i]=='1':\n n[i]='9'\n elif n[i]=='9':\n n[i]='1'\nans=''\nfor i in range(3):\n ans+=n[i]\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s925816172', 's024514000'] | [2940.0, 2940.0] | [17.0, 17.0] | [95, 144] |
p03242 | u879876900 | 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 = int(input())\nlst = []\nwhile i > 0:\n \n a=i%10\n \n if a==1:\n a=9\n else:\n a=1\n \n lst.append(a)\n i //= 10\nlst.reverse()\nprint(lst)', 'i = int(input())\nlst = []\nwhile i > 0:\n \n a=i%10\n \n if a==1:\n a=9\n else:\n a=1\n \n lst.append(a)\n i //= 10\nlst.reverse()\nprint(lst[0]*100+lst[1]*10+lst[2])'] | ['Wrong Answer', 'Accepted'] | ['s578556601', 's974340616'] | [2940.0, 3064.0] | [17.0, 19.0] | [167, 191] |
p03242 | u881116515 | 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 = list(input())\nfor i in range(3):\n if a[i] = "1":\n a[i] = "9"\n else:\n a[i] = "1"\nprint("".join(a))\n', 'a = list(input())\nfor i in range(3):\n if a[i] = "1":\n a[i] = 9\n else:\n a[i] = 1\nprint("".join(a))', 'a = list(input())\nfor i in range(3):\n if a[i] == "1":\n a[i] = "9"\n else:\n a[i] = "1"\nprint("".join(a))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s076810175', 's080101605', 's447265530'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [110, 105, 111] |
p03242 | u883048396 | 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. | ['rint(input().rstrip().replace("1","a").replace("9","1").replace("a","9"))\n', "print(input().rstrip().translate(str.maketrans({'9':'1','1':'9'})))"] | ['Runtime Error', 'Accepted'] | ['s957990951', 's479520157'] | [2940.0, 3188.0] | [17.0, 21.0] | [74, 67] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.