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 | u265065462 | 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\n# 1\nn = len(s)\ncase0=0\ncase1=0\n\nfor i in range(n):\n if (i%2==0):\n if s[i]=='0':\n case0 += 1\n else:\n case1 += 1\n\nprint(min(case0,case1))", "s = input()\nn = len(s)\ncase0=0\ncase1=0\n\nfor i in range(n):\n if (i%2==0):\n if s[i]=='0':\n case0 += 1\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s638046909', 's514392969'] | [3188.0, 3316.0] | [38.0, 48.0] | [165, 232] |
p03073 | u265401619 | 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(int(input()))\nflag = 0\nfor i in range(len(s)-1):\n if s[i] == '1' and s[i+1] == '1':\n s[i+1] = '0'\n flag += 1\n elif s[i] == '0' and s[i+1] == '0':\n s[i+1] = '1'\n flag += 1\nprint(flag)\n", "s = list(str(input()))\nflag = 0\nfor i in range(len(s)-1):\n if s[i] == '1' and s[i+1] == '1':\n... | ['Runtime Error', 'Accepted'] | ['s911521732', 's554225618'] | [3188.0, 3956.0] | [85.0, 59.0] | [206, 205] |
p03073 | u266171694 | 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\nprev = s[0]\ncount = 0\nfor i in range(1, len(s)):\n print(s)\n if prev == s[i]:\n count += 1\n\n if prev == '0':\n s[i] = '1'\n else:\n s[i] = '0'\n\n prev = s[i]\n\nprint(count)", "s = list(input())\n\ncount1 = 0\ncount2 = 0\n\nfor i in rang... | ['Runtime Error', 'Accepted'] | ['s083311115', 's238546521'] | [136288.0, 3956.0] | [1653.0, 79.0] | [237, 309] |
p03073 | u269145280 | 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\n\nS = input()\n\ntile_color = []\nfor i in S:\n tile_color.append(int(i))\n\ncandidate = np.zeros((2,len(S)))\ncandidate[0, 0::2] = 1\ncandidate[1, 1::2] = 1\n\ndistance = [np.sum(np.abs(candidate[0,:] - tile_color)), np.sum(np.abs(candidate[1,:] - tile_color))]\n\nprint(min(distance))', 'impor... | ['Wrong Answer', 'Accepted'] | ['s504322896', 's861206122'] | [16864.0, 16892.0] | [193.0, 197.0] | [295, 300] |
p03073 | u269171164 | 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()\nsum01 = 0\nsum10 = 0\n\nif S[0:1] == '0':\n for i in range(len(S)-1):\n if (i % 2) == 0:\n if S[i+1:i+2] == 1:\n sum01 += 1\n if (i % 2) == 1:\n if S[i+1:i+2] == 0:\n sum01 += 1\n\nelse:\n for i in range(len(S)-1):\n if (i % 2) == 0:\n if S[i+1:i+2] == 0:\n ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s216675861', 's250447397', 's603272926', 's608167071', 's882948498', 's994657915', 's609976071'] | [3316.0, 2940.0, 3188.0, 3188.0, 3188.0, 2940.0, 3188.0] | [59.0, 17.0, 98.0, 62.0, 94.0, 17.0, 105.0] | [440, 378, 377, 449, 377, 386, 379] |
p03073 | u284363684 | 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... | ['# input\nS = list(input())\n\n\nlength = len(S)\nif len == 1:\n print(0)\nelse:\n bwb = ["0", "1"]\n wbw = ["1", "0"]\n cnt = [0] * 2\n for i in range(length):\n if S[i] == bwb[i % 2]:\n cnt[0] += 1\n if S[i] == wbw[i % 2]:\n cnt[1] += 1\n\n print(min([cnt]))', '#... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s009682921', 's038254880', 's757526787', 's960874588'] | [3956.0, 3956.0, 3060.0, 3956.0] | [64.0, 65.0, 17.0, 70.0] | [303, 303, 280, 301] |
p03073 | u290148197 | 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\nb = 0\nfor index, i in enumerate(s):\n if int(i) == index%2:\n a+=1\n else:\n b+=1', 's = input()\na = 0\nb = 0\nfor index, i in enumerate(s):\n if int(i) == index%2:\n a+=1\n else:\n b+=1\n \nprint(min(a, b))'] | ['Wrong Answer', 'Accepted'] | ['s971615932', 's799653736'] | [3188.0, 3188.0] | [61.0, 65.0] | [103, 125] |
p03073 | u298288339 | 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)\ny = int()\nc = int()\nfor i in range(n):\n\tif i % 2 ==0:\n\t\tx = "0"\n\telse:\n\t\tx ="1"\n\tif S[i] == x:\n\t\tc += 1\n\t\tprint(i, S[i],x,"OK")\n\telse:\n\t\ty += 1\n\t\tprint(i,S[i],x)\n\nif c < y:\n\tprint(c,"εγ§γγγΎγ")\nelse:\n\tprint(y,"εγ§γγγΎγ")\n\n', 'S = input()\nn =len(S)\ny = int()\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s117365462', 's504581841', 's283872738'] | [4892.0, 4892.0, 3188.0] | [234.0, 212.0, 50.0] | [264, 264, 224] |
p03073 | u298413997 | 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()\ns1 = '0'\ns2 = '1'\nc1 = 0\nc2 = 0\n\nfor i in range(len(S)):\n if i == 0:\n s1 = '0'\n s2 = '1'\n elif i % 2 == 1:\n s1 += 1\n s2 += 0\n else:\n s1 += 0\n s2 += 1\n\nfor i in range(len(S)):\n if S[i] == s1[i]:\n c2 += 1\n else:\n c1 ... | ['Runtime Error', 'Accepted'] | ['s304382348', 's058193776'] | [3188.0, 3316.0] | [19.0, 87.0] | [321, 311] |
p03073 | u301624971 | 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(input())\n\ncounter=0\n\npre = N.pop(0)\nfor n in N:\n print(pre,end=" ")\n if(pre == n):\n counter+=1\n if(pre == "0"):\n pre="1"\n else:\n pre="0"\n\nprint(pre)\nprint(counter)\n', 'def modelAnswer(s:list) -> int:\n white = "1"\n ans_w = 0\n black = "0"\n ans_b = 0\n ... | ['Wrong Answer', 'Accepted'] | ['s493509312', 's713937237'] | [4648.0, 3956.0] | [134.0, 35.0] | [204, 387] |
p03073 | u304593245 | 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... | ['\ndef solve():\n cnt0 = 0\n cnt1 = 0\n if N%2 == 0:\n for i in range(1,N,2):\n if S[i-1] != "0":\n cnt0 += 1\n if S[i] != "1":\n cnt0 += 1\n if S[i-1] != "1":\n cnt1 += 1\n if S[i] != "0":\n cnt1 +=... | ['Wrong Answer', 'Accepted'] | ['s729695656', 's656617654'] | [9228.0, 9144.0] | [46.0, 45.0] | [722, 150] |
p03073 | u304630225 | 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(input())\nprint(min(A[::2].count("0"),A[::2].count("1"))+min(A[1::2].count("0"),A[1::2].count("1")))\n', 'L=list(input())\nif L[::2].count("0") > L[1::2].count("0") :\n print( L[::2].count("1")+L[1::2].count("0"))\nelse :\n print( L[::2].count("0")+L[1::2].count("1"))'] | ['Wrong Answer', 'Accepted'] | ['s587605308', 's298804283'] | [4264.0, 4268.0] | [24.0, 23.0] | [107, 160] |
p03073 | u305422591 | 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(i) for i in input().split()]\nN = len(S)\n\ndis1 = 0\ndis2 = 0\nstart = 0\nfor i in range(N):\n if (S[i]!=1-start):\n dis1 += 1\n if (S[i]!=start):\n dis2 += 1\n start = 1-start\nres = min(dis1, dis2)\nprint (res)', 's = input()\nS = [int(s[i]) for i in range(len(s))]\nN = len(S)\n \nd... | ['Wrong Answer', 'Accepted'] | ['s517086417', 's707640353'] | [3316.0, 4084.0] | [91.0, 79.0] | [232, 246] |
p03073 | u307426615 | 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 subtract_lst (lst1, lst2, ans):\n for i in range(len(lst1)):\n e1 = lst1[i]\n e2 = lst2[i]\n if e1 != e2:\n ans += 1\n return ans\n\nif __name__ == \'__main__\':\n s = input()\n a = ""\n b = ""\n for i in range(len(s) // 2):\n a = a + "10"\n b = b + "01"... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s623476507', 's980711618', 's883523481'] | [3316.0, 3316.0, 3316.0] | [32.0, 32.0, 59.0] | [429, 430, 478] |
p03073 | u308460366 | 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\na = input()\nS = [int(c) for c in a]\n\nans = 0\n\nif S[0] == 0:\n\tnxt = 1\nelse:\n\tnxt = 0\n\nfor i, tar in enumerate(S):\n\tif tar == 0:\n\t\tnxt = 1\n\telse:\n\t\tnxt = 0\n\n\tif i!=len(S)-1 and S[i] == S[i+1]:\n\t\tS[i+1] = nxt\n\t\tans += 1\n\t\n\nprint(S,ans)\n', 'import sys\n\na = input()\nS = ... | ['Wrong Answer', 'Accepted'] | ['s977390459', 's715957387'] | [4852.0, 3956.0] | [94.0, 86.0] | [245, 243] |
p03073 | u311488536 | 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()\nchecker = '0'\nans = 0\nfor i in range(len(S)):\n if checker != S[i]:\n ans+=1\n if i%2==0:\n checker = '0'\n else:\n checher = '1'\ntmp = ans\nans = 0\nchecker = '1'\nfor i in range(len(S)):\n if checker != S[i]:\n ans+=1\n if i%2==0:\n checker = '1'\n else:\n checher = '0'\nprin... | ['Wrong Answer', 'Accepted'] | ['s373666343', 's748846534'] | [9116.0, 9404.0] | [69.0, 48.0] | [313, 228] |
p03073 | u312470849 | 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()\np= len(n)\n\no = 0\n\nfor i in range(p):\n if i % 2 == 0:\n if n[i] == '0':\n o= o+1\n \n else:\n if n[i] =='1':\n o= o+1\n\nif ans>p/2:\n print(p-o)\nelse:\n print(o)", "\nm=input()\nround = len(m)\n\nn = 0\n\nfor i in range(round):\n if i % 2 ... | ['Runtime Error', 'Accepted'] | ['s382551506', 's169100465'] | [3188.0, 3188.0] | [42.0, 42.0] | [220, 251] |
p03073 | u314089899 | 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... | ['# -*- coding: utf-8 -*-\n\nS = str(input())\n\nans=0\n\nif len(S)==1:\n ans=0\nelif len(S)==2:\n if S[0]==S[1]:\n ans=1\n else:\n ans=0\nelse: \n strint=[]\n original_string=[]\n \n for i in range(len(S)):\n string.append(S[i])\n original_string.append(S[i])\n \n for i in range(len(S)-2):\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s253597791', 's776850996', 's459348310'] | [3188.0, 3316.0, 3188.0] | [17.0, 17.0, 62.0] | [817, 819, 448] |
p03073 | u327532412 | 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()\nodd = S[1::2]\neven = S[::2]\nprint(min(odd.count("1") + even.count("0"), even.count("0") + odd.count("1")))', 'S = input()\nodd = S[1::2]\neven = S[::2]\nprint(min(odd.count("1") + even.count("0"), even.count("1") + odd.count("0")))'] | ['Wrong Answer', 'Accepted'] | ['s259045193', 's793287631'] | [3188.0, 3188.0] | [18.0, 18.0] | [118, 118] |
p03073 | u330314953 | 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())\nl=len(s)\n\nt="01"*(-((-1)*l//2))\nu="10"*(-((-1)*l//2))\n\nx=0\ny=0\n\ndef test(x,y):\n for i in range(l):\n if s[i] != t[i]:\n x += 1\n\n elif s[i] != u[i]:\n y += 1\n\n\n\nprint(min(x,y))\n', 's = input()\ncnt = 0\n\nt = "01"*(-((-1)*len(s)//2))\n\ncnt_1 = 0\n... | ['Wrong Answer', 'Accepted'] | ['s148971003', 's174901987'] | [3316.0, 3188.0] | [17.0, 42.0] | [227, 190] |
p03073 | u337626942 | 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=len(s)\n\nans=0\n\nif s[0]=="0":\n for i in range(1,l):\n if i%2 != 0:\n if s[i] != "1":\n ans+=1\n \n if i%2 == 0:\n if s[i] != "0":\n ans+=1\n\nelse:\n for i in range(1,l):\n if i%2 != 0:\n if s[i] != "0":\n ... | ['Runtime Error', 'Accepted'] | ['s708005708', 's846226808'] | [3064.0, 3188.0] | [17.0, 50.0] | [405, 415] |
p03073 | u344030307 | 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()))\n\nn = int(len(s)/2)\n\na = [0]*len(s)\nb = [0]*len(s)\n\nfor i in range(n):\n a[2*i] = 0\n a[2*i+1] = 1\n b[2*i] = 1\n b[2*i+1] = 0\n\nif len(s)%2 ==1:\n a[len(s)-1] = 0\n b[len(s)-1] = 1 \n\nprint(a)\nprint(b)\n\nan = 0\nbn = 0\n\nfor j in range(len(s)):\n if a[j] != s[j]:\n an ... | ['Wrong Answer', 'Accepted'] | ['s874237924', 's838953102'] | [12144.0, 11008.0] | [94.0, 81.0] | [348, 331] |
p03073 | u344888046 | 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())\nL = len(S)\n\ndef change():\n global kk\n if kk == "1":\n kk = "0"\n else:\n kk = "1"\n\n# case 1\ncount_1 = 0\nkk = "1"\nfor c in range(L):\n print(kk)\n if kk == S[c]:\n pass\n else:\n count_1 += 1\n change()\n \n\n# case 2\ncount_2 = 0\nkk = "0... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s022518581', 's038196943', 's746828447'] | [4648.0, 4004.0, 3956.0] | [135.0, 73.0, 87.0] | [458, 454, 444] |
p03073 | u345483150 | 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())\nt=s[::2]\nu=s[1::2]\na=t.count(0)\nb=u.count(0)\nif a>=b:\n print(len(t)-a+b)\nelse:\n print(len(t)-b+a)', 's=input()\na=s[0]\ncnt=0\nfor i in s[1:]:\n if i==a:\n cnt+=1\n if i=="0":\n a="1"\n else:\n a="0"\n else:\n a=i\nprint(cnt)'] | ['Runtime Error', 'Accepted'] | ['s234903120', 's573022141'] | [3188.0, 3188.0] | [86.0, 32.0] | [114, 168] |
p03073 | u347452770 | 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\nn = len(s)\n\nfor i in range(n-1):\n if s[i] == s[i+1]:\n if s[i] == 0:\n s[i+1] = 1\n else:\n [i] = 0\n\nprint(s)', 's = list(map(int,input()))\n\nn = len(s)\n \nans_l = 0\nfor i in range(n-1):\n if s[i] == s[i+1]:\n ans_l += 1\n if s[i] == 0:\n s[i+1] = 1\n else:\... | ['Runtime Error', 'Accepted'] | ['s065634218', 's242910775'] | [3188.0, 3956.0] | [86.0, 69.0] | [140, 183] |
p03073 | u358254559 | 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\nimport math\n\neven_s=[]\nodd_s=[]\n\nfor i in range(len(S)):\n if i%2 == 0:\n even_s.append(int(S[i]))\n else:\n odd_s.append(int(S[i]))\n\ne_num = sum(even_s)\no_num = sum(odd_s)\n\nres = int(math.ceil(len(S)/2)) - max(e_num,o_num) + min(e_num,o_num)\n\n\np... | ['Wrong Answer', 'Accepted'] | ['s607289197', 's169538645'] | [4084.0, 4084.0] | [61.0, 62.0] | [308, 338] |
p03073 | u363768711 | 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 = s[::2].count('0') + s[1::2].count('1')\nprint(min(t, len(s)))", "s = input()\nt = s[::2].count('0') + s[1::2].count('1')\nprint(min(t, len(s)-t))"] | ['Wrong Answer', 'Accepted'] | ['s410192515', 's873092975'] | [3188.0, 3188.0] | [18.0, 18.0] | [76, 78] |
p03073 | u368796742 | 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())\ncount = 0\nfor i in range(1,n):\n if s[i] == s[i-1]:\n if s[i] == "0":\n s[i] = "1"\n else:\n s[i] = "0"\n count += 1\nprint(count)', 's = list(input())\n\ncount = 0\nfor i in range(1,len(s)):\n if s[i] == s[i-1]:\n if s[i] == "0":\n s[i] = "1"\n else:\n s[i] = ... | ['Runtime Error', 'Accepted'] | ['s825368708', 's127686014'] | [3956.0, 3956.0] | [19.0, 52.0] | [161, 173] |
p03073 | u370429695 | 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()\ncnt1 = 0\ncnt2 = 0\nfor i in range(len(s)):\n if i%2 == 0:\n if s[i] == "0":\n cnt1 += 1\n else:\n cnt2 += 1\n else:\n if s[i] == "1":\n cnt2 += 1\n else:\n cnt1 += 1\nprint(min(cnt1,cnt2))', 's = input()\ncnt1 = 0\ncnt2 = 0\nf... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s287629831', 's381287972', 's534760186', 's548899589', 's695223882', 's525164941'] | [3188.0, 3188.0, 5364.0, 4724.0, 5364.0, 3188.0] | [44.0, 17.0, 142.0, 69.0, 133.0, 47.0] | [266, 266, 266, 360, 267, 266] |
p03073 | u371385198 | 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 = '0b' + input()\ns1 = '0b' + '10' * (len(S) // 2) + '1' * (len(S) % 2)\ns2 = '0b' + '01' * (len(S) // 2) + '0' * (len(S) % 2)\nSs1 = bin(int(S, 2) ^ int(s1, 2))[2:]\nSs2 = bin(int(S, 2) ^ int(s2, 2))[2:]\nprint(min(sum([1 for x in Ss1 if int(x)]), sum([1 for x in Ss2 if int(x)])))", "S = '0b' + input()\ns1 = '0b' ... | ['Wrong Answer', 'Accepted'] | ['s524339306', 's599696057'] | [4468.0, 4340.0] | [58.0, 54.0] | [279, 288] |
p03073 | u375616706 | 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# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nS = input()[:-1]\nN = len(S)\nif len(S) == -1:\n C1 = Counter(S[::2])\n C2 = Counter(S[1::2])\n\n odd = C1['0']+C2['1']\n even = C1['1']+C2['0']\n print(N-max(odd, ev... | ['Wrong Answer', 'Accepted'] | ['s990874460', 's101676095'] | [3444.0, 3444.0] | [23.0, 25.0] | [328, 327] |
p03073 | u377989038 | 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()\ncnt, cnt_ = 0, 0\na = "10" * (len(s)//2+1)\nprint(a)\nfor i in range(len(s)):\n if s[i] != a[i]:\n cnt += 1\n if s[i] != a[i + 1]:\n cnt_ += 1\nprint(min(cnt, cnt_))', 's = input()\ncnt, cnt_ = 0, 0\na = "10" * (len(s)//2+1)\nfor i in range(len(s)):\n if s[i] != a[i]:\n cnt ... | ['Wrong Answer', 'Accepted'] | ['s879597345', 's053502999'] | [3316.0, 3188.0] | [59.0, 63.0] | [189, 180] |
p03073 | u381259612 | 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 = raw_input()\nn = len(s)\na = 0\nb = 0\nfor i in range(n):\n\tif ((i%2 == 0) and (s[i] == '0')):\n\t\ta += 1\n\tif ((i%2 == 1) and (s[i] == '1')):\n\t\ta += 1\n\tif ((i%2 == 0) and (s[i] == '1')):\n\t\tb += 1\n\tif ((i%2 == 1) and (s[i] == '0')):\n\t\tb += 1\nprint(min(a,b))\n", "s = input()\nn = len(s)\na = 0\nb ... | ['Runtime Error', 'Accepted'] | ['s440116052', 's559018324'] | [3064.0, 3188.0] | [17.0, 80.0] | [254, 250] |
p03073 | u382748202 | 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(i) for i in input()]\n\nans = 0\nfor i in range(2):\n cnt = 0\n for j, s_j in enumerate(S):\n if j % 2 == 0 ^ s_j != i:\n cnt += 1\n ans = min(ans, cnt)\n\nprint(ans)', 'S = [int(i) for i in input()]\n\nans = 99999999\nfor i in range(2):\n cnt = 0\n for j, s_j in enumerate(S)... | ['Wrong Answer', 'Accepted'] | ['s176261450', 's169896547'] | [3956.0, 3956.0] | [86.0, 82.0] | [192, 203] |
p03073 | u390901416 | 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 = [i for i in input()]\n\ndef henkan(a):\n if a == "0":\n a = "1"\n else:\n a = "0"\n return a\n \nans = 0\na = 0\nfor i in range(len(S)-1):\n if S[i] == S[i+1]:\n a = henkan(S[i+1])\n ans += 1\n print("a", a)\n S[i+1] = a\n print(S)\nprint(ans)', 'S =... | ['Runtime Error', 'Accepted'] | ['s512118708', 's220634851'] | [136292.0, 3956.0] | [1681.0, 59.0] | [293, 254] |
p03073 | u393693918 | 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()\nans1 = 0\nans2 = 0\n\nfor i in range(len(s)):\n if s[i] != str(i%2):\n ans1 += 1\n\nfor i in range(len(s)):\n if s[i] != str((i+1)%2):\n ans2 += 1\n\nprint(ans2)', 's = input()\nans1 = 0\nans2 = 0\n\nfor i in range(len(s)):\n if s[i] != str(i%2):\n ans1 += 1\n\nfor i in rang... | ['Wrong Answer', 'Accepted'] | ['s819787206', 's609262730'] | [3316.0, 3188.0] | [110.0, 101.0] | [182, 192] |
p03073 | u394731058 | 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\ndef main():\n S = input()\n l = len(S)\n ws = ''\n bs = ''\n for i in range(l):\n if i%2 == 0:\n ws += '0'\n bs += '1'\n else:\n ws += '1'\n bs += '0'\n wsc = 0\n bsc = 0\n for i in range(l):\... | ['Wrong Answer', 'Accepted'] | ['s479338451', 's636951471'] | [3316.0, 3444.0] | [70.0, 64.0] | [457, 457] |
p03073 | u403551852 | 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().split())\nprint((len(s)-1)/2 if s.count('0') > 0 and s.count('1') > 0 else len(s)/2)\n", "ss = input()\nans = 1\nfir_kuro = 0\nfir_siro = 0\ncounter = 0\nfor s in ss:\n if counter%2 == 0:\n fir_kuro += 0 if s == '1' else 1\n fir_siro += 0 if s == '0' else 1\n else:\n fir_ku... | ['Wrong Answer', 'Accepted'] | ['s487920015', 's794781551'] | [3188.0, 3188.0] | [17.0, 61.0] | [101, 317] |
p03073 | u408375121 | 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()\nd = int(S[0])\nT = []\nU = []\nfor i in range(len(S)):\n T.append(d)\n d = (d + 1) % 2\n U.append(d)\ncount1 = 0\ncount2 = 0\nfor i in range(len(S)):\n if S[i] != T[i]:\n count1 += 1\n if S[i] != U[i]:\n count2 += 1\nprint(min(count1, count2))\n\n ', 'S = input()\nd = int(S[0])\nT = []\nU = [... | ['Wrong Answer', 'Accepted'] | ['s000660109', 's992783567'] | [4852.0, 4852.0] | [97.0, 126.0] | [256, 267] |
p03073 | u411302151 | 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\nres = 0\n\nfor i in range(1, len(S)):\n if S[i] == S[i-1]:\n res += 1\n S[i] = "0" if int(S[i]) else "1"\n print("S")\nprint(res)\n', 'S = list(input())\n\nres = 0\n\nfor i in range(1, len(S)):\n if S[i] == S[i-1]:\n res += 1\n S[i] = "0" if int(S[i]) else... | ['Wrong Answer', 'Accepted'] | ['s928946852', 's986984849'] | [4524.0, 3956.0] | [90.0, 58.0] | [166, 147] |
p03073 | u412481017 | 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()\n\nif len(a)==1:\n print(0)\n exit()\n \nb=[::2]\nc=[1::2]\n\nb0=b.count("0")\nb1=b.count("1")\nc0=c.count("0")\nc1=c.count("1")\n\nprint(min(b0+c1,b1+c0))', 'a=input()\n\nif len(a)==1:\n print(0)\n exit()\n \nb=a[::2]\nc=a[1::2]\n\nb0=b.count("0")\nb1=b.count("1")\nc0=c.count("0")\nc1=c.count("1")\n\... | ['Runtime Error', 'Accepted'] | ['s686042508', 's189743709'] | [2940.0, 3188.0] | [17.0, 19.0] | [154, 157] |
p03073 | u419877586 | 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)\ntile=[0 if i&1==0 else 1 for i in range(N)]\nans=0\nfor i in range(N):\n if S[i]!=tile[i]:\n ans+=1\nprint(ans if ans<= N//2 else N-ans)', "S=input()\nN=len(S)\ntile=['0' if i&1==0 else '1' for i in range(N)]\nans=0\nfor i in range(N):\n if S[i]!=tile[i]:\n ans+=1\nprint(ans if ans<=N//2 ... | ['Wrong Answer', 'Accepted'] | ['s684967052', 's063621643'] | [3956.0, 3956.0] | [53.0, 50.0] | [154, 157] |
p03073 | u424241608 | 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 = 1 if s[0] == '0' else 0\na = []\na.append('1')\nfor i in range(1,len(s)):\n if s[i] == a[len(a)-1]:\n c1+=1\n a.append('0' if s[i]=='1' else '1')\n else:\n a.append(s[i])\n \na = []\nc2 = 1 if s[0]=='1' else 0\nfor i in range(1,len(s)):\n if s[i] == a[len(a)-1]:\n c2+=1\n a.appe... | ['Runtime Error', 'Accepted'] | ['s349333669', 's792122691'] | [3964.0, 4092.0] | [61.0, 101.0] | [402, 416] |
p03073 | u425762225 | 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... | ['#!/usr/bin/env python3\n\nimport sys\nsys.setrecursionlimit(10**10)\n\ndef operation(s,memo=-1,ans=0):\n if len(s) <= 0:\n return ans\n elif s[0] == memo == "0": \n return operation(s[1:],"1",ans+1)\n elif s[0] == memo == "1": \n return operation(s[1:],"0",ans+1)\n else:\n retu... | ['Runtime Error', 'Accepted'] | ['s820406516', 's332425426'] | [3064.0, 3188.0] | [17.0, 59.0] | [532, 377] |
p03073 | u428855582 | 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 = [int(n) for n in input()]\ncounter=1\nfor n in range(1, len(a)):\n if a[n-1]==a[n]:\n if a[n-1]==1:\n a[n]=0\n else:\n a[n]=1\n counter+=1\nprint(counter)', 'a = [int(n) for n in input()]\ncounter=0\nfor n in range(1, len(a)):\n if a[n-1]==a[n]:\n if a[n-1]==1:\n a[n]=0\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s544787569', 's320472083'] | [3956.0, 3956.0] | [74.0, 65.0] | [169, 169] |
p03073 | u434282696 | 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 = [s[j] for j in range(0,len(s10))]\nx.insert(0,'2')\ncount = 0\nfor j in range(1,len(x)):\n if x[j] == '0' and x[j] == x[j-1]:\n x[j] = '1'\n count = count + 1\n elif x[j] == '1' and x[j] == x[j-1]:\n x[j] = '0' \n count = count + 1\nprint(count)\n", "s = input()\nx =... | ['Runtime Error', 'Accepted'] | ['s136906625', 's210883971'] | [3188.0, 3956.0] | [18.0, 62.0] | [286, 284] |
p03073 | u434967413 | 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... | ['deata = list(input())\ncount = 0\nfor i in range(1, len(data)):\n if data[i] == data[i-1]:\n if data[i] == "0":\n data[i] = "1"\n else:\n data[i] = "0"\n count += 1\nprint(count)', 'data = list(input())\ncount = 0\nfor i in range(1, len(data)):\n if data[i] == data[i-1]:\n if data[i] == "0":\n... | ['Runtime Error', 'Accepted'] | ['s399594748', 's848017028'] | [3956.0, 3956.0] | [19.0, 52.0] | [189, 188] |
p03073 | u435808183 | 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 S\nS=input()\n\ncount=0\nl=len(S)\n\nfor i in range(1,len(S)):\n iS=int(S[i])\n if S[i]==S[i-1]:\n if S[i]=='0':\n S=S[:i-1]+'1'+S[i:]\n else:\n S=S[:i-1]+'0'+S[i:]\n count=count+1\n\nprint(count)\n\n", "\n#input S\nS=input()\n\ncount=0\nfor i in range(1,len(S... | ['Wrong Answer', 'Accepted'] | ['s193916977', 's181380469'] | [3436.0, 3512.0] | [1440.0, 813.0] | [240, 213] |
p03073 | u437215432 | 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... | ['# ABC124C\n\ns = input()\ns = [int(t) for t in list(s)]\nrepaint = 0\nfor i in range(1, len(s)):\n if s[i-1] == s[i]:\n repaint += 1\n s[i] = 1 - s[i]\npaint(repaint)\n', '# ABC124C\n\ns = input()\ns = [int(t) for t in list(s)]\nrepaint = 0\nfor i in range(1, len(s)):\n if s[i-1] == s[i]:\n ... | ['Runtime Error', 'Accepted'] | ['s942031703', 's380852909'] | [4724.0, 4724.0] | [71.0, 73.0] | [175, 175] |
p03073 | u441246928 | 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())\nS1 = []\nS2 = []\nif i in range(len(S)):\n if i % 2 ==0 :\n S1.append('0')\n S2.append('0')\n else :\n S1.append('1')\n S2.append('2')\nmin1 = 0\nfor i in range(len(S)):\n if S[i] != S1[i]:\n min1 += 1\nmin2 = 0\nfor i in range(len(S)):\n if S[i] != S1... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s226870308', 's487412322', 's676161628', 's734002155', 's809487429'] | [3956.0, 3188.0, 3956.0, 3188.0, 3316.0] | [19.0, 18.0, 19.0, 17.0, 98.0] | [347, 322, 348, 322, 323] |
p03073 | u450221211 | 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\ntile=int(input())\nif len(str(tile))==1:\n print(0)\nif len(str(tile))%2==1:\n tile1=int("01"*int(math.ceil(len(str(tile))/2)))\n tile2=int("10"*int(math.ceil(len(str(tile))/2)))\nelse:\n tile1=int("01"*int(len(str(tile))/2),2)\n tile2=int("10"*int(len(str(tile))/2),2)\n\ntile_10=int(str(t... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s274519229', 's337976905', 's927900977', 's704837995'] | [4084.0, 3956.0, 3572.0, 8752.0] | [1321.0, 1306.0, 1165.0, 109.0] | [557, 542, 557, 239] |
p03073 | u459590249 | 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())\nbw=0 \nfor i in range(len(s)):\n\tif (i%2==0 and s[i]==1) or (i%2==1 and s[i]==0):\n\t\tbw+=1\nwb=0\nfor i in range(len(s)):\n\tif (i%2==0 and s[i]==0) or (i%2==1 and s[i]==1):\n\t\twb+=1\nprint(min(bw,wb))', 's=list(map(int,input()))\nbw=0 \nfor i in range(len(s)):\n\tif (i%2==0 and s[i]==1) or (i%2... | ['Wrong Answer', 'Accepted'] | ['s631574470', 's235735260'] | [3956.0, 4084.0] | [75.0, 90.0] | [225, 234] |
p03073 | u462053731 | 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()))\nans1 = 0\nans2 = 0\nfor i in range (len(S)):\n if i % 2 == 0 and S[i] == 0:\n ans1 += 1\n elif i %2 ==1 and S[i] == 1:\n ans1 += 1\nfor i in range(len(S)):\n if i % 2 == 0 and S[i] == 1:\n ans2 += 1\n elif i % 2 ==1 and S[i] == 0:\n ans2 += 1\nprint(min(ans... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s052512242', 's086594641', 's162992930', 's418450430', 's549467484', 's702483467', 's011433217'] | [3188.0, 3188.0, 3188.0, 3188.0, 3188.0, 3188.0, 3956.0] | [85.0, 18.0, 86.0, 18.0, 18.0, 85.0, 81.0] | [316, 314, 313, 313, 317, 316, 303] |
p03073 | u463775490 | 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()\nlb = 0\nlw = 0\nfor i in range(len(s)):\n if i % 2 == 0:\n if s[i] == '0':\n lb += 1\n else:\n lw += 1\n else:\n if s[i] == '0':\n lw += 1\n else:\n lb += 1\nprint(max(lb,lw))", "s = input()\nlb = 0\nlw = 0\nfor i in range(len(... | ['Wrong Answer', 'Accepted'] | ['s720569471', 's709242435'] | [3188.0, 3188.0] | [49.0, 50.0] | [252, 252] |
p03073 | u472696272 | 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())\nn = len(s)\n\ns1 = [0]*n\ns2 = [1]*n\nfor i in range(1,n,2):\n s1[i] = 1\n s2[i] = 0\n\ncount1 = 0\ncount2 = 0\nfor i in range(n):\n if s[i]!=s1[i]: count1 += 1\n if s[i]!=s2[i]: count2 += 1\nprint(min(count1,count2))\n', 's = list(map(int,input()))\nn = len(s)\n\ns1 = [0]*n\ns2 = [1]*n\nfor i ... | ['Wrong Answer', 'Accepted'] | ['s555659620', 's893801453'] | [5540.0, 5536.0] | [76.0, 79.0] | [227, 236] |
p03073 | u475503988 | 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()\ncnt = [[0,0],[0,0]]\nfor i, s in enumerate(S):\n x = int(i) % 2\n y = int(s)\n cnt[x][y] += 1\nprint(cnt)\nif cnt[0][0] >= cnt[1][0]:\n print(cnt[0][1] + cnt[1][0])\nelse:\n print(cnt[0][0] + cnt[1][1])', 'S = input()\ncnt = [[0,0],[0,0]]\nfor i, s in enumerate(S):\n x = int(i) % 2\n ... | ['Wrong Answer', 'Accepted'] | ['s391320731', 's635293157'] | [3188.0, 3188.0] | [79.0, 85.0] | [220, 168] |
p03073 | u483896240 | 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... | ['# -*- coding: utf-8 -*-\n*s, = map(int,input())\nprint(s)\n\n\nans = len(s)\n\n\nfor i in range(2):\n \n cnt = 0\n\n for j in range(len(s)):\n if (j % 2 == 0) ^ (s[j] == i):\n cnt = cnt +1\n ans = min(ans, cnt)\n\nprint(ans)', '# -*- coding: utf-8 -*-\n*s, = map(int,input())\n\n\nans = l... | ['Wrong Answer', 'Accepted'] | ['s406459053', 's852369590'] | [4768.0, 3956.0] | [90.0, 82.0] | [337, 328] |
p03073 | u486251525 | 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 Levenshtein\n\nS = list(input())\nlenS = len(S)\n\npatternA = []\npatternB = []\ncountA = 0\ncountB = 0\n\nfor x in range(lenS):\n print(S[x])\n if x % 2 == 0:\n if S[x] == "0":\n countA += 1\n else:\n countB += 1\n else:\n if S[x] == "1":\n countA... | ['Runtime Error', 'Accepted'] | ['s350276202', 's000713448'] | [3060.0, 3956.0] | [17.0, 47.0] | [410, 374] |
p03073 | u488178971 | 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())\ns0=0\ns1=0\nfor i in range(len(S)):\n if i%2==0 and S[i]=="0":\n s1+=1\n elif i%2==0 and S[i]=="1" :\n s0+=1\n print("B")\n elif i%2==1 and S[i]=="0":\n s0+=1\n print("C")\n elif i%2==1 and S[i]=="1":\n s1+=1\n print("D")\nprint(min(s0,s1)... | ['Wrong Answer', 'Accepted'] | ['s045021574', 's468051836'] | [3952.0, 3188.0] | [120.0, 60.0] | [304, 216] |
p03073 | u488611616 | 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())\nS = list(input())\n\nmiddle = S[1:-1]\nwhite = middle.count('.')\nblack = middle.count('#')\n\nif (S.count('.') == 0 or S.count('#') == 0) or ((S.count('.') == 1 and S[0] == '.') or (S.count('#') == 1 and S[-1] == '#')):\n print('0')\nelse:\n if white < black:\n if S[-1] == '.':\n print(wh... | ['Runtime Error', 'Accepted'] | ['s248489617', 's101810869'] | [3188.0, 4652.0] | [86.0, 23.0] | [420, 120] |
p03073 | u495903598 | 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\n# In[17]:\n\nimport sys\ninput = sys.stdin.readline\nS = input()\n\n\n# In[18]:\n\n#a = "01"\n#b = "10"\nif len(S)%2==0:\n a = "01"*(len(S)//2)\n b = "10"*(len(S)//2)\nelse:\n a = "01"*(len(S)//2)+"0"\n b = "10"*(len(S)//2)+"1"\n#print(a, b)\n\n\n# In[19]:\n\nac = 0\nbc = 0\nfor i in ... | ['Wrong Answer', 'Accepted'] | ['s470233153', 's957096633'] | [3316.0, 3316.0] | [62.0, 59.0] | [413, 381] |
p03073 | u500006160 | 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()\noption1 = ['1' if i % 2 == 0 else '0' for i in range(len(s))]\noption2 = ['0' if i % 2 == 0 else '1' for i in range(len(s))]\nans_1 = 0\nans_2 = 0\nfor i, c in enumerate(s):\n if option_1[i] != c:\n ans_1 += 1\n if option_2[i] != c:\n ans_2 = 0\nprint(min(ans_1, ans_2))", "s = input()\noption_1 =... | ['Runtime Error', 'Accepted'] | ['s960198042', 's098445981'] | [4724.0, 4852.0] | [38.0, 73.0] | [281, 284] |
p03073 | u505745692 | 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... | ['\na = input()\nresult = -500000\n\nprivious_list = ["0", "1"]\n#print(len(a))\n\nif len(a) == 1 or 0:\n print(0)\nelse:\n for x in privious_list:\n new_result = 0\n privious = x\n for i in a:\n if i == "0":\n if privious == "0":\n new_result += 1... | ['Wrong Answer', 'Accepted'] | ['s022078763', 's950183691'] | [3188.0, 3188.0] | [55.0, 52.0] | [786, 832] |
p03073 | u505830998 | 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... | ['# -*- coding: utf-8 -*-\n\nimport sys\ninput = sys.stdin.readline\n\ndef io_generator():\n\treturn input()\n\n#+++++++++++++++++++\n\ndef main(io):\n\ts=io()\n\tnum_st=[0,0]\n\tfor i, c in enumerate(list(s)):\n\t\tif int(c) == i % 2:\n\t\t\tnum_st[0]+=1\n\t\telse:\n\t\t\tnum_st[1]+=1\n\t\n\treturn min(num_st)\n\n#+++... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s257622237', 's645374295', 's908916548'] | [3956.0, 3956.0, 3956.0] | [56.0, 51.0, 67.0] | [373, 373, 147] |
p03073 | u506287026 | 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\nlen_s = len(s)\nchange_cnt = 0\ni = 1\nwhile len_s > 2:\n left = s[i-1]\n right = s[i+1]\n if s[i] == left and s[i] == right:\n \n # 000\n change_cnt += 1\n if s[i] == '0':\n s[i] = '1'\n else:\n s[i] = '0'\n elif s[i] == left:\... | ['Wrong Answer', 'Accepted'] | ['s443481476', 's659472900'] | [4136.0, 3188.0] | [98.0, 18.0] | [864, 566] |
p03073 | u514894322 | 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\n\ns = input()\neven = true\nans1=0\nans2=1\nfor c in s:\n if even:\n if c == '0':\n ans2 += 1\n else:\n ans1 += 1\n else:\n if c == '0':\n ans1 += 1\n else:\n ans2 += 1\nprint(min([ans1,ans2]))", "\n\n\ns = input()\neven = True\nans1=0\nans2=0\nfor c in s:\n if even:\n even =... | ['Runtime Error', 'Accepted'] | ['s130310152', 's716363466'] | [3188.0, 3188.0] | [18.0, 37.0] | [384, 417] |
p03073 | u515364861 | 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\ns=str(input())\nb=\'\'\nc=0\nd=math.ceil(len(s)/2)\nif s[0]==\'0\':\n for i in range(d):\n b+="01"\nelse:\n for i in range(d):\n b+="10"\nif len(s) != len(b):\n b = b[:-1]\nelse:\n for u in range(len(s)):\n if s[u] != b[u]:\n c+=1\nprint(c)', 's=str(input())\na... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s157738843', 's224258989', 's592357014', 's745399111', 's781052075'] | [3316.0, 3188.0, 3316.0, 3444.0, 3316.0] | [48.0, 48.0, 49.0, 48.0, 48.0] | [276, 207, 233, 291, 258] |
p03073 | u518064858 | 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()\nans1=0\nans2=0\nfor i in range(len(s)):\n if i%2==0:\n if s[i]=="0":\n ans1+=1\n else:\n if s[i]=="1":\n ans1+=1\nfor k in range(len(s)):\n if k%2==0:\n if s[i]=="1":\n ans2+=1\n else:\n if s[i]=="0":\n ans2+=1\nprint(ans1,... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s430497015', 's741405624', 's905938268'] | [3188.0, 3316.0, 3188.0] | [69.0, 68.0, 64.0] | [307, 307, 312] |
p03073 | u519130434 | 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... | ["gen = get_input()\n\nS = list(input())\n\ncount = 0\ns1 = S[:]\nfor i in range(1, len(S)):\n if s1[i - 1] == s1[i]:\n s1[i] = '0' if s1[i-1] == '1' else '1'\n count += 1\n\ncount2 = 0\ns2 = S[:]\nfor i in reversed(range(len(S)-1)):\n if s2[i] == s2[i +1]:\n s2[i] = '0' if s2[i+1] == '1' els... | ['Runtime Error', 'Accepted'] | ['s594386161', 's030285540'] | [3064.0, 5544.0] | [17.0, 86.0] | [355, 339] |
p03073 | u527261492 | 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=[]\nfor i in range(len(s)):\n if i%2==0:\n a.append(0)\n else:\n a.append(1)\nb=[]\nfor j in range(len(s)):\n if j%2==0:\n b.append(1)\n else:\n b.append(0)\ncnt=0\nfor k in range(len(s)):\n if s[k]!=a[k]:\n cnt+=1\nans=0\nfor l in range(len(s)):\n if s[l]!=b[l]:\n ans+=1\nprint(m... | ['Wrong Answer', 'Accepted'] | ['s846339611', 's808645355'] | [4852.0, 4852.0] | [104.0, 93.0] | [309, 318] |
p03073 | u529012223 | 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\n\nS = input()\nS_list = []\nN = len(S)\nfor i in range(N):\n S_list.append(S[i])\n\neven_0 = S_list[1::2].count('0')\nodd_0 = S_list[::2].count('0')\nprint(max(min(even_0+math.trunc(N/2)-odd_0, odd_0+math.ceil(N/2)-even_0), 0))", "import math\n\nS = input()\nS_list = []\nN = len(S)\nfor i in range(N):... | ['Wrong Answer', 'Accepted'] | ['s122360211', 's844032878'] | [4340.0, 4340.0] | [36.0, 35.0] | [233, 233] |
p03073 | u532966492 | 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)\nA=len([_ for i in range(N) if str(i%2)==S[i]])\nprint(min(A,N-A))', 'S=input()\nN=len(S)\nA=len([i for i in range(N) if str(i%2)==S[i]])\nprint(min(A,N-A))'] | ['Runtime Error', 'Accepted'] | ['s328847272', 's031865177'] | [3188.0, 7188.0] | [43.0, 54.0] | [83, 83] |
p03073 | u536325690 | 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)\n\nans = 0\nif len(S) == 1:\n print(ans)\n exit()\nfor i in range(1,len(S)):\n if S[i] is S[i-1]:\n if S[i] is '0':\n S[i] = '1'\n else:\n S[i] = '0'\n print(S)\n ans += 1\nprint(ans)", "s = input()\nS = list(s)\n\nans = 0\nif len(S) ... | ['Runtime Error', 'Accepted'] | ['s308386679', 's975641600'] | [136488.0, 3956.0] | [1709.0, 47.0] | [252, 236] |
p03073 | u538632589 | 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 = s[0]\n\nfor i in range(1, len(s)):\n if ans[len(ans)-1] == s[i]:\n if s[i] == "0":\n ans += "1"\n else:\n ans += "0"\n else:\n ans += s[i]\nprint(ans)', 's = input()\nans = s[0]\ncount = 0\nfor i in range(1, len(s)):\n if ans[len(ans)-1] == s[i]:\... | ['Wrong Answer', 'Accepted'] | ['s646678901', 's706796741'] | [3316.0, 3188.0] | [65.0, 71.0] | [207, 237] |
p03073 | u539517139 | 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=[]\nb=[]\ni=0\nfor _ in range(l//2):\n a.append(s[i])\n b.append(s[i+1])\n i+=2\nif l%2==1:\n a.append(s[l-1])\na0=a.count(0)\na1=a.count(1)\nb0=b.count(0)\nb1=b.count(1)\nx=max(a0+b1,a1+b0)\nprint(l-x)', "s=input()\nl=len(s)\na=[]\nb=[]\ni=0\nfor _ in range(l//2):\n a.append(s[i])\n b.ap... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s244550952', 's476961940', 's009849352'] | [4052.0, 3064.0, 4084.0] | [42.0, 18.0, 42.0] | [213, 220, 221] |
p03073 | u540136623 | 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\nS_string = str(S)\n\nS_half_integer = len(S_string)//2\n\nlist_01 = list('1' for i in range(S_half_integer))\nlist_10 = list('0' for i in range(S_half_integer))\n\nfor i in range(S_half_integer+1):\n\tlist_01.insert(2*i, '0')\n\tlist_10.insert(2*i, '1')\n\nn2l_1 = ''\nn2l_2 = ''\n\nfor (i, j) in z... | ['Wrong Answer', 'Accepted'] | ['s444307460', 's255409560'] | [5108.0, 3188.0] | [2104.0, 46.0] | [552, 260] |
p03073 | u552209394 | 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... | ['string=list(input())\nif int(string[1]==0):\n c=1\nelse:\n c=0\na=0\nfor s in string:\n if int(s)==0 and c==1:\n c-=1\n elif int(s)==0 and c==0:\n c+=1\n a+=1\n elif int(s)==1 and c==0:\n\tc+=1\n elif int(s)==1 and c==1:\n\tc-=1\n a+=1\nprint(a)', 'string=list(input())\nc=0\na=0\nfor s in string:\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s257662140', 's324372700', 's610397744', 's458106667'] | [2940.0, 2940.0, 2940.0, 3956.0] | [17.0, 17.0, 17.0, 102.0] | [244, 204, 244, 286] |
p03073 | u554954744 | 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())\nN=len(S)\nS_int=list(S)\nfor i in range(N):\n S_int[i]=int(S[i])\ncnt_1=0\ncnt_2=0\nif all([S_int[i]!=S_int[i+1] for i in range(N)]):\n print(0)\nfor i in range(N):\n if i%2==0 and S_int[i]==0:\n S_int[i]=1\n cnt_1+=1\n elif i%2==1 and S_int[i]==1:\n S_int[i]=0\n ... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s572789563', 's833504595', 's854272332', 's694488516'] | [5544.0, 5544.0, 4776.0, 5544.0] | [61.0, 133.0, 125.0, 142.0] | [493, 561, 430, 491] |
p03073 | u556225812 | 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())\nl = len(S)\nif l%2 == 0:\n ans = ['0', '1']*int(l/2)\nelse:\n ans = ['0', '1']*int(l//2 + 1)\n ans = ans1[:-2]\n\ncnt = 0\nfor i in range(l):\n if ans[i] != S[i]:\n cnt += 1\n\nprint(min(cnt, l-cnt))", "S = list(input())\nl = len(S)\nif l%2 == 0:\n ans = ['0', '1']*int(l/2)\ne... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s086227568', 's962867302', 's380212321'] | [4652.0, 5420.0, 4652.0] | [41.0, 48.0, 44.0] | [224, 223, 220] |
p03073 | u556849401 | 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().strip()\nn = len(s)\none = s.count('0')\nl = [one]\nfor i in range(n):\n if s[i] == '0':\n one-=1\n else:\n one+=1\n l.append(one)\nprint(min(l))", '# -*- coding: utf-8 -*-\n"""\nCreated on Mon May 13 09:24:23 2019\n\n@author: avina\n"""\n\ns = input().strip()\n\nk = s[0]\ncnt_1 = 0;cnt_2 = 1\n... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s486066179', 's867606647', 's892917257', 's187863136'] | [7156.0, 3188.0, 7156.0, 3188.0] | [50.0, 87.0, 50.0, 90.0] | [158, 434, 153, 462] |
p03073 | u576357314 | 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 f(s,a):\n ans=0\n for i in range(len(s)):\n if i%2==0:\n if s[i]!=a:\n ans+=1\n print(1)\n else:\n if s[i]==a:\n ans+=1\n return ans\n\n\ns=list(input())\nprint(min(f(s,'0'),f(s,'1')))", "def f(s,a):\n ans=0\n for i in... | ['Wrong Answer', 'Accepted'] | ['s848261043', 's475615499'] | [4644.0, 3956.0] | [82.0, 51.0] | [264, 239] |
p03073 | u576917603 | 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()\ncnt=0\nfor i in range(len(n)):\n if n[0]=="0":\n if i%2==0 and n[i]=="1" :\n cnt+=1\n if i&2==1 and n[i]=="0" :\n cnt+=1\n else:\n if i%2==0 and n[i]=="0" :\n cnt+=1\n if i%2==1 and n[i]=="1" :\n cnt+=1\nprint(cnt)', 'cnt=0\nfor ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s605877708', 's772705522', 's722940690'] | [3316.0, 3064.0, 3188.0] | [67.0, 18.0, 68.0] | [290, 272, 290] |
p03073 | u581403769 | 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... | ['st = list(input())\ns = [int(i) for i st]\n\na1 = [0, 1] * (len(s) // 2)\na2 = [1, 0] * (len(s) // 2)\nif len(s) % 2 == 1:\n a1.append(0)\n a2.append(1)\n\ncount = 0\nl = [0] * 2\nfor i in range(len(s)):\n if s[i] != a1[i]:\n l[0] += 1\n if s[i] != a2[i]:\n l[1] += 1\nprint(min(l))', 's = li... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s282107408', 's892712910', 's904577904', 's020608948'] | [2940.0, 5544.0, 3188.0, 6316.0] | [16.0, 73.0, 85.0, 80.0] | [292, 269, 274, 295] |
p03073 | u581707881 | 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())\nc1 = 0\nc2 = 0\nx = 1\ndef hen(n):\n if n == 1:\n return 0\n else:\n return 1\nfor i in range(len(s)):\n si = int(s[i])\n if si == x:\n c1 += 1\n else:\n c2 + = 1\n x = hen(x)\nprint(min(c1,c2))', 's = str(input())\nc1 = 0\nc2 = 0\nx = 1\ndef hen(n):\n if n == 1:\n return 0\n ... | ['Runtime Error', 'Accepted'] | ['s227241334', 's671367777'] | [2940.0, 3316.0] | [17.0, 74.0] | [214, 213] |
p03073 | u582663624 | 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=list(str(input()))\nl=[int(i) for i in l]\ncnt=0\nfor i in range(len(l)-1):\n if(l[i]==l[i+1]):\n cnt+=1\n if(l[i]==0):\n l[i+1]=1\n elif(l[i]==1):\n l[i+1]=0\nprint(l,cnt)', 'l=list(str(input()))\nl=[int(i) for i in l]\ncnt=0\nfor i in range(len(l)-1):\n if(l[i]==l[i+1]):\n cnt+=1\n if(l... | ['Wrong Answer', 'Accepted'] | ['s361280539', 's311622940'] | [4652.0, 4652.0] | [75.0, 73.0] | [184, 182] |
p03073 | u583276018 | 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\nfor i in range(n - 1):\n c1 = s[i:i+1]\n c2 = s[i+1:i+2]\n if(c1 == c2):\n t = s\n if(c1 == \'0\'):\n s = t[ :i] + "1" + t[i+1: ]\n else:\n s = t[ :i] + "0" + t[i+1: ]\n cnt += 1\nprint(cnt)\n \n \n ', "s = input()\ncnt = 0\nif(s[:1] == '0'):\n for ... | ['Wrong Answer', 'Accepted'] | ['s124722986', 's419548303'] | [3440.0, 3188.0] | [1402.0, 53.0] | [249, 302] |
p03073 | u586662847 | 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 resolve():\n S = list(input())\n\n ans = 0\n for i in range(1, len(S)):\n if (S[i - 1] == S[i]):\n ans += 1\n\n if S[i] == '0':\n S[i] = '1'\n else:\n S[i] = '0'\n\n print(ans)", "def resolve():\n S = list(input())\n\n ans = 0... | ['Wrong Answer', 'Accepted'] | ['s578255498', 's222966123'] | [2940.0, 3956.0] | [17.0, 36.0] | [249, 261] |
p03073 | u595375942 | 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())\ncnt=0\ntmp=S[0]\nfor i in range(len(S)):\n if i == 0:continue\n if S[i] == tmp:\n cnt += 1\n tmp = S[i] \nprint(cnt)', "S=input()\nc=S[::2].count('0')+S[1::2].count('1')\nprint(min(c,len(S)-c))"] | ['Wrong Answer', 'Accepted'] | ['s775081067', 's579038395'] | [3956.0, 3188.0] | [47.0, 18.0] | [148, 71] |
p03073 | u600935366 | 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\ntest0 = [x%2 for x in range(n)]\ntest1 = [x%2+1 for x in range(n)]\n\ncnt0 = 0\ncnt1 = 0\n\nfor i, v in enumerate(s):\n if int(v) != test0[i]:\n cnt0+=1\n if int(v) != test1[i]:\n cnt1+=1\n \nprint(min(cnt0, cnt1))', 's = str(input())\n\ntest0 = [x%2 for x in range(len(s... | ['Runtime Error', 'Accepted'] | ['s902961563', 's139241975'] | [3188.0, 4724.0] | [18.0, 100.0] | [247, 270] |
p03073 | u602081607 | 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()\nnS = len(S)\nwhite = ("01"*10000)[:nS]\nblack = ("10"*10000)[:nS]\nsa_white = len([1 for x,y in zip(S, white) if x==y])\nsa_black = len([1 for x,y in zip(S, black) if x==y])\nprint(max(sa_white, sa_black))', 'S = input()\nnS = len(S)\nwhite = ("01"*10000)[:nS]\nblack = ("10"*10000)[:nS]\nsa_white = len([... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s425143306', 's432744408', 's770527666'] | [3316.0, 3316.0, 4528.0] | [20.0, 20.0, 31.0] | [212, 213, 214] |
p03073 | u609814378 | 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\nS = "10010010"\nS_list = list(S)\n\nl = len(S)\n\n\nif len(S) % 2 == 0:\n ideal1 = list(\'01\' * int(l / 2))\n ideal2 = list(\'10\' * int(l / 2))\nelse:\n ideal1 = list(\'01\' * (l // 2) + \'0\')\n ideal2 = list(\'10\' * (l // 2) + \'1\')\n\nans = 0\nans1 = 0\n\nfor base,compe1 in zip(S_list,ideal1):\... | ['Wrong Answer', 'Accepted'] | ['s208425112', 's103605651'] | [3064.0, 5620.0] | [17.0, 56.0] | [451, 439] |
p03073 | u617203831 | 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=s[::2].count("0")+s[1::2].count("1")\nprint(min(n,lens(s)-n))', 's=input()\nn=s[::2].count("0")+s[1::2].count("1")\nprint(min(n,len(s)-n))'] | ['Runtime Error', 'Accepted'] | ['s047584329', 's433482867'] | [3188.0, 3188.0] | [18.0, 18.0] | [72, 71] |
p03073 | u619785253 | 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\n\nn = list(input())\nn_size = len(n)\ncount = 0\n#print(n_size) \nnew_list = []\nnew_list.append(int(n[0]))\nfor i in range(n_size-1):\n if new_list[i] == 0:\n new_list.append(1)\n else:\n new_list.append(0)\n\n#print(new_list)\n \nfor i in range(n_size-1):\n if (int(n[i]) == new_lis... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s075396626', 's511024445', 's612264285', 's914669383', 's958871565'] | [4652.0, 5548.0, 5548.0, 19072.0, 4652.0] | [75.0, 92.0, 88.0, 310.0, 80.0] | [402, 428, 400, 374, 420] |
p03073 | u620846115 | 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()\n\ncounta = 0\ncountb = 0\nif N%2==0:\n for i in range(0,len(n)-2,2):\n if n[i]=="0":\n counta+=1\n elif n[i]=="1":\n countb+=1\n for i in range(1,len(n)-1,2):\n if n[i]=="1":\n counta+=1\n elif n[i]=="0":\n countb+=1\n print(min(counta,countb))\n\ncounta = 0\ncountb = 0... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s352684200', 's393201960', 's832558397', 's920757213'] | [9168.0, 9220.0, 9204.0, 9136.0] | [23.0, 47.0, 50.0, 28.0] | [543, 536, 545, 75] |
p03073 | u626881915 | 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 = []\nl.append(s[0])\nc = 0\nfor i in range(1, n):\n if s[i] == l[i-1]:\n c += 1\n l.append(str(abs(int(s[i])-1)))\n else:\n l.append(s[i])\nprint(c)\n', 's=input()\nl = []\nl.append(s[0])\nc = 0\nfor i in range(1, n):\n if s[i] == l[i-1]:\n c += 1\n l.append(str(-(int(s[i])-1)))\n els... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s433437261', 's972228460', 's398604847'] | [3188.0, 3188.0, 6772.0] | [18.0, 18.0, 84.0] | [164, 161, 167] |
p03073 | u628581330 | 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 color(s):\n k = 0\n for i in range(len(s)-1):\n if s[i+1]==s[i]:\n if s[i]=='0':\n s[i+1]='1'\n if s[i]=='1':\n s[i+1]='0'\n k = k+1\n return k\n \ns=list(input())\ncolor(s)", "def color(s):\n k = 0\n for i in range(len(s)-1):... | ['Wrong Answer', 'Accepted'] | ['s060344658', 's878308769'] | [3956.0, 3956.0] | [41.0, 41.0] | [247, 254] |
p03073 | u630281418 | 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\ninput = sys.stdin.readline\n\nbool_zeroone = True\ncount = 0\nsl = list(input())\nfor c in sl:\n if bool_zeroone and c == '0':\n count += 1\n elif not bool_zeroone and c == '1':\n count += 1\n bool_zeroone = not bool_zeroone\n\nanswer = min(count, len(sl) - count)\nprint(answer)\n",... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s109393975', 's229612721', 's763858809'] | [3956.0, 3956.0, 3956.0] | [40.0, 39.0, 43.0] | [301, 300, 262] |
p03073 | u633124169 | 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... | ['h_list = list(map(int,input()))\n\nprint(h_list)\n\nscore_z = 0\nscore_o = 0\n\n\n\ncounter = 0\nfor n in h_list:\n \n if counter%2 == 0:\n if 0 != n:\n score_z += 1\n if counter%2 == 1:\n if 1 != n:\n score_z += 1\n counter+=1\n\n\ncounter = 0\nfor n in h_list:\n if... | ['Wrong Answer', 'Accepted'] | ['s645217670', 's962602925'] | [4768.0, 3956.0] | [102.0, 95.0] | [530, 514] |
p03073 | u634159866 | 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\nmin(S[::2].count("0")+S[1::2].count("1"), S[::2].count("1")+S[1::2].count("0"))', 'S = input()\n\nprint(min(S[::2].count("0")+S[1::2].count("1"), S[::2].count("1")+S[1::2].count("0")))'] | ['Wrong Answer', 'Accepted'] | ['s437667922', 's159483882'] | [3188.0, 3188.0] | [20.0, 19.0] | [92, 99] |
p03073 | u635958201 | 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())\nN=len(S)\n\nA=[]\nB=[]\nfor i in range(N):\n A.append(str(i%2))\n B.append(str((i+1)%2))\ncountA=0\ncountB=0\nfor x in range(N):\n if A[x]!=S[x]:\n countA+=1\n else:\n countB+=1\nprint(max(countA,countB))', 'S=list(input())\nN=len(S)\nprint(S)\nA=[]\nB=[]\nfor i in range(N):... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s263670518', 's581710488', 's882345771'] | [16556.0, 19424.0, 16596.0] | [118.0, 139.0, 117.0] | [232, 259, 232] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.