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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03073 | u638282348 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['color = input()\n\nl1 = [str(i % 2) for i in range(len(color))]\nl2 = [str((i + 1) % 2) for i in range(len(color))]\n\nprint(color)\nprint(l1, l2)\ns1 = s2 = 0\nfor c, n1, n2 in zip(color, l1, l2):\n s1 += (c != n1)\n s2 += (c != n2)\n\nprint(min(s1, s2))', 'color = input().rstrip("\\n")\n\nl1 = [str(i % 2) for... | ['Wrong Answer', 'Accepted'] | ['s695371424', 's125954629'] | [18220.0, 15860.0] | [121.0, 106.0] | [249, 235] |
p03073 | u640319601 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['N = int(input())\nH = list(map(int, input().split()))\n\nans = 0\nif N > 1:\n for i in range(1, N):\n if (H[i] >= H[i - 1]:\n ans += 1\n\nprint(ans + 1)', "import itertools\nS = input()\n\np1 = itertools.cycle('01')\np2 = itertools.cycle('10')\n\nans1=0\nans2=0\nfor s,P1,P2 in zip(S,p1,p2):\n if s == P1:\n ... | ['Runtime Error', 'Accepted'] | ['s959710515', 's311201539'] | [2940.0, 3188.0] | [17.0, 53.0] | [152, 208] |
p03073 | u643081547 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["def d201(a):\n count=0\n N=len(a)\n for i in range(N):\n if(i%2==0):\n if(a[i]=='0'):\n count+=1\n else:\n if(a[i]=='1'):\n count+=1\n return count\n\n \ndef d210(a):\n count=0\n N=len(a)\n for i in range(N):\n ... | ['Runtime Error', 'Accepted'] | ['s581385453', 's002672714'] | [3064.0, 3188.0] | [17.0, 49.0] | [507, 508] |
p03073 | u643714578 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s=input()\na=0\nfor i in range(len(s)):\n if i%2==0:\n if s[i]==0:\n a+=1\n if i%2==1:\n if s[i]==1:\n a+=1\nprint(min(a,len(s)-a)', 's=input()\na=0\nfor i in range(len(s)):\n if i%2==0 and s[i]=="0":\n \ta+=1\n if i%2==1 and s[i]=="1":\n \ta+=1 \nprint(min(a,(len(s)-a)))'] | ['Runtime Error', 'Accepted'] | ['s310191687', 's270274862'] | [2940.0, 3188.0] | [17.0, 54.0] | [139, 134] |
p03073 | u644360640 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\nl = [int(i) for i in s[0::2]]\nr = [int(i) for i in s[1::2]]\nprint(l)\nprint(r)\nif len(s) == 1:\n print(0)\nelse:\n l_count1 = l.count(1)\n l_count0 = len(l)-l_count1\n r_count1 = r.count(1)\n r_count0 = len(r)-r_count1\n l_1 = l_count0+r_count1\n l_0 = l_count1+r_count0\n if (l... | ['Wrong Answer', 'Accepted'] | ['s311914243', 's558902314'] | [4580.0, 4032.0] | [43.0, 37.0] | [471, 454] |
p03073 | u646913185 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["import numpy as np\ntile=str(input())\na=['01','10'][int(tile[0])]*(10**5//2)\nsum(np.array(list(tile),dtype=int)^np.array(list(a[:len(tile)]),dtype=int))", "import numpy as np\ntile=str(input())\na=['01','10'][int(tile[0])]*(10**5//2)\nprint(sum(np.array(list(tile),dtype=int)^np.array(list(a[:len(tile)]),dtype=int))... | ['Wrong Answer', 'Accepted'] | ['s073551111', 's489638254'] | [15156.0, 15156.0] | [204.0, 211.0] | [151, 158] |
p03073 | u648092704 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s = input()\nl = len(s)\na = 0\nfor i in range(l):\n if i&1 == 1:\n a <<= 2\n a += 1\nprint(bin(a))\nb = ((2**l)-1) ^ a\n\nS = int(s, 2)\nA = bin(S^a).count('1')\nB = bin(S^b).count('1')\nprint(min(A, B))", "s = input()\nl = len(s)\na = 0\nfor i in range(l):\n if i&1 == 0:\n a <<= 2\n a += 1\nb = ((2**l... | ['Wrong Answer', 'Accepted'] | ['s837024542', 's857066267'] | [3444.0, 3188.0] | [231.0, 232.0] | [198, 184] |
p03073 | u649202997 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['def main(n):\n\tn = input()\n\tr = 0\n\tf = n[0]\n\tif(f =="0"):\n\t\t\n\t\tfor i in range(1, len(n)):\n\t\t\tif(i % 2 == 0): \n\t\t\t\t# 1\n\t\t\t\tif(n[i]=="1"):\n\t\t\t\t\tr+=1\n\t\t\telse: # basic\n\t\t\t\t# 0\n\t\t\t\tif(n[i]=="0"):\n\t\t\t\t\tr+=1\n\telse:\n\t\t# one mode\n\t\tfor i in range(1, len(n)):\n\t\t\t... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s576395869', 's585591842', 's727546602', 's975398951', 's720334224'] | [3188.0, 2940.0, 3188.0, 3188.0, 3188.0] | [18.0, 17.0, 18.0, 36.0, 18.0] | [508, 71, 103, 271, 72] |
p03073 | u652569315 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["def main():\n import sys\n input = sys.stdin.readline\n s=list(input())\n count1,count2,l=0,0,len(s)\n for i in range(l):\n count1=count1+1 if (i%2==0 and int(s[i])==1) or (i%2==1 and int(s[i])==0) else count1\n count2=count2+1 if (i%2==1 and int(s[i])==1) or (i%2==0 and int(s[i])==0) else count2\n print(... | ['Runtime Error', 'Accepted'] | ['s589945798', 's033322102'] | [3956.0, 3956.0] | [94.0, 96.0] | [364, 323] |
p03073 | u655048024 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = str(input())\nN = len(S)\nK = []\nH = []\nfor i in range(N):\n K.append(i%2)\n H.append((i+1)%2)\ncount_K=0\ncount_H=0\nfor i in range(N):\n if (K[i]!=S[i]):\n count_K=count_K+1\n elif (H[i]!=S[i]):\n count_H=count_H+1\n else:\n None\nM = min(count_K,count_H)\nprint(M)\n \n \n ', 'S = str(input... | ['Wrong Answer', 'Accepted'] | ['s955481749', 's001374229'] | [4848.0, 3188.0] | [77.0, 69.0] | [281, 168] |
p03073 | u657901243 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = input()\nT = []\ntmp = '1'\nfor i in range(len(S)-1):\n if tmp[-1] == '0':\n tmp += '1'\n else:\n tmp += '0'\nT.append(tmp)\ntmp = '0'\nfor i in range(len(S)-1):\n if tmp[-1] == '0':\n tmp += '1'\n else:\n tmp += '0'\nT.append(tmp)\nprint(T)\nans = float('inf')\nfor j in ra... | ['Wrong Answer', 'Accepted'] | ['s545738706', 's920073351'] | [4008.0, 3316.0] | [113.0, 119.0] | [444, 435] |
p03073 | u662449766 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n s = input()\n length = len(s)\n o = "10" * (length // 2 + (length % 2))\n o_len = len([i for i, j in zip(s, o) if i == j])\n z_len = len([i for i, j in zip(s, o[::-1]) if i == j])\n print(length - max([z_len, o_len]))\n\n\nif __name__ == "_... | ['Wrong Answer', 'Accepted'] | ['s607570087', 's951843381'] | [4212.0, 4212.0] | [31.0, 31.0] | [325, 333] |
p03073 | u664762434 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = input()\nN = len(S)\nans1 = 0\nans2 = 0\nfor i in range(N):\n x = a[i]\n if i % 2 == 0:\n if x == '0':\n ans1 += 1\n else:\n ans2 += 1\n else:\n if x == '1':\n ans1 += 1\n else:\n ans2 += 1\nans = min(ans1,ans2)\nprint(ans)", "S = input()\nN = len(S)\nans1 = 0\nans2 = 0\nfor i i... | ['Runtime Error', 'Accepted'] | ['s371322805', 's605260907'] | [3188.0, 3188.0] | [17.0, 50.0] | [245, 245] |
p03073 | u667024514 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = str(input())\nw1,w2,b1,b2 = 0,0,0,0\nfor i in range(len(s)):\n if i % 2 == 0:\n \tif s[i] == "0":\n w1 += 1\n else:\n b1 += 1\n else:\n if s[i] == "0":\n w2 += 1\n else:\n b2 += 1\nprint(min(w1+b2,w2+b1))', 's = str(input())\nw1,w2,b1,b2 = 0,0,0,0\nfor i in range(len(s)):\n if i %... | ['Runtime Error', 'Accepted'] | ['s348298730', 's074224969'] | [2940.0, 3188.0] | [17.0, 49.0] | [226, 228] |
p03073 | u669686752 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\nn = len(s)\ncount = 0\ncount2 = 0\nfor i in range(n):\n if i % 2 == 0:\n x = "0"\n else:\n x = "1"\n if s[i] == x:\n count2 += 1\n #print(i, s[i], x, "OK")\n else:\n count += 1\n #print(i, s[i], x)\nprint(count,count2)\n', 's = input()\nn = len(s)\nco... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s397678669', 's833217115', 's441777393'] | [3188.0, 4892.0, 3188.0] | [51.0, 216.0, 50.0] | [271, 306, 275] |
p03073 | u671861352 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = input()\nn = len(S)\nS = int(S, 2)\na = sum([2 ** i for i in range(0, n, 2)])\nb = a << 1\n\nan = bin(a ^ S).count("1")\nbn = bin(b ^ S).count("1")\nprint(min(an, bn))', 'S = input()\nlen_S = len(S)\nn = len_S // 2\nA = "01" * n\nif len_S % 2 == 1:\n A += "0"\nan, bn = 0, 0\nfor s, a in zip(S, A):\n if s ==... | ['Wrong Answer', 'Accepted'] | ['s808782441', 's498490677'] | [103924.0, 3188.0] | [2110.0, 37.0] | [163, 199] |
p03073 | u679888753 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\nn = len(s)\n\n\n\n# 0...\nerr1 = 0\nfor i in range(n):\n if i % 2 == 0 and s[i] == 1:\n err1 += 1\n elif i % 2 == 1 and s[i] == 0:\n err1 += 1\n\n# 1...\nerr2 = 0\nfor i in range(n):\n if i % 2 == 0 and s[i] == 0:\n err2 += 1\n elif i % 2 == 1 and s[i] == 1:\n err2... | ['Wrong Answer', 'Accepted'] | ['s163030338', 's984091742'] | [3188.0, 3188.0] | [75.0, 76.0] | [360, 369] |
p03073 | u681110193 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s=input()\n\na=int(s)\n\nprint(a)', 's=input()\nl=len(s)\nsum1=0\nsum2=0\n\na=[0 for i in range(l)]\nc=[0 for i in range(l)]\nd=[0 for i in range(l)]\n\nfor i in range(l):\n a[i]=int(s[i])\n\nfor i in range(l):\n if i%2==0:\n c[i]=1\n\nfor i in range(l):\n if i%2==1:\n d[i]=1\n \nfor i in range(l):\n sum... | ['Wrong Answer', 'Accepted'] | ['s553391945', 's285988930'] | [3444.0, 5628.0] | [240.0, 141.0] | [29, 327] |
p03073 | u687766076 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import sys\nimport math\n\nmat = list(sys.stdin.readline())\n\nodd = 0\neven = 0\nl = len(mat)\nfor i, x in enumerate(mat):\n if int(x) == 1:\n if i % 2 == 0:\n even += 1\n else:\n odd += 1\n\nif odd > even:\n print(even + math.ceil(l / 2) - odd)\nelse:\n print(odd + math.... | ['Runtime Error', 'Accepted'] | ['s975670585', 's327732085'] | [3956.0, 3956.0] | [63.0, 71.0] | [319, 334] |
p03073 | u691018832 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = input()\nans = 0\nfor i in range(len(S)-1):\n \n if S[i] == S[i+1]:\n if S[i] == '0':\n S = S[:i] + '1' + S[i+1:]\n else:\n S = S[:i] + '0' + S[i+1:]\n ans += 1\n\nprint(ans)", "s = input()\ncnt = 0\nans = s[0]\nfor i in range(1, len(s)):\n if s[i] == ans[-1]:\n... | ['Wrong Answer', 'Accepted'] | ['s440989427', 's087333170'] | [3436.0, 3188.0] | [1351.0, 62.0] | [216, 223] |
p03073 | u693723949 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s=input()\nn=len(s)\ns = bin(int(s, 2))\ns_10 = '1' * (n % 2) + '01' * (n // 2)\ns_01 = '0' * (n % 2) + '10' * (n // 2)\ns_10 = bin(int(s_10, 2))\ns_01 = bin(int(s_01, 2))\nr = s ^ s_01\nl = s ^ s_10\nprint(min(r.count('1'), l.count('1')))", "s=input()\nn=len(s)\ns = int(s, 2)\ns_10 = '1' * (n % 2) + '01' * (n // 2)\... | ['Runtime Error', 'Accepted'] | ['s578937044', 's643297040'] | [3444.0, 3316.0] | [18.0, 19.0] | [230, 226] |
p03073 | u694665829 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['ースコード \n\nCopy\nCopy\n\ns = input()\nlen = len(s)\n \nif len == 1:\n print(0)\n exit()\n \neven = s[::2]\nodd = s[1::2]\n \n\n# 0101...\nodd_zero = odd.count("0")\neven_one = even.count("1")\n \n \n\n# 1010...\nodd_one = odd.count("1")\neven_zero = even.count("0")\n \nprint(min(odd_zero + even_one, odd_one + ev... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s297848563', 's677226046', 's793294473'] | [9096.0, 9164.0, 9140.0] | [27.0, 27.0, 29.0] | [465, 465, 252] |
p03073 | u700636661 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import sys\n\ndef judge(string):\n mem = ""\n for char in string:\n if mem == char:\n return False\n mem = char\n\n return True\n\n\ndef main():\n sinputl = sys.stdin.readline\n\n input = sinputl().strip()\n length = len(input)\n input = int(input, base=2)\n\n paint = ... | ['Runtime Error', 'Accepted'] | ['s634216361', 's780524652'] | [134484.0, 3316.0] | [2104.0, 43.0] | [578, 501] |
p03073 | u705007443 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import numpy as np\nn=input()\ndef check(n,st_num):\n count=0\n dic={1:1,0:2}\n for i in range(1,-(-len(n)//2)):\n try:\n if n[2*i]+n[2*i+1]==st_num:\n count+=0\n else:\n count+=dic[abs(int(n[2*i])+int(n[2*i+1])-1)]\n except:\n if n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s134230022', 's613723706', 's662935582', 's486689381'] | [18448.0, 3188.0, 3188.0, 3188.0] | [269.0, 66.0, 70.0, 129.0] | [517, 526, 531, 570] |
p03073 | u708088118 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['n = input()\nc1 = c2 = 0\nl = len(n)\nc1 = l - len([i for i in l[0::2] if i == "0"]) - len([i for i in l[1::2] if i == "1"])\nc2 = l - len([i for i in l[0::2] if i == "1"]) - len([i for i in l[1::2] if i == "0"])\n\nprint(min(c1,c2))', 'n = input()\nc1=c2=0\nl = len(n)\nc1 = n - len([i for i in l[0::2] if i == "0"]) ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s341372389', 's496706966', 's705406534', 's784593707', 's621409684'] | [3188.0, 3188.0, 3188.0, 3188.0, 3636.0] | [17.0, 17.0, 17.0, 17.0, 26.0] | [227, 223, 231, 223, 293] |
p03073 | u708615801 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["import sys\nstdin = sys.stdin\n \nsys.setrecursionlimit(10**5) \n \ndef ii(): return int(stdin.readline())\ndef li(): return map(int, stdin.readline().split())\nS = stdin.readline()\nL = len(S)\ncnt = 0\n# 0101010101\nfor i, s in enumerate(S):\n if i & 1 == 1:\n incr = 1 if s == '1' else 0\n cnt += i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s485355697', 's621911214', 's194335385'] | [3188.0, 3188.0, 3188.0] | [50.0, 46.0, 83.0] | [397, 357, 574] |
p03073 | u712082626 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\nx, count0, count1 = 0\nfor i in s:\n count0 = count0+1 if i==str(x) else count0\n x = int(not(x))\nx = 1\nfor i in s:\n count1 = count1 + 1 if i == str(x) else count1\n x = int(not(x))\nprint(min(count0, count1))', '\n\nv=input()\n\nif len(v)%2 != 0 and len(v) > 1:\n v += (str(int(not(v[le... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s294269650', 's923570943', 's475254140'] | [3188.0, 6516.0, 3188.0] | [17.0, 620.0, 115.0] | [228, 1371, 234] |
p03073 | u713465512 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['char_list = list(input())\ncount1 = 0\ncount2 = 0\nif len(char_list) == 1:\n print(count)\nelse:\n for i in char_list:\n if i % 2 == 0\n if char_list[i] is "0"\n continue\n else:\n count1 += 1\n else:\n if char_list[i] is "1"\n ... | ['Runtime Error', 'Accepted'] | ['s280137135', 's716404664'] | [2940.0, 3956.0] | [17.0, 64.0] | [664, 694] |
p03073 | u716270596 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['def main(s):\n pattern1 = ["0" if i % 2 == 0 else "1" for i in range(len(s))]\n pattern2 = ["1" if i % 2 == 0 else "0" for i in range(len(s))]\n dist1 = 0\n dist2 = 0\n for i in range(len(s)):\n if s[i] != pattern1[i]:\n dist1 += 1\n if s[i] != pattern2[i]:\n dist2 +... | ['Wrong Answer', 'Accepted'] | ['s616174305', 's790912813'] | [3064.0, 4724.0] | [17.0, 57.0] | [342, 426] |
p03073 | u728274111 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = str(input())\n\nprint(s)\ncount =0\nfor xi in range(len(s)):\n if xi%2 ==0:t="0"\n if xi%2 ==1:t="1"\n\n if s[xi]==t:\n count+=1\n\n# print(count)\nprint(min(count,len(s)-count))\n', 's = str(input())\n\nprint(s)\ncount =0\nfor xi in range(len(s)):\n if xi%2 ==0:t="0"\n if xi%2 ==1:t="1"\n\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s277378962', 's375347327', 's318058583'] | [9208.0, 9144.0, 9044.0] | [53.0, 52.0, 52.0] | [187, 187, 189] |
p03073 | u728615412 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['lis = [int(input()) for _ in range(6)]\nif lis[0]/min(lis[1:]) == 1:\n print(5)\nelse:\n print(lis[0]//min(lis[1:])+5)', 'lis = [int(input()) for _ in range(6)]\nif lis[0] % min(lis[1:]) == 0:\n print(5)\nelse:\n print(lis[0]//min(lis[1:])+5)', 'lis = [int(input()) for _ in range(6)]\nif lis[0] % min(lis[1:]) == ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s319398107', 's595679337', 's822313787', 's767634371'] | [3188.0, 3188.0, 3188.0, 36776.0] | [86.0, 86.0, 85.0, 102.0] | [116, 118, 121, 284] |
p03073 | u739843002 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = int(input())\n\nstart0 = 0\nstart1 = 0\nfor i in range(len(s)):\n if i % 2 == 0:\n if s[i] == "0":\n start1 += 1\n elif s[i] == "1":\n start0 += 1\n elif i % 2 == 1:\n if s[i] == "0":\n start0 += 1\n elif s[i] == "1":\n start1 += 1\n\nprint(min([start0, start1]))', 's = input()\n... | ['Runtime Error', 'Accepted'] | ['s801558751', 's500569687'] | [9132.0, 9176.0] | [71.0, 53.0] | [285, 281] |
p03073 | u741495664 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['str = input()\nS = list(str)\nN = len(S)\ncount = 0\nfor x in range(N):\n if x % 2 == 0 and S[x] == "0":\n count += 1\n elif x % 2 == 1 and S[x] == "1":\n count += 1\nif count >= 50000:\n print(count - 50000)\nelse:\n print(count)\n\n', 'N = int(input())\nH = [int(x) for x in input().split()... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s398456798', 's856857863', 's117154019'] | [3956.0, 3188.0, 3956.0] | [50.0, 85.0, 50.0] | [246, 173, 240] |
p03073 | u743076905 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['a = input()\nx = 0\ny = 0\nfor t in range(0,len(a)):\n if t%2 == 0 and a[t] == "1":\n x = x+1\n if a[t] == "0" and t%2 == 0:\n x = x+1\n \nfor t in range(0,len(a)):\n if t%2 == 0 and a[t] == "0":\n y = y+1\n if t%2 == 1 and a[t] == "1":\n y= y+1\n \nprint (min(y,... | ['Wrong Answer', 'Accepted'] | ['s512411529', 's295620997'] | [3188.0, 3188.0] | [90.0, 86.0] | [347, 312] |
p03073 | u747873993 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S=input()\nresult1=0\nresult2=0\nif S[0]=='1':\n for i in range(len(S)):\n if i%2==0:\n if S[i]=='0':\n result1+=1\n if S[i]=='1':\n result2+=1\n else:\n if S[i]=='1':\n result1+=1\n if S[i]=='0':\n ... | ['Runtime Error', 'Accepted'] | ['s371943325', 's428011482'] | [3064.0, 3188.0] | [17.0, 58.0] | [660, 659] |
p03073 | u748311048 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S=[]\nfor char in input():\n S.append(char)\n\n#route 2\nC2=0\nfor n in range(int(len(S))+1):\n if n%2==0:\n if S[n]==0:\n S[n]=1\n C2+=1\n else:\n if S[n]==1:\n S[n]=0\n C2+=1\n \n#route 1\nC1=0\nfor i in range(int(len(S))+1):\n if i%2==0:\n if S[i]==1:\n S[i]=0\n C1+=... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s008100254', 's022475264', 's027153509', 's317505869', 's371007073', 's474874134', 's481154545', 's492223944', 's589840554', 's648635562', 's652721048', 's745266381', 's799802019', 's883725679', 's899781159', 's849030201'] | [3996.0, 3964.0, 3188.0, 3992.0, 3992.0, 3996.0, 3064.0, 3956.0, 3064.0, 3956.0, 3064.0, 3956.0, 3996.0, 3188.0, 3956.0, 3956.0] | [49.0, 47.0, 18.0, 69.0, 68.0, 68.0, 17.0, 73.0, 17.0, 70.0, 17.0, 75.0, 68.0, 18.0, 73.0, 75.0] | [409, 413, 330, 388, 395, 380, 393, 388, 397, 393, 407, 323, 375, 322, 388, 323] |
p03073 | u760171369 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import numpy as np\nS = input()\nN = len(S)\nif N // 2 == 0:\n even = np.array([S[2*k] for k in range(N // 2)])\n odd = np.array([S[2*k + 1] for k in range(N // 2)])\n even_1 = even.sum()\n odd_1 = odd.sum()\n if even_1 > odd_1:\n print(N//2 - even_1 + odd_1)\n else:\n print(N//2 + even_1 - odd_1)\nelse:\... | ['Runtime Error', 'Accepted'] | ['s726849393', 's791492047'] | [13488.0, 13884.0] | [169.0, 193.0] | [557, 597] |
p03073 | u765325669 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s = str(input())\n\nprint(s)\n\ncnt = 0\nnew = s[0]\nfor idx in range(len(s[1:])):\n idx += 1\n if new[idx-1]==s[idx]:\n if s[idx] == '0':\n new+='1'\n else:\n new+='0'\n cnt += 1\n else:\n new+=s[idx]\nprint(cnt)", "s = str(input())\n\ncnt = 0\nnew = s[0]\nf... | ['Wrong Answer', 'Accepted'] | ['s896096090', 's112682619'] | [3316.0, 3188.0] | [73.0, 77.0] | [256, 246] |
p03073 | u770300100 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['n = list(map(int,list(input())))\nprint(n)\n\nnum = n[0]\ntotal = 0\nfor i in range(1,len(n)):\n if n[i] == n[i-1]:\n total += 1\n if n[i] == 1:\n n[i] = 0\n else:\n n[i] = 1\n\nprint(total)\n', 'n = list(map(int,list(input())))\n\nnum = n[0]\ntotal = 0\nfor i in range(1,... | ['Wrong Answer', 'Accepted'] | ['s868944355', 's903730316'] | [4652.0, 4652.0] | [67.0, 59.0] | [224, 214] |
p03073 | u772588522 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['from collections import Counter\n\ns = input()\nodd = [int(s[i]) for i in range(len(s)) if i % 2]\neven = [int(s[i]) for i in range(len(s)) if not i % 2]\n\nodd_c = Counter(odd)\nfreq_odd = odd_c.most_common()\neven_c = Counter(even)\nfreq_even = even_c.most_common()\n\nif len(odd) == 0 or len(even) == 0:\n count = ... | ['Runtime Error', 'Accepted'] | ['s222254828', 's481824201'] | [4340.0, 4084.0] | [61.0, 35.0] | [755, 435] |
p03073 | u776338097 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["def main():\n s = input()\n n = len(s)\n a = 0\n b = 0\n for i in range(n):\n if i & 1:\n if arr[i] == '1':\n a += 1\n else:\n b += 1\n else:\n if arr[i] == '1':\n b += 1\n else:\n a +=... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s345053159', 's405992778', 's957344941'] | [3188.0, 4012.0, 3188.0] | [17.0, 124.0, 35.0] | [350, 346, 342] |
p03073 | u779602548 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['\n# -*- coding: utf-8 -*-\n\ns = list(input())\n\ncnt1=0\nfor i in range(len(s)):\n if s[i] is i%2:\n cnt1 += 1\n\ncnt2=0\nfor i in range(len(s)):\n if s[i] is (i+1)%2:\n cnt2 += 1\n\nprint(min(cnt1,cnt2))', '\n# -*- coding: utf-8 -*-\n\ns = list(input())\n\ncnt1=0\nfor i i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s230707055', 's354676890', 's073421720'] | [3956.0, 3956.0, 3956.0] | [51.0, 56.0, 115.0] | [269, 273, 278] |
p03073 | u780962115 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s=str(input())\ncnt1=0\ncnt2=0\nfor i in range(len(s)):\n if i%2==0:\n if s[i]=="0":\n cnt1+=1\n print(s[i])\n else:\n continue\n if i%2!=0:\n if s[i]==1:\n cnt1+=1\n else:\n continue\n \n \n\n\nfor i in range(l... | ['Wrong Answer', 'Accepted'] | ['s050958461', 's504061617'] | [3956.0, 3188.0] | [114.0, 56.0] | [573, 253] |
p03073 | u785578220 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['a = input()\ns = 0\nt = 0\nk = ["0","1"]\nfor n,i in enumerate(a):\n if i != k[(n%2)]:\n s+=1\n if i != k[(n%2)+1]:\n t+=1\nprint(min(s,t))\n \n ', 'a = input()\ns = 0\nt = 0\nk = ["0","1"]\nfor n,i in enumerate(a):\n if i != k[(n%2)]:\n s+=1\n if i != k[(n+1)%2]:\n t+=1\nprint(min(s,t))\n \n '] | ['Runtime Error', 'Accepted'] | ['s849320496', 's195212705'] | [3188.0, 3188.0] | [17.0, 64.0] | [145, 145] |
p03073 | u785773061 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["tiles = input()\n\neven_0 = 0\neven_1 = 0\nodd_0 = 0\nodd_1 = 0\n\nfor i, t in enumerate(tiles):\n if i % 2 == 0:\n if t == '0':\n even_0 += 1\n else:\n even_1 += 1\n else:\n if t == '0':\n even_0 += 1\n else:\n even_1 += 1\n\nif even_0 + o... | ['Wrong Answer', 'Accepted'] | ['s279526594', 's276868046'] | [3188.0, 3188.0] | [46.0, 46.0] | [380, 417] |
p03073 | u790830953 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import math\nnumber = int(input())\nif (number != 0):\n digit = int(math.log10(number))\nelse :\n digit=0\n\na=[]\nwhile(True):\n if (number%10==0):\n a.append("0")\n elif (number%10!=0):\n a.append("1")\n \n number= int(number/10)\n if (number == 0):\n break\nb= []\ni = digi... | ['Runtime Error', 'Accepted'] | ['s692021112', 's706020187'] | [3316.0, 3188.0] | [87.0, 88.0] | [718, 540] |
p03073 | u803617607 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S=str(input())\ns=len(S)\nSk=[]\nSg=[]\nfor i in range(0,s,2):\n Sk.append(Sstr[i])\nfor i in range(1,s,2):\n Sg.append(Sstr[i])\nSk0=Sk.count('0')\nSk1=Sk.count('1')\nSg0=Sg.count('0')\nSg1=Sg.count('1')\nStotal=[Sk0,Sk1,Sg0,Sg1]\nif Sk0+Sg1<Sk1+Sg0:\n print(Sk0+Sg1)\nelse:\n print(Sk1+Sg0)", "S=int(inpu... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s014446872', 's038537155', 's740869227', 's874363428'] | [3188.0, 4212.0, 4212.0, 3956.0] | [19.0, 259.0, 257.0, 37.0] | [288, 324, 303, 282] |
p03073 | u812867074 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['n=input()\nli=list(n)\nif len(n)==1:\n print(0)\nelif len(n)%2==0 and len(n) != 1:\n counta=0 \n countb=0\n a=list("10"*int((int(n)/2)))\n b=list("01"*int((int(n)/2)))\n for i in range(len(n)):\n counta+= abs(int(li[i])-int(a[i]))\n countb+=abs(int(li[i])-int(b[i]))\n print(min(counta,countb))\n\nelif le... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s203086738', 's638075982', 's536730865'] | [171204.0, 171588.0, 5748.0] | [324.0, 325.0, 165.0] | [569, 555, 576] |
p03073 | u816935184 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s=input()\ns=list(s)\nn=len(s)\nacnt=1\nbcnt=1\nfor i in range(n):\n if i!=n-1 and s[i]==s[i+1]:\n a=s[:]\n if s[i]=='0':\n s[i]='1'\n else:\n s[i]='0'\n for j in range(n):\n if j!=n-1 and s[j]==s[j+1]:\n if s[j]=='0': \n ... | ['Wrong Answer', 'Accepted'] | ['s259173616', 's419136629'] | [4780.0, 4780.0] | [107.0, 97.0] | [871, 893] |
p03073 | u821432765 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['\nS = list(input())\n\ncount_1010 = 0\ncount_0101 = 0\n\n\nfor i in range(len(S)):\n \n if i % 2 == 0:\n if S[i] != "1":\n S[i] = "1"\n count_1010 += 1\n \n else:\n if S[i] != "0":\n S[i] = "0"\n count_1010 += 1\n\n\nfor j in range(len(S)):\n \n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s075413483', 's615514757', 's775909391', 's944582339'] | [3956.0, 3956.0, 3956.0, 3956.0] | [74.0, 69.0, 85.0, 65.0] | [715, 640, 732, 640] |
p03073 | u823885866 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import sys\n\nrr = lambda: sys.stdin.readline().rstrip()\n\ns = rr()\ncnt = 0\nfor i in range(len(s) - 1):\n si = s[i]\n si1 = s[i+1]\n if si & si1:\n continue\n else:\n s[i+1] = si\n cnt += 1\nprint(cnt)\n\n\n', "import sys\n\nrr = lambda: sys.stdin.readline().rstrip()\n\ns = list(rr())\ncnt = 0\nfor i ... | ['Runtime Error', 'Accepted'] | ['s084629940', 's447605950'] | [3188.0, 3956.0] | [17.0, 55.0] | [206, 240] |
p03073 | u826557401 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['import sys\nn,k = map(str, input().split())\ns = list(str(input()))\n\nzero_count_list = []\nzero_count = 0\none_count_list = []\none_count = 0\ns_size = len(s)\n\nfor index, i in enumerate(s):\n if i == "0":\n zero_count += 1\n else:\n if zero_count != 0:\n zero_count_list.append(zero_... | ['Runtime Error', 'Accepted'] | ['s073776667', 's186569968'] | [3064.0, 5512.0] | [17.0, 78.0] | [774, 546] |
p03073 | u827141374 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["\nS = input()\nc = 0\nzo = 0\noz = 0\nfor i in range(0, len(S), 2):\n if S[i] == '0':\n oz += 1\n else:\n zo += 1\n if S[i+1] == '0':\n zo += 1\n else:\n oz += 1\nif len(S) & 1:\n if S[-1] == '0':\n oz += 1\nprint(min(oz, zo))", "S = input()\nc = 0\nzo = 0 \noz = 0 # ... | ['Runtime Error', 'Accepted'] | ['s554740259', 's597057741'] | [3188.0, 3188.0] | [37.0, 36.0] | [275, 313] |
p03073 | u830742419 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = input()\nfirst = S[0]\ninverse = str(1-int(first))\nunit = first+inverse\nif len(S) % 2 == 0:\n sample = unit*len(S)//2\nelse:\n sample = unit*len(S)//2+first\n\ncount = 0\nfor k in range(len(S)):\n if S[k] != sample[k]:\n count += 1\n\nprint(count)\n', "if len(S) % 2 == 0:\n whiteS = '01'*len(S)//2\n bla... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s245873426', 's524319705', 's027337996'] | [3444.0, 3064.0, 3188.0] | [18.0, 17.0, 41.0] | [246, 390, 250] |
p03073 | u832039789 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['a=sum(i%2^int(c)for i,c in enumerate(input()));print(min(a,n-a))', '*s,=map(int,input())\nn=len(s)\na=sum(s[::2])+n//2-sum(s[1::2])\nprint(min(a,n-a))'] | ['Runtime Error', 'Accepted'] | ['s933971855', 's950570502'] | [3188.0, 4256.0] | [49.0, 33.0] | [64, 79] |
p03073 | u835482198 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s = input()\nn = len(s)\nif n % 2 == 1:\n n += 1\npattern = '01' * (n // 2)\n\nans_a = 0\nans_b = 0\nfor i, (a, b) in enumerate(zip(pattern[1:], pattern[:-1])):\n if pattern[i] != a:\n ans_a += 1\n if pattern[i] != b:\n ans_b += 1\nprint(min(ans_a, ans_b))\n", "s = input()\nn = len(s)\nif n % 2... | ['Wrong Answer', 'Accepted'] | ['s120590297', 's448180654'] | [3444.0, 3316.0] | [57.0, 57.0] | [267, 338] |
p03073 | u842964692 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['#ABC124_C\nS=input()\n \nS_rev=list(S)[::-1]\n \ns=0\nst0=0\nst1=0\n \ndef bit_count(x):\n x=bin(x)[2:]\n ans=0\n for i in range(len(x)):\n if int(x[i])==1:\n ans+=1\n return ans\n \n \nfor i in range(len(S)):\n if i%2==0:\n st0+=2**i\n else:\n st1+=2**i\n ... | ['Runtime Error', 'Accepted'] | ['s575592831', 's229135670'] | [3064.0, 3444.0] | [17.0, 100.0] | [461, 285] |
p03073 | u850417587 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = list(input())\nslen = len(s)\n\ncount_0 = 0\ncount_1 = 0\n\n#0-start\n\nfor i in s[0::2]:\n\tif i != \'0\':\n\t\tcount_0 += 1\nfor i in s[1::2]:\n\tif i != \'1\':\n\t\tcount_0 += 1\n\nfor i in s[0::2]:\n\tif i != \'1\':\n\t\tcount_1 += 1\nfor i in s[1::2]:\n\tif i != \'0\':\n\t\tcount_1 += 1\n\nprint("count_0:{}"... | ['Wrong Answer', 'Accepted'] | ['s997696973', 's246751752'] | [4268.0, 4268.0] | [38.0, 40.0] | [390, 317] |
p03073 | u851279551 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = list(input())\n\ncount = 0\nfor i,s in enumerate(S):\n if i!=0:\n if S[i-1] == s:\n count += 1\n if s == "0":\n S[i] = "1"\n else:\n S[i] = "0"\n print(S)\nprint(count)\n\n', 'S = list(input())\n\ncount = 0\nfor i,s in enumerate(S... | ['Runtime Error', 'Accepted'] | ['s059636494', 's110182296'] | [136364.0, 3956.0] | [1656.0, 53.0] | [246, 224] |
p03073 | u854093727 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = list(input())\nS = [int(i) for i in S]\nsum1,sum2 = 0,0\nfor i in range(len(S)):\n if i % 2 == 0:\n if S[i] == 0:\n sum1 += 1\n else:\n if S[i] == 1:\n sum1 += 1\n\nfor i in range(len(S)):\n if i % 2 == 0:\n if S[i] == 1:\n sum2 += 1\n else:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s568003878', 's871786595', 's322241374'] | [4652.0, 4652.0, 4652.0] | [86.0, 95.0, 84.0] | [413, 436, 396] |
p03073 | u855376994 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['if __name__ == "__main__":\n l = int(input())\n l = [int(x) for x in list(str(l))]\n length = len(l)\n temp1 = []\n temp2 = []\n for i in range(length):\n temp1.append(i % 2)\n temp2.append((i + 1) % 2)\n t1 = 0\n t2 = 0\n for n in range(length):\n if temp1[n] != l[n]:\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s292212850', 's829211568', 's454023044'] | [6500.0, 3188.0, 6756.0] | [328.0, 85.0, 106.0] | [398, 265, 398] |
p03073 | u856169020 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = list(map(str, input().split()))\n\nans = 0\nlast_str = ''\nfor s in S:\n if last_str == '':\n last_str = s\n elif (last_str == s) and s == '0':\n ans += 1\n last_str = '1'\n elif (last_str == s) and s == '1':\n ans += 1\n last_str = '0'\n else:\n pass\nprint(ans)", "S = list(str(input()))\n\... | ['Wrong Answer', 'Accepted'] | ['s953451400', 's888889089'] | [3188.0, 3956.0] | [17.0, 39.0] | [274, 229] |
p03073 | u857330600 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['l=str(input())\nn=0\nfor i in range(len(l)):\n if i%2==0,l[i]==0:\n n+=1\n if i%2==1,l[i]==1:\n n+=1\nprint(min(n,len(l)-n))', "l=str(input())\nn=0\nfor i in range(len(l)):\n if i%2==0 and l[i]=='0':\n n+=1\n if i%2==1 and l[i]=='1':\n n+=1\nprint(min(n,len(l)-n))"] | ['Runtime Error', 'Accepted'] | ['s528400053', 's128812419'] | [2940.0, 3188.0] | [17.0, 54.0] | [125, 137] |
p03073 | u858670323 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = str(input())\nans1=0\nfor i in range(len(s)):\n if(i%2==0 and s[i]!=0):ans1+=1\n if(i%2==1 and s[i]!=1):ans1+=1\nans2=0\nfor i in range(len(s)):\n if(i%2==0 and s[i]!=1):ans2+=1\n if(i%2==1 and s[i]!=0):ans2+=1\nans=min(ans1,ans2)\nprint(ans)', "s = str(input())\nans1=0\nfor i in range(len(s)):\n if(i%2==0 a... | ['Wrong Answer', 'Accepted'] | ['s467463005', 's875455253'] | [3188.0, 3188.0] | [95.0, 88.0] | [240, 249] |
p03073 | u858748695 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s=input()\nbf='01'*(len(s)//2)\nwf='10'*(len(s)//2)\nif len(s)%2==1:\n bf+='0'\n wf+='1'\nans=min(len([x!=y if x,y in zip(list(s),list(bf))]),len([x!=y if x,y in zip(list(s),list(wf))]))\nprint(ans)", "s=input()\nbf='01'*(len(s)//2)+'0'*(len(s)&1)\nwf='10'*(len(s)//2)+'1'*(len(s)&1)\nans=min(len([x!=y if x,y in zip... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s170705057', 's662783074', 's677197787', 's742196230', 's213416842'] | [2940.0, 2940.0, 2940.0, 2940.0, 4212.0] | [17.0, 17.0, 18.0, 17.0, 34.0] | [193, 163, 167, 169, 272] |
p03073 | u869763042 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = input()\nback = 0\nn = 0\nfor i in S:\n if i == back:\n back = '0' if i=='1' else '1'\n n += 1\n else:\n back = S\n\nprint(n);", "S = input()\nback = 0\nfor i in S:\n if i == back:\n back = '0' if i=='1' else '1'\n n += 1\n else:\n back = S\n\nprint(n);", "S =... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s151001970', 's803355207', 's388802841'] | [3188.0, 3188.0, 3188.0] | [28.0, 31.0, 34.0] | [147, 141, 147] |
p03073 | u870178975 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s=list(map(int,str(input())))\nprint(s)\nn=len(s)\na=0\nb=0\nfor i in range(n):\n if ((i%2)+s[i])%2==0:\n a+=1\n else:\n b+=1\nprint(n-max(a,b))', 's=list(map(int,str(input())))\nn=len(s)\na=0\nb=0\nfor i in range(n):\n if ((i%2)+s[i])%2==0:\n a+=1\n else:\n b+=1\nprint(n-max(a,b))'] | ['Wrong Answer', 'Accepted'] | ['s306183169', 's023357205'] | [4768.0, 3956.0] | [67.0, 61.0] | [142, 133] |
p03073 | u874333466 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = int(input())\nS_list = [int(x) for x in list(str(S))]\nS_str = str(S)\nS_list_1 = input().split('0')\nS_list_2 = input().split('1')\noutput = 0\n\nfor i in range(len(S_list_1)):\n output += int(S_list_1[i]) // 2\nfor i in range(len(S_list_2)):\n output += int(S_list_2[i]) // 2\n \nprint(output)", "S = int(inpu... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s314939976', 's545822686', 's569323211', 's047841204'] | [4852.0, 6116.0, 4852.0, 3956.0] | [412.0, 440.0, 412.0, 68.0] | [290, 284, 289, 310] |
p03073 | u875028418 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s=input()\ncount1=0\nfor i in range(0,len(s)-1,2):\n if s[i]=='0':\n count+=1\n if s[i+1]=='1':\n count+=1\nif len(s)%2==1:\n if s[len(s)-1]=='0':\n count+=1\nprint(min(count,len(s)-count))", "s=input()\ncount=0\nfor i in range(0,len(s)-1,2):\n if s[i]=='0':\n count+=1\n if s[i+1]=='1':\n count+=1... | ['Runtime Error', 'Accepted'] | ['s475924950', 's171259203'] | [3188.0, 3188.0] | [29.0, 35.0] | [191, 191] |
p03073 | u877415670 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = input()\nS = [int(i) for i in list(S)]\n\na = []\nb = True\nfor i in range(len(S)):\n if b:\n a.append(1)\n b=False\n else:\n a.append(0)\n b=True\nc = a[::-1]\n\ncombined1 = [abs(x-y) for (x, y) in zip(S, a)]\ncombined2 = [abs(x-y) for (x, y) in zip(S, c)]\n\nif len(S)==1:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s380774274', 's732271401', 's554738224'] | [6884.0, 6884.0, 7524.0] | [71.0, 292.0, 79.0] | [361, 371, 396] |
p03073 | u878481059 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['colors = input()\nl = len(colors)\ncount1 = 0\nfor i in range(l):\n\tif int(colors[i]) == (i % 2):\n\t\tcount1 += int(colors[i])\nprint(min(count1, l-count1))', 'l = len(colors)\ncount1 = 0\nfor i in range(l):\n\tif colors[i] == i % 2:\n\t\tcount1 += int(colors[i])\nprint(min(count1, l-count1))', 'colors = input()\nl... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s325549213', 's400552349', 's536891018', 's673418664', 's384238837'] | [3188.0, 2940.0, 2940.0, 2940.0, 3188.0] | [77.0, 17.0, 17.0, 17.0, 57.0] | [149, 125, 119, 132, 136] |
p03073 | u878831982 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = input()\nn = len(S)\ns0 = 0\ns1 = 0\nfor s in S:\n if s == "0":\n s0 += 1\n else:\n s1 += 1\n\nd = abs(s0 - s1)\ndd = int(d / 2)\nif (d % 2 == 0):\n dd += 2\n\nprint(d)', 'S = input()\nn = len(S)\ns0 = 0\ns1 = 0\n\nfor i in range(n):\n if i % 2 == 0:\n if S[i] != "0":\n ... | ['Wrong Answer', 'Accepted'] | ['s159549006', 's730461800'] | [3188.0, 3188.0] | [29.0, 47.0] | [180, 294] |
p03073 | u882937587 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['n = list(map(int, input()))\n\neven_list = list()\nodd_list = list()\n\neven_list = n[0::2]\nodd_list = n[1::2]\n\ncount_zero = 0\ncount_one = 0\n\n#print(len(even_list))\nfor i in range(len(even_list)):\n if even_list[i] == 1:\n count_zero += 1\nfor j in range(len(odd_list)):\n if odd_list[j] == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s362307978', 's106824097'] | [4768.0, 4640.0] | [88.0, 61.0] | [546, 518] |
p03073 | u883203948 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['data = [int(s) for s in input()]\ncount1 = 0\nif data[0] == 0:\n \n \n for s in range(1,len(data)-1):\n \n \n print(s)\n if s % 2 == 0:\n if data[s] != 0:\n count1 += 1\n \n else :\n if data[s] != 1:\n count1 += 1\n \nelse:\n \n \n for s i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s183355227', 's273216658', 's291007865'] | [4724.0, 4728.0, 3956.0] | [134.0, 130.0, 61.0] | [475, 483, 453] |
p03073 | u896741788 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['n=input()\ns,a="",""\nsd,ad=0,0\nfor i in range(len(n)):\n if i%2:\n s+="1"\n a+="0"\n else:\n s+="0"\n a+="1"\nfor i in range(n):\n if n[i]!=a[i]:ad+=1\n if n[i]!=s[i]:sd+=1\nprint(min(ad,sd))', 'n=input()\ns=""\na=""\nsd,ad=0,0\nfor i in range(len(n)):\n if i%2:\n s+="1"\n a+="0"\n else:\n ... | ['Runtime Error', 'Accepted'] | ['s944139124', 's823075456'] | [3316.0, 3316.0] | [56.0, 99.0] | [196, 201] |
p03073 | u902973687 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["S = input()\nn = len(S)\nT = ['{}'.format(i % 2) for i in range(n)]\nprint(T)\ntmp = 0\nfor i in range(n):\n if S[i] == T[i]:\n tmp += 1\nif tmp >= n - tmp:\n ans = n - tmp\nelse:\n ans = tmp\nprint(ans)\n", "S = input()\nn = len(S)\nT = ['{}'.format(i % 2) for i in range(n)]\ntmp = 0\nfor i in range(... | ['Wrong Answer', 'Accepted'] | ['s615004277', 's603267375'] | [5488.0, 3956.0] | [74.0, 68.0] | [208, 199] |
p03073 | u903722008 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['a = input()\nn = len(a)\nif n == 1:\n print(0)\nelse:\n count0 = 0 #start from 0\n count1 = 0 #start from 1\n for i in range(n):\n if i % 2 == 0:\n if a[i] ==1:\n count0 = count0 +1\n if a[i] ==0:\n count1 = count1 +1\n if i % 2 == 1:... | ['Wrong Answer', 'Accepted'] | ['s642028848', 's174310559'] | [3188.0, 3188.0] | [55.0, 94.0] | [478, 389] |
p03073 | u904943473 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['list1 = list(map(int,input().split()))\n\nprint(list1)', 'string = input()\nlist1 = []\nfor i in string:\n list1.append(int(i))\n \nprev = list1[0]\nsum = 0\nfor i, char in enumerate(list1):\n if (i > 0):\n if (char == prev):\n prev = 1 if char == 0 else 0\n sum += 1\n else:\n prev = char\npri... | ['Wrong Answer', 'Accepted'] | ['s526919706', 's123266633'] | [3444.0, 3956.0] | [239.0, 69.0] | [52, 253] |
p03073 | u905582793 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\nans10 = 10**12\nans01 = 10**12\nfor i in range(len(s)):\n if i%2==0:\n if s[i]=="0":\n ans10+=1\n if s[i]=="1":\n ans01+=1\n if i%2==1:\n if s[i]=="1":\n ans10+=1\n if s[i]=="0":\n ans01+=1\nprint(min(ans10,ans01))', 's = input()\nans10 = 0\nans01 = 0\nfor i in range(len... | ['Wrong Answer', 'Accepted'] | ['s680419346', 's638846066'] | [3188.0, 3188.0] | [66.0, 64.0] | [247, 237] |
p03073 | u905715926 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['str = input()\ncnt = 0\nnum = 0\nfor i in str:\n if cnt % 2 == 0:\n if i == 0:\n num += 1\n else:\n if i == 1:\n num += 1\n cnt += 1\n\ncnt2 = 0\nnum2 = 0\nfor i in str:\n if cnt2 % 2 == 0:\n if i == 1:\n num2 += 1\n else:\n if i == 0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s060764826', 's310347868', 's857004220'] | [3188.0, 3188.0, 3188.0] | [63.0, 69.0, 68.0] | [354, 357, 359] |
p03073 | u912158215 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = input()\nn = len(S)\ncnt = 0\ncntA = 0\ncntB = 0\nfor i in range(n):\n \n if i%2 == 0:\n if S[i] == 1:\n cntA += 1\n if i%2 != 0:\n if S[i] == 0:\n cntA += 1\n \n if i%2 == 0:\n if S[i] == 0:\n cntB += 1\n if i%2 != 0:\n if S[i] == 1:\... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s804016568', 's902972021', 's468399042'] | [3188.0, 3188.0, 3188.0] | [79.0, 53.0, 46.0] | [467, 367, 371] |
p03073 | u914330401 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = input()\nz_count = 0\no_count = 0\nk_count = 0\ng_count = 0\nfor i in range(len(S)):\n if S[i] == "0":\n z_count += 1\n if i % 2 == 0:\n g_count += 1\n else:\n k_count += 1\n else:\n o_count += 1\n if i % 2 == 0:\n g_count += 1\n else:\n k_count += 1\n \nif z_count <= o_... | ['Runtime Error', 'Accepted'] | ['s152093993', 's861193411'] | [3064.0, 3188.0] | [17.0, 123.0] | [422, 219] |
p03073 | u914642030 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["import math\nimport os\nimport random\nimport re\nimport sys\nfrom collections import defaultdict\n\nsys.stdin = open('input.in', 'r')\nsys.stdout = open('output.out', 'w') \n\ndef onezero(a):\n\tcount = 0\n\tfor i in range(0, len(a), 2):\n\t\tif a[i] == 0:\n\t\t\tcount += 1\n\tfor i in range(1, len(a), 2):\n\t\tif a... | ['Runtime Error', 'Accepted'] | ['s842052762', 's214623697'] | [3952.0, 4976.0] | [26.0, 59.0] | [620, 624] |
p03073 | u918935103 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | [' = list(input())\ncount = 0\nn = len(s)\nif n % 2 == 0:\n for i in range(0,int((n/2)-1)):\n if s[(2*i)+1] == "0":\n count = count + 1\n for i in range(0,int((n/2)-1)):\n if s[2*i] == "1":\n count = count + 1\nelse:\n for i in range(0,int((n-1)/2)):\n if s[2*i] == "0... | ['Runtime Error', 'Accepted'] | ['s089680979', 's290083388'] | [2940.0, 3956.0] | [17.0, 41.0] | [482, 475] |
p03073 | u934788990 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = int(input())\ncount = 0\nfor i in ragen(len(s)):\n if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):\n pass\n else:\n count += 1\nprint(min[count,len(s) - count])', 's = int(input())\ncount = 0\nfor i in ragen(len(s)):\n if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s881889974', 's946793011', 's671326566'] | [3188.0, 3188.0, 3956.0] | [85.0, 87.0, 66.0] | [188, 180, 204] |
p03073 | u941753895 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s=input()\nc1=c2=0\nf1='0'\nf2='1'\nfor x in s:\n if f1==x:\n pass\n else:\n c1+=1\n if f1=='0':\n f1='1'\n else:\n f1='0'\nfor x in s:\n if f2==x:\n pass\n else:\n c2+=1\n if f2=='0':\n f2='1'\n else:\n f2='0'\nprint(c1,c2)\nprint(min(c1,c2))", "import math,string,itertools,fractions,... | ['Wrong Answer', 'Accepted'] | ['s395625533', 's177749183'] | [3188.0, 6316.0] | [57.0, 55.0] | [252, 634] |
p03073 | u943057856 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['S = list(input())\na=0\nb=0\nif S[0]=="0":\n for i in S[::2]:\n print(i)\n if i=="1":\n a+=1\n for k in S[1::2]:\n if k=="0":\n a+=1\n\nif S[0]=="1":\n for i in S[::2]:\n if i=="0":\n b+=1\n for k in S[1::2]:\n if k=="1":\n b+=... | ['Wrong Answer', 'Accepted'] | ['s299125580', 's243025272'] | [5028.0, 4268.0] | [52.0, 38.0] | [317, 224] |
p03073 | u946304145 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s = input()\nsize = len(s)\n\ndef poe(b):\n res = 0\n for i in range(size):\n if b:\n a = '1' if i % 2 == 0 else '0'\n else:\n a = '0' if i % 2 == 0 else '1'\n \n if a != s[i]:\n res+=1\n\n return res\n\nprint (poe(True), poe(False))\n", "s = input()\nsize = len(s)\n\ndef poe(b):\n res = 0... | ['Wrong Answer', 'Accepted'] | ['s904266012', 's750532363'] | [3188.0, 3188.0] | [54.0, 52.0] | [245, 249] |
p03073 | u949692208 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = [int(x) for x in list(input())]\na = [x%2 for x in range(len(s))]\nb = [(1 - x%2) for x in range(len(s))]\nc1=0\nc2=0\nfor i in range(len(s)):\n if a[i] != s[i]:\n c1 += 1\n if b[i] != s[i]:\n c2 += 1\n\np', 's = [int(x) for x in list(input())]\na = [x%2 for x in range(len(s))]\nb = [(1 - x%2)... | ['Runtime Error', 'Accepted'] | ['s943900053', 's791676083'] | [5404.0, 5404.0] | [89.0, 90.0] | [218, 236] |
p03073 | u952708174 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["def c_coloring_colorfully(S):\n s1 = '10' * (len(S) // 2) + ('1' if len(S) % 2 == 1 else '')\n s2 = '01' * (len(S) // 2) + ('0' if len(S) % 2 == 1 else '')\n ans1, ans2 = 0, 0\n for k, s in enumerate(S):\n if s != s1[k]:\n ans1 += 1\n if s != s2[k]:\n ans2 += 1\n ret... | ['Runtime Error', 'Accepted'] | ['s152695588', 's056504591'] | [3188.0, 3188.0] | [17.0, 18.0] | [373, 283] |
p03073 | u960171798 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['N = int(input())\nH = list(map(int, input().split()))\nans = 1\nfor i in range(1,N):\n if H[i]>=max(H[:i]):\n ans += 1\nprint(ans)', "s = input()\na = s[::2].count('0') + s[1::2].count('1')\nprint(min(a, len(s)-a))\n"] | ['Runtime Error', 'Accepted'] | ['s733941320', 's786769094'] | [3188.0, 3188.0] | [85.0, 18.0] | [128, 79] |
p03073 | u960387251 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['List=input()\ns = len(List)\na = [0] * s\nb = [0] * s\nb[1::2] = [1] * (s//2)\nif s % 2 == 0:\n\ta[0::2] = [1] * (s//2)\nelse:\n\ta[0::2] = [1] * (s//2 + 1)\n\nc1 = 0\nc2 = 0\n\nfor i,j = zip(List,a):\n\tif i != j:\n c1 += 1\n\nfor i,j = zip(List,b):\n\tif i != j:\n c2 += 1\n\nif c1 >= c2:\n\tprint(c2)\nels... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s333585104', 's484677009', 's629418877', 's653471306', 's763822171', 's848118163', 's253475762'] | [3060.0, 2940.0, 5620.0, 3060.0, 2940.0, 2940.0, 5620.0] | [17.0, 17.0, 63.0, 18.0, 17.0, 17.0, 107.0] | [306, 329, 304, 333, 325, 344, 324] |
p03073 | u960783046 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['print("0")', 'Tiles=input()\nN_len=len(Tiles)\nif N_len == 1:\n print("0")\n exit\n \ncur=Tiles[0]\n\nchange=0\nfor i in range(1, N_len):\n if cur is TilePuttern[i]:\n change+=1\n cur = "0" if Tiles[i] == 0 else "1"\n else:\n cur=Tiles[i]\n \nchange_reverse=0\ncur=Tiles[N_le... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s072475138', 's562549833', 's796263215', 's983468105', 's771649048'] | [2940.0, 3188.0, 5336.0, 3064.0, 3188.0] | [17.0, 18.0, 250.0, 19.0, 80.0] | [10, 522, 887, 2016, 197] |
p03073 | u969848070 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["a = input()\nl1 = a[::2]\nl2 = a[1::2]\nx, y = 0, 0\nfor i in range(len(l1)):\n if l1[i] =='1':\n x +=1\nif i in range(len(l2)):\n if l2[i] =='0':\n y +=1\nprint(min(x +y,len(l1)-x + len(l2)-y))", "a = input()\nl1 = a[::2]\nl2 = a[1::2]\nx, y = 0, 0\nfor i in range(len(l1)):\n if l1[i] =='1':\n x +=1\nfor... | ['Wrong Answer', 'Accepted'] | ['s495340579', 's293765016'] | [3188.0, 3316.0] | [26.0, 34.0] | [192, 193] |
p03073 | u970082363 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['color = [int(i) for i in input()]\nn = len(color)\nans = 0\n\nif n%2==1:\n arfa = [10]*n//2 + [1]\n beta = [01]*n//2 + [0]\nelse:\n arfa = [10]*n//2\n beta = [01]*n//2\n\nansa=0;ansb=0\nfor i in range(n):\n if color[i]!=arfa[i]:\n ansa += 1\n if color[i]!=beta[i]:\n ansb += 1\nprint(mi... | ['Runtime Error', 'Accepted'] | ['s204701034', 's234776746'] | [2940.0, 6156.0] | [17.0, 74.0] | [317, 329] |
p03073 | u978167553 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ["s = input()\n\nans0 = 0\nans1 = 0\nfor i, s_i in enumerate(s):\n if i % 2 == 0:\n if s_i == '0':\n ans1 += 1\n else:\n ans0 += 1\n else:\n if s_i == '0':\n ans0 += 1\n else:\n ans1 += 1\nprint(ans0, ans1)\nprint(min(ans0, ans1))\n", "s = in... | ['Wrong Answer', 'Accepted'] | ['s148919855', 's066466190'] | [9160.0, 9172.0] | [52.0, 46.0] | [291, 273] |
p03073 | u979362546 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = list(map(int, input().split()))\nt = s.copy()\nx = 0\ny = 1\n\nif t[0] == 0:\n t[0]=1\nelse:\n t[0]=0\n\nfor i in s:\n if s[i+1]==0 and s[i+1] == s[i]:\n \ts[i+1]=1\n \tx +=1\n elif s[i+1]==1 and s[i+1]==s[i]:\n \ts[i+1]=0\n \tx +=1', 's = list(map(int, input().split()))\nt = s.copy()\nx =... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s418722374', 's443483168', 's625975670', 's629142997', 's977724684', 's999923548', 's841384308'] | [3188.0, 3188.0, 3064.0, 3188.0, 3188.0, 3188.0, 4852.0] | [86.0, 86.0, 17.0, 86.0, 86.0, 85.0, 123.0] | [240, 104, 394, 397, 430, 49, 427] |
p03073 | u981853376 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\na = s[::2].count(0) + s[1::2].count(1)\nb = s[::2].count(1) + s[1::2].count(0)\nprint(min(a, b)', 's = input()\na = s[::2].count(0) + s[1::2].count(1)\nb = s[::2].count(1) + s[1::2].count(0)\nprint(min(a, b))', "s = input()\na = s[::2].count('0') + s[1::2].count('1')\na = s[::2].count('1') + s[1::2].coun... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s039216306', 's247575696', 's307440392', 's687153052', 's071631716'] | [2940.0, 3188.0, 3188.0, 3188.0, 3188.0] | [17.0, 17.0, 19.0, 18.0, 19.0] | [105, 106, 114, 114, 115] |
p03073 | u990556814 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['a = list(str(input()))\ncounter = 0\nif len(a) == 1:\n counter = 0\nelse:\n for i in range(1,len(a)):\n if a[i] == a[i-1]:\n counter += 1\n else:\n pass\nprint(counter) ', "a = list(str(input()))\ncounter = 0\nif len(a) == 1:\n counter = 0\nelse:\n for i in range(1,len... | ['Wrong Answer', 'Accepted'] | ['s177921441', 's564018878'] | [3956.0, 3956.0] | [45.0, 57.0] | [202, 286] |
p03073 | u991075981 | 2,000 | 1,048,576 | N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N. The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`. You want to repaint some of the tiles black or white, so that any two a... | ['s = input()\nset = [0, 1]\ndiff = 0\n\nfor i in range(len(s)):\n set.reverse()\n print(s)\n if set[1] == int(s[i]):\n diff += 1\n\nprint(min([diff, len(s)-diff]))\n', 's = input()\nset = [0, 1]\ndiff = 0\n\nfor i in range(len(s)):\n set.reverse()\n if set[1] == int(s[i]):\n diff += 1\n\np... | ['Runtime Error', 'Accepted'] | ['s725751722', 's218243306'] | [134336.0, 3188.0] | [169.0, 63.0] | [169, 156] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.