node_ids
listlengths 4
1.4k
| edge_index
listlengths 1
2.22k
| text
listlengths 4
1.4k
| source
stringlengths 14
427k
|
---|---|---|---|
[
7,
0,
13,
4,
13,
0,
13,
17,
28,
13,
13,
4,
13,
13,
14,
2,
13,
17,
14,
40,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13
] |
[
[
33,
2
],
[
36,
6
],
[
34,
13
],
[
34,
22
],
[
39,
27
],
[
40,
31
],
[
37,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
]
] |
[
"# 20200610_yorukatsu_f.py\nS = input()\ncnt = 0\nfor i,c in enumerate(S):\n if i>0:\n if c!=S[i-1]:\n cnt += 1\nprint(cnt)",
"S = input()",
"S",
"input()",
"input",
"cnt = 0",
"cnt",
"0",
"for i,c in enumerate(S):\n if i>0:\n if c!=S[i-1]:\n cnt += 1",
"i",
"c",
"enumerate(S)",
"enumerate",
"S",
"if i>0:\n if c!=S[i-1]:\n cnt += 1",
"i>0",
"i",
"0",
"if c!=S[i-1]:\n cnt += 1",
"c!=S[i-1]",
"c",
"S[i-1]",
"S",
"i-1",
"i",
"1",
"cnt += 1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"S = input()",
"input()",
"S",
"cnt = 0",
"0",
"cnt",
"cnt += 1",
"1",
"cnt"
] |
# 20200610_yorukatsu_f.py
S = input()
cnt = 0
for i,c in enumerate(S):
if i>0:
if c!=S[i-1]:
cnt += 1
print(cnt)
|
[
7,
12,
13,
0,
13,
39,
42,
40,
4,
13,
13,
17,
0,
13,
18,
13,
17,
0,
13,
17,
42,
2,
18,
13,
17,
13,
0,
13,
18,
13,
17,
0,
13,
4,
18,
13,
13,
13,
14,
2,
4,
13,
13,
17,
3,
4,
18,
13,
13,
13,
29,
13,
23,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
53,
10
],
[
32,
10
],
[
14,
13
],
[
53,
15
],
[
32,
15
],
[
19,
18
],
[
53,
23
],
[
32,
23
],
[
13,
25
],
[
28,
27
],
[
53,
29
],
[
32,
29
],
[
33,
32
],
[
53,
35
],
[
32,
35
],
[
13,
37
],
[
32,
42
],
[
53,
42
],
[
4,
47
],
[
27,
49
],
[
18,
49
],
[
4,
51
],
[
53,
53
],
[
71,
55
],
[
74,
59
],
[
78,
61
],
[
72,
62
],
[
75,
68
],
[
71,
72
],
[
74,
75
]
] |
[
"def BWstripper(S):\n BWarray=[]\n while (len(S) != 0):\n initial = S[0]\n tmp=\"\"\n while (S[0] == initial):\n tmp+=S[0]\n S=S.lstrip(initial)\n if len(S) == 0:\n break\n BWarray.append(tmp)\n return BWarray\nS=input()\nstripped = BWstripper(S)\nprint(len(stripped)-1)",
"def BWstripper(S):\n BWarray=[]\n while (len(S) != 0):\n initial = S[0]\n tmp=\"\"\n while (S[0] == initial):\n tmp+=S[0]\n S=S.lstrip(initial)\n if len(S) == 0:\n break\n BWarray.append(tmp)\n return BWarray",
"BWstripper",
"BWarray=[]",
"BWarray",
"[]",
"while (len(S) != 0):\n initial = S[0]\n tmp=\"\"\n while (S[0] == initial):\n tmp+=S[0]\n S=S.lstrip(initial)\n if len(S) == 0:\n break\n BWarray.append(tmp)\n ",
"len(S) != 0",
"len(S)",
"len",
"S",
"0",
"initial = S[0]",
"initial",
"S[0]",
"S",
"0",
"tmp=\"\"",
"tmp",
"\"\"",
"while (S[0] == initial):\n tmp+=S[0]\n S=S.lstrip(initial)\n if len(S) == 0:\n break\n ",
"S[0] == initial",
"S[0]",
"S",
"0",
"initial",
"tmp+=S[0]",
"tmp",
"S[0]",
"S",
"0",
"S=S.lstrip(initial)",
"S",
"S.lstrip(initial)",
"S.lstrip",
"S",
"lstrip",
"initial",
"if len(S) == 0:\n break\n ",
"len(S) == 0",
"len(S)",
"len",
"S",
"0",
"break",
"BWarray.append(tmp)",
"BWarray.append",
"BWarray",
"append",
"tmp",
"return BWarray",
"BWarray",
"S",
"S",
"S=input()",
"S",
"input()",
"input",
"stripped = BWstripper(S)",
"stripped",
"BWstripper(S)",
"BWstripper",
"S",
"print(len(stripped)-1)",
"print",
"len(stripped)-1",
"len(stripped)",
"len",
"stripped",
"1",
"S=input()",
"input()",
"S",
"stripped = BWstripper(S)",
"BWstripper(S)",
"stripped",
"def BWstripper(S):\n BWarray=[]\n while (len(S) != 0):\n initial = S[0]\n tmp=\"\"\n while (S[0] == initial):\n tmp+=S[0]\n S=S.lstrip(initial)\n if len(S) == 0:\n break\n BWarray.append(tmp)\n return BWarray",
"def BWstripper(S):\n BWarray=[]\n while (len(S) != 0):\n initial = S[0]\n tmp=\"\"\n while (S[0] == initial):\n tmp+=S[0]\n S=S.lstrip(initial)\n if len(S) == 0:\n break\n BWarray.append(tmp)\n return BWarray",
"BWstripper"
] |
def BWstripper(S):
BWarray=[]
while (len(S) != 0):
initial = S[0]
tmp=""
while (S[0] == initial):
tmp+=S[0]
S=S.lstrip(initial)
if len(S) == 0:
break
BWarray.append(tmp)
return BWarray
S=input()
stripped = BWstripper(S)
print(len(stripped)-1)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13
] |
[
[
33,
2
],
[
42,
6
],
[
36,
9
],
[
34,
11
],
[
15,
14
],
[
34,
14
],
[
37,
18
],
[
31,
18
],
[
14,
19
],
[
39,
21
],
[
30,
24
],
[
14,
25
],
[
40,
28
],
[
43,
28
],
[
14,
30
],
[
30,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"s = input()\nres = 0\nst = s[0]\n\nfor v in s:\n if st != v:\n res += 1\n st = v\nprint(res)",
"s = input()",
"s",
"input()",
"input",
"res = 0",
"res",
"0",
"st = s[0]",
"st",
"s[0]",
"s",
"0",
"for v in s:\n if st != v:\n res += 1\n st = v",
"v",
"s",
"if st != v:\n res += 1\n st = v",
"st != v",
"st",
"v",
"res += 1",
"res",
"1",
"st = v",
"st",
"v",
"print(res)",
"print",
"res",
"st = v",
"v",
"st",
"s = input()",
"input()",
"s",
"st = s[0]",
"s[0]",
"st",
"res += 1",
"1",
"res",
"res = 0",
"0",
"res"
] |
s = input()
res = 0
st = s[0]
for v in s:
if st != v:
res += 1
st = v
print(res)
|
[
7,
0,
13,
2,
4,
13,
17,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
17,
42,
40,
18,
13,
13,
17,
14,
40,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
0,
13,
17,
4,
13,
13,
10,
2,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13
] |
[
[
45,
2
],
[
51,
8
],
[
63,
11
],
[
60,
14
],
[
46,
16
],
[
46,
21
],
[
64,
22
],
[
49,
22
],
[
46,
27
],
[
64,
28
],
[
49,
28
],
[
61,
29
],
[
55,
29
],
[
54,
31
],
[
46,
33
],
[
64,
34
],
[
49,
34
],
[
57,
36
],
[
48,
39
],
[
58,
43
],
[
52,
43
],
[
45,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
],
[
60,
61
],
[
63,
64
]
] |
[
"a=input()+\"p\"\nb=0\ni=1\nc=a[0]\nwhile a[i]!=\"p\":\n if a[i]!=c:\n c=a[i]\n b+=1\n i+=1\nprint(b)",
"a=input()+\"p\"",
"a",
"input()+\"p\"",
"input()",
"input",
"\"p\"",
"b=0",
"b",
"0",
"i=1",
"i",
"1",
"c=a[0]",
"c",
"a[0]",
"a",
"0",
"while a[i]!=\"p\":\n if a[i]!=c:\n c=a[i]\n b+=1\n i+=1",
"a[i]!=\"p\"",
"a[i]",
"a",
"i",
"\"p\"",
"if a[i]!=c:\n c=a[i]\n b+=1\n ",
"a[i]!=c",
"a[i]",
"a",
"i",
"c",
"c=a[i]",
"c",
"a[i]",
"a",
"i",
"b+=1",
"b",
"1",
"i+=1",
"i",
"1",
"print(b)",
"print",
"b",
"a=input()+\"p\"",
"input()+\"p\"",
"a",
"i+=1",
"1",
"i",
"b=0",
"0",
"b",
"c=a[i]",
"a[i]",
"c",
"b+=1",
"1",
"b",
"c=a[0]",
"a[0]",
"c",
"i=1",
"1",
"i"
] |
a=input()+"p"
b=0
i=1
c=a[0]
while a[i]!="p":
if a[i]!=c:
c=a[i]
b+=1
i+=1
print(b)
|
[
7,
15,
0,
13,
4,
13,
0,
13,
17,
28,
13,
13,
4,
13,
13,
0,
13,
17,
4,
13,
2,
13,
17,
10,
4,
13,
10,
17,
13,
10,
17,
13
] |
[
[
24,
3
],
[
27,
7
],
[
25,
14
],
[
30,
16
],
[
31,
21
],
[
28,
21
],
[
24,
25
],
[
27,
28
],
[
30,
31
]
] |
[
"from itertools import groupby\ns = input()\ncount = 0\nfor k, g in groupby(s):\n count += 1\nprint(count - 1)",
"from itertools import groupby",
"s = input()",
"s",
"input()",
"input",
"count = 0",
"count",
"0",
"for k, g in groupby(s):\n count += 1",
"k",
"g",
"groupby(s)",
"groupby",
"s",
"count += 1",
"count",
"1",
"print(count - 1)",
"print",
"count - 1",
"count",
"1",
"s = input()",
"input()",
"s",
"count = 0",
"0",
"count",
"count += 1",
"1",
"count"
] |
from itertools import groupby
s = input()
count = 0
for k, g in groupby(s):
count += 1
print(count - 1)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13
] |
[
[
35,
2
],
[
44,
8
],
[
38,
11
],
[
36,
13
],
[
17,
16
],
[
36,
16
],
[
39,
20
],
[
33,
20
],
[
16,
21
],
[
41,
23
],
[
32,
26
],
[
16,
27
],
[
42,
30
],
[
45,
30
],
[
16,
32
],
[
32,
33
],
[
35,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
]
] |
[
"S=str(input())\nn=0\nch=S[0]\nfor s in S:\n if ch!=s:\n n+=1\n ch=s\nprint(n)",
"S=str(input())",
"S",
"str(input())",
"str",
"input()",
"input",
"n=0",
"n",
"0",
"ch=S[0]",
"ch",
"S[0]",
"S",
"0",
"for s in S:\n if ch!=s:\n n+=1\n ch=s",
"s",
"S",
"if ch!=s:\n n+=1\n ",
"ch!=s",
"ch",
"s",
"n+=1",
"n",
"1",
"ch=s",
"ch",
"s",
"print(n)",
"print",
"n",
"ch=s",
"s",
"ch",
"S=str(input())",
"str(input())",
"S",
"ch=S[0]",
"S[0]",
"ch",
"n+=1",
"1",
"n",
"n=0",
"0",
"n"
] |
S=str(input())
n=0
ch=S[0]
for s in S:
if ch!=s:
n+=1
ch=s
print(n)
|
[
7,
0,
13,
4,
13,
14,
2,
2,
4,
18,
13,
13,
17,
17,
2,
4,
18,
13,
13,
17,
17,
4,
13,
17,
4,
13,
28,
13,
4,
13,
17,
0,
13,
4,
18,
4,
18,
13,
13,
17,
17,
13,
17,
17,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
4,
13
] |
[
[
52,
2
],
[
53,
10
],
[
53,
17
],
[
28,
27
],
[
55,
32
],
[
53,
37
],
[
56,
37
],
[
56,
49
],
[
53,
49
],
[
52,
53
],
[
55,
56
]
] |
[
"S = input()\nif S.count('B') == 0 or S.count('W') == 0:\n print(0)\n exit()\nfor _ in range(20):\n S = S.replace('BB','B').replace('WW','W')\nprint(len(S)-1)",
"S = input()",
"S",
"input()",
"input",
"if S.count('B') == 0 or S.count('W') == 0:\n print(0)\n exit()",
"S.count('B') == 0 or S.count('W') == 0",
"S.count('B') == 0",
"S.count('B')",
"S.count",
"S",
"count",
"'B'",
"0",
"S.count('W') == 0",
"S.count('W')",
"S.count",
"S",
"count",
"'W'",
"0",
"print(0)",
"print",
"0",
"exit()",
"exit",
"for _ in range(20):\n S = S.replace('BB','B').replace('WW','W')",
"_",
"range(20)",
"range",
"20",
"S = S.replace('BB','B').replace('WW','W')",
"S",
"S.replace('BB','B').replace('WW','W')",
"S.replace('BB','B').replace",
"S.replace('BB','B')",
"S.replace",
"S",
"replace",
"'BB'",
"'B'",
"replace",
"'WW'",
"'W'",
"print(len(S)-1)",
"print",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"S = input()",
"input()",
"S",
"S = S.replace('BB','B').replace('WW','W')",
"S.replace('BB','B').replace('WW','W')",
"S"
] |
S = input()
if S.count('B') == 0 or S.count('W') == 0:
print(0)
exit()
for _ in range(20):
S = S.replace('BB','B').replace('WW','W')
print(len(S)-1)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13
] |
[
[
42,
2
],
[
48,
6
],
[
45,
9
],
[
43,
11
],
[
15,
14
],
[
43,
20
],
[
46,
23
],
[
40,
23
],
[
43,
25
],
[
14,
26
],
[
51,
28
],
[
39,
31
],
[
43,
33
],
[
14,
34
],
[
52,
37
],
[
49,
37
],
[
39,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
51,
52
]
] |
[
"S = input()\nC = 0\nbw = S[0]\nfor i in range(1, len(S)):\n if bw != S[i]:\n C += 1\n bw = S[i]\nprint(C)",
"S = input()",
"S",
"input()",
"input",
"C = 0",
"C",
"0",
"bw = S[0]",
"bw",
"S[0]",
"S",
"0",
"for i in range(1, len(S)):\n if bw != S[i]:\n C += 1\n bw = S[i]",
"i",
"range(1, len(S))",
"range",
"1",
"len(S)",
"len",
"S",
"if bw != S[i]:\n C += 1\n bw = S[i]",
"bw != S[i]",
"bw",
"S[i]",
"S",
"i",
"C += 1",
"C",
"1",
"bw = S[i]",
"bw",
"S[i]",
"S",
"i",
"print(C)",
"print",
"C",
"bw = S[i]",
"S[i]",
"bw",
"S = input()",
"input()",
"S",
"bw = S[0]",
"S[0]",
"bw",
"C = 0",
"0",
"C",
"C += 1",
"1",
"C"
] |
S = input()
C = 0
bw = S[0]
for i in range(1, len(S)):
if bw != S[i]:
C += 1
bw = S[i]
print(C)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
2,
4,
13,
13,
17,
0,
13,
17,
42,
40,
13,
17,
14,
40,
18,
13,
13,
13,
0,
13,
17,
0,
13,
8,
2,
13,
17,
17,
17,
0,
13,
17,
4,
13,
13,
10,
2,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
8,
13,
10,
17,
13,
10,
18,
13
] |
[
[
57,
2
],
[
66,
6
],
[
58,
8
],
[
48,
11
],
[
58,
15
],
[
51,
18
],
[
49,
22
],
[
64,
22
],
[
58,
27
],
[
49,
28
],
[
64,
28
],
[
67,
29
],
[
61,
29
],
[
54,
31
],
[
60,
34
],
[
67,
37
],
[
61,
37
],
[
63,
42
],
[
55,
46
],
[
52,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
],
[
60,
61
],
[
63,
64
],
[
66,
67
]
] |
[
"s = input()\nch = s[-1]\nindex = len(s) - 1\nansw = 0\nwhile index >= 0:\n if s[index] != ch:\n answ += 1\n ch = 'B' if ch == 'W' else 'W'\n else:\n index -= 1\nprint(answ)",
"s = input()",
"s",
"input()",
"input",
"ch = s[-1]",
"ch",
"s[-1]",
"s",
"-1",
"index = len(s) - 1",
"index",
"len(s) - 1",
"len(s)",
"len",
"s",
"1",
"answ = 0",
"answ",
"0",
"while index >= 0:\n if s[index] != ch:\n answ += 1\n ch = 'B' if ch == 'W' else 'W'\n else:\n index -= 1",
"index >= 0",
"index",
"0",
"if s[index] != ch:\n answ += 1\n ch = 'B' if ch == 'W' else 'W'\n else:\n index -= 1",
"s[index] != ch",
"s[index]",
"s",
"index",
"ch",
"answ += 1",
"answ",
"1",
"ch = 'B' if ch == 'W' else 'W'",
"ch",
"'B' if ch == 'W' else 'W'",
"ch == 'W'",
"ch",
"'W'",
"'B'",
"'W'",
"index -= 1",
"index",
"1",
"print(answ)",
"print",
"answ",
"index = len(s) - 1",
"len(s) - 1",
"index",
"answ = 0",
"0",
"answ",
"answ += 1",
"1",
"answ",
"s = input()",
"input()",
"s",
"ch = 'B' if ch == 'W' else 'W'",
"'B' if ch == 'W' else 'W'",
"ch",
"index -= 1",
"1",
"index",
"ch = s[-1]",
"s[-1]",
"ch"
] |
s = input()
ch = s[-1]
index = len(s) - 1
answ = 0
while index >= 0:
if s[index] != ch:
answ += 1
ch = 'B' if ch == 'W' else 'W'
else:
index -= 1
print(answ)
|
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
40,
18,
13,
13,
18,
13,
2,
13,
17,
10,
4,
13
] |
[
[
19,
2
],
[
20,
11
],
[
20,
14
],
[
19,
20
]
] |
[
"S = input()\nprint(sum(S[i]!=S[i-1] for i in range(1, len(S))))",
"S = input()",
"S",
"input()",
"input",
"print(sum(S[i]!=S[i-1] for i in range(1, len(S))))",
"print",
"sum(S[i]!=S[i-1] for i in range(1, len(S)))",
"sum",
"S[i]!=S[i-1]",
"S[i]",
"S",
"i",
"S[i-1]",
"S",
"i-1",
"i",
"1",
"S = input()",
"input()",
"S"
] |
S = input()
print(sum(S[i]!=S[i-1] for i in range(1, len(S))))
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13
] |
[
[
39,
2
],
[
45,
6
],
[
40,
9
],
[
36,
11
],
[
15,
14
],
[
46,
18
],
[
40,
22
],
[
14,
23
],
[
40,
25
],
[
14,
27
],
[
42,
30
],
[
43,
34
],
[
37,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
],
[
45,
46
]
] |
[
"s=input()\nn=len(s)\nc=0\nfor i in range(1,n):\n if s[i]!=s[i-1]:\n c+=1\nprint(c)",
"s=input()",
"s",
"input()",
"input",
"n=len(s)",
"n",
"len(s)",
"len",
"s",
"c=0",
"c",
"0",
"for i in range(1,n):\n if s[i]!=s[i-1]:\n c+=1",
"i",
"range(1,n)",
"range",
"1",
"n",
"if s[i]!=s[i-1]:\n c+=1",
"s[i]!=s[i-1]",
"s[i]",
"s",
"i",
"s[i-1]",
"s",
"i-1",
"i",
"1",
"c+=1",
"c",
"1",
"print(c)",
"print",
"c",
"c=0",
"0",
"c",
"s=input()",
"input()",
"s",
"c+=1",
"1",
"c",
"n=len(s)",
"len(s)",
"n"
] |
s=input()
n=len(s)
c=0
for i in range(1,n):
if s[i]!=s[i-1]:
c+=1
print(c)
|
[
7,
12,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
29,
13,
23,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
8,
7
],
[
30,
13
],
[
30,
17
],
[
7,
18
],
[
30,
20
],
[
7,
22
],
[
26,
25
],
[
25,
28
],
[
4,
28
],
[
30,
30
],
[
41,
32
],
[
45,
38
],
[
42,
39
],
[
41,
42
]
] |
[
"def answer(s):\n count = 0\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n count += 1\n return count\n\ns = input()\nprint(answer(s))",
"def answer(s):\n count = 0\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n count += 1\n return count",
"answer",
"count = 0",
"count",
"0",
"for i in range(1, len(s)):\n if s[i] != s[i-1]:\n count += 1\n ",
"i",
"range(1, len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[i] != s[i-1]:\n count += 1\n ",
"s[i] != s[i-1]",
"s[i]",
"s",
"i",
"s[i-1]",
"s",
"i-1",
"i",
"1",
"count += 1",
"count",
"1",
"return count",
"count",
"s",
"s",
"s = input()",
"s",
"input()",
"input",
"print(answer(s))",
"print",
"answer(s)",
"answer",
"s",
"s = input()",
"input()",
"s",
"def answer(s):\n count = 0\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n count += 1\n return count",
"def answer(s):\n count = 0\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n count += 1\n return count",
"answer"
] |
def answer(s):
count = 0
for i in range(1, len(s)):
if s[i] != s[i-1]:
count += 1
return count
s = input()
print(answer(s))
|
[
7,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
18,
13,
40,
13,
18,
13,
2,
40,
13,
17,
9,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13
] |
[
[
42,
2
],
[
36,
6
],
[
10,
9
],
[
43,
15
],
[
43,
19
],
[
9,
21
],
[
43,
23
],
[
9,
26
],
[
39,
30
],
[
40,
34
],
[
37,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"s=input()\nc=0\nfor i in range(1,len(s)):\n if s[-i]==s[-i-1]:\n continue\n else:\n c+=1\nprint(c)",
"s=input()",
"s",
"input()",
"input",
"c=0",
"c",
"0",
"for i in range(1,len(s)):\n if s[-i]==s[-i-1]:\n continue\n else:\n c+=1",
"i",
"range(1,len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[-i]==s[-i-1]:\n continue\n else:\n c+=1",
"s[-i]==s[-i-1]",
"s[-i]",
"s",
"-i",
"i",
"s[-i-1]",
"s",
"-i-1",
"-i",
"i",
"1",
"continue",
"c+=1",
"c",
"1",
"print(c)",
"print",
"c",
"c=0",
"0",
"c",
"c+=1",
"1",
"c",
"s=input()",
"input()",
"s"
] |
s=input()
c=0
for i in range(1,len(s)):
if s[-i]==s[-i-1]:
continue
else:
c+=1
print(c)
|
[
7,
15,
13,
13,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
12,
13,
12,
13,
12,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
12,
13,
23,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
4,
13,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
2,
13,
17,
10,
12,
13,
10,
12,
13,
10,
17,
13,
10,
12,
13,
10,
12,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13,
10,
12,
13,
10,
17,
13,
10,
2,
13,
10,
4,
13
] |
[
[
25,
24
],
[
84,
30
],
[
34,
34
],
[
101,
43
],
[
113,
48
],
[
116,
55
],
[
96,
57
],
[
110,
59
],
[
89,
62
],
[
66,
65
],
[
117,
65
],
[
65,
69
],
[
111,
70
],
[
105,
70
],
[
98,
72
],
[
104,
75
],
[
65,
76
],
[
99,
80
],
[
90,
80
],
[
89,
90
],
[
98,
99
],
[
101,
102
],
[
65,
104
],
[
104,
105
],
[
110,
111
],
[
113,
114
],
[
116,
117
]
] |
[
"import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2\nfrom itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_uppercase, digits\nfrom bisect import bisect, bisect_left\nfrom fractions import gcd\nfrom heapq import heappush, heappop\nfrom functools import reduce\ndef input(): return sys.stdin.readline().strip()\ndef INT(): return int(input())\ndef MAP(): return map(int, input().split())\ndef LIST(): return list(map(int, input().split()))\ndef ZIP(n): return zip(*(MAP() for _ in range(n)))\nsys.setrecursionlimit(10 ** 9)\nINF = float('inf')\nmod = 10 ** 9 + 7\n\nS = input()\n\nnow = \"\"\ncount = 0\n\nfor stone in S:\n\tif stone != now:\n\t\tcount += 1\n\tnow = stone\nprint(count-1)",
"import sys, re",
"sys",
"re",
"from collections import deque, defaultdict, Counter",
"from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2",
"from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby",
"from operator import itemgetter, mul",
"from copy import deepcopy",
"from string import ascii_lowercase, ascii_uppercase, digits",
"from bisect import bisect, bisect_left",
"from fractions import gcd",
"from heapq import heappush, heappop",
"from functools import reduce",
"def input(): return sys.stdin.readline().strip()",
"input",
"def INT(): return int(input())",
"INT",
"def MAP(): return map(int, input().split())",
"MAP",
"def LIST(): return list(map(int, input().split()))",
"LIST",
"MAP() for _ in range(n)",
"for _ in range(n)",
"_",
"range(n)",
"range",
"n",
"for _ in range(n)",
"MAP()",
"MAP",
"def ZIP(n): return zip(*(MAP() for _ in range(n)))",
"ZIP",
"n",
"n",
"sys.setrecursionlimit(10 ** 9)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10 ** 9",
"10",
"9",
"INF = float('inf')",
"INF",
"float('inf')",
"float",
"'inf'",
"mod = 10 ** 9 + 7",
"mod",
"10 ** 9 + 7",
"10 ** 9",
"10",
"9",
"7",
"S = input()",
"S",
"input()",
"input",
"now = \"\"",
"now",
"\"\"",
"count = 0",
"count",
"0",
"for stone in S:\n\tif stone != now:\n\t\tcount += 1\n\tnow = stone",
"stone",
"S",
"if stone != now:\n\t\tcount += 1\n\t",
"stone != now",
"stone",
"now",
"count += 1",
"count",
"1",
"now = stone",
"now",
"stone",
"print(count-1)",
"print",
"count-1",
"count",
"1",
"def MAP(): return map(int, input().split())",
"def MAP(): return map(int, input().split())",
"MAP",
"def INT(): return int(input())",
"def INT(): return int(input())",
"INT",
"count = 0",
"0",
"count",
"def LIST(): return list(map(int, input().split()))",
"def LIST(): return list(map(int, input().split()))",
"LIST",
"def input(): return sys.stdin.readline().strip()",
"def input(): return sys.stdin.readline().strip()",
"input",
"count += 1",
"1",
"count",
"INF = float('inf')",
"float('inf')",
"INF",
"now = stone",
"stone",
"now",
"def ZIP(n): return zip(*(MAP() for _ in range(n)))",
"def ZIP(n): return zip(*(MAP() for _ in range(n)))",
"ZIP",
"now = \"\"",
"\"\"",
"now",
"mod = 10 ** 9 + 7",
"10 ** 9 + 7",
"mod",
"S = input()",
"input()",
"S"
] |
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
S = input()
now = ""
count = 0
for stone in S:
if stone != now:
count += 1
now = stone
print(count-1)
|
[
7,
0,
13,
4,
13,
4,
13,
14,
2,
4,
13,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
2,
13,
17,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
2,
13,
17,
2,
18,
13,
13,
17,
14,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
14,
2,
2,
13,
17,
2,
18,
13,
13,
17,
0,
13,
17,
14,
2,
2,
13,
17,
2,
18,
13,
13,
17,
14,
13,
0,
13,
17,
0,
13,
17,
0,
13,
17,
14,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] |
[
[
119,
2
],
[
120,
13
],
[
146,
21
],
[
140,
24
],
[
120,
26
],
[
149,
29
],
[
33,
32
],
[
120,
38
],
[
141,
42
],
[
129,
42
],
[
138,
42
],
[
120,
46
],
[
32,
47
],
[
143,
50
],
[
141,
55
],
[
129,
55
],
[
138,
55
],
[
120,
59
],
[
32,
60
],
[
122,
65
],
[
125,
68
],
[
137,
71
],
[
138,
76
],
[
141,
76
],
[
129,
76
],
[
120,
80
],
[
32,
81
],
[
152,
84
],
[
138,
89
],
[
141,
89
],
[
129,
89
],
[
120,
93
],
[
32,
94
],
[
131,
99
],
[
134,
102
],
[
128,
105
],
[
116,
110
],
[
117,
114
],
[
132,
114
],
[
123,
114
],
[
147,
114
],
[
116,
117
],
[
119,
120
],
[
122,
123
],
[
125,
126
],
[
128,
129
],
[
131,
132
],
[
134,
135
],
[
137,
138
],
[
140,
141
],
[
143,
144
],
[
146,
147
],
[
149,
150
],
[
152,
153
]
] |
[
"s = list(input())\n\nif len(set(s)) == 1:\n print(0)\n exit()\n\nans = 0\ntmp = s[0]\nstate = False\nfor i in range(1,len(s)):\n if tmp == \"B\" and s[i] == \"W\":\n state = True\n elif tmp == \"B\" and s[i] == \"B\":\n if state:\n ans += 2\n state = False\n tmp = \"B\"\n if tmp == \"W\" and s[i] == \"B\":\n state = True\n elif tmp == \"W\" and s[i] == \"W\":\n if state:\n ans += 2\n state = False\n tmp = \"W\"\n\nif state:\n ans += 1\nprint(ans)\n\n",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"if len(set(s)) == 1:\n print(0)\n exit()",
"len(set(s)) == 1",
"len(set(s))",
"len",
"set(s)",
"set",
"s",
"1",
"print(0)",
"print",
"0",
"exit()",
"exit",
"ans = 0",
"ans",
"0",
"tmp = s[0]",
"tmp",
"s[0]",
"s",
"0",
"state = False",
"state",
"False",
"for i in range(1,len(s)):\n if tmp == \"B\" and s[i] == \"W\":\n state = True\n elif tmp == \"B\" and s[i] == \"B\":\n if state:\n ans += 2\n state = False\n tmp = \"B\"\n if tmp == \"W\" and s[i] == \"B\":\n state = True\n elif tmp == \"W\" and s[i] == \"W\":\n if state:\n ans += 2\n state = False\n tmp = \"W\"",
"i",
"range(1,len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if tmp == \"B\" and s[i] == \"W\":\n state = True\n elif tmp == \"B\" and s[i] == \"B\":\n if state:\n ans += 2\n state = False\n tmp = \"B\"\n ",
"tmp == \"B\" and s[i] == \"W\"",
"tmp == \"B\"",
"tmp",
"\"B\"",
"s[i] == \"W\"",
"s[i]",
"s",
"i",
"\"W\"",
"state = True",
"state",
"True",
"elif tmp == \"B\" and s[i] == \"B\":\n if state:\n ans += 2\n state = False\n tmp = \"B\"\n ",
"tmp == \"B\" and s[i] == \"B\"",
"tmp == \"B\"",
"tmp",
"\"B\"",
"s[i] == \"B\"",
"s[i]",
"s",
"i",
"\"B\"",
"if state:\n ans += 2\n state = False\n tmp = \"B\"\n ",
"state",
"ans += 2",
"ans",
"2",
"state = False",
"state",
"False",
"tmp = \"B\"",
"tmp",
"\"B\"",
"if tmp == \"W\" and s[i] == \"B\":\n state = True\n elif tmp == \"W\" and s[i] == \"W\":\n if state:\n ans += 2\n state = False\n tmp = \"W\"",
"tmp == \"W\" and s[i] == \"B\"",
"tmp == \"W\"",
"tmp",
"\"W\"",
"s[i] == \"B\"",
"s[i]",
"s",
"i",
"\"B\"",
"state = True",
"state",
"True",
"elif tmp == \"W\" and s[i] == \"W\":\n if state:\n ans += 2\n state = False\n tmp = \"W\"",
"tmp == \"W\" and s[i] == \"W\"",
"tmp == \"W\"",
"tmp",
"\"W\"",
"s[i] == \"W\"",
"s[i]",
"s",
"i",
"\"W\"",
"if state:\n ans += 2\n state = False\n tmp = \"W\"",
"state",
"ans += 2",
"ans",
"2",
"state = False",
"state",
"False",
"tmp = \"W\"",
"tmp",
"\"W\"",
"if state:\n ans += 1",
"state",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans += 1",
"1",
"ans",
"s = list(input())",
"list(input())",
"s",
"ans += 2",
"2",
"ans",
"state = False",
"False",
"state",
"tmp = \"W\"",
"\"W\"",
"tmp",
"ans += 2",
"2",
"ans",
"state = False",
"False",
"state",
"tmp = \"B\"",
"\"B\"",
"tmp",
"tmp = s[0]",
"s[0]",
"tmp",
"state = True",
"True",
"state",
"ans = 0",
"0",
"ans",
"state = False",
"False",
"state",
"state = True",
"True",
"state"
] |
s = list(input())
if len(set(s)) == 1:
print(0)
exit()
ans = 0
tmp = s[0]
state = False
for i in range(1,len(s)):
if tmp == "B" and s[i] == "W":
state = True
elif tmp == "B" and s[i] == "B":
if state:
ans += 2
state = False
tmp = "B"
if tmp == "W" and s[i] == "B":
state = True
elif tmp == "W" and s[i] == "W":
if state:
ans += 2
state = False
tmp = "W"
if state:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
0,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
17,
4,
13,
28,
13,
4,
13,
17,
13,
14,
2,
13,
2,
13,
17,
0,
13,
17,
14,
40,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
2,
13,
17,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13
] |
[
[
71,
2
],
[
65,
6
],
[
74,
9
],
[
72,
11
],
[
62,
14
],
[
72,
17
],
[
63,
20
],
[
29,
28
],
[
63,
32
],
[
28,
35
],
[
63,
37
],
[
68,
40
],
[
72,
45
],
[
28,
46
],
[
75,
47
],
[
81,
47
],
[
80,
49
],
[
72,
51
],
[
28,
52
],
[
77,
54
],
[
78,
59
],
[
69,
59
],
[
66,
59
],
[
62,
63
],
[
65,
66
],
[
68,
69
],
[
71,
72
],
[
74,
75
],
[
77,
78
],
[
80,
81
]
] |
[
"S = input()\nans = 0\ntmp = S[0]\nN = len(S)\nif N == 1:\n print(0)\n exit()\nfor i in range(1, N):\n if i == N-1:\n ans += 1\n if S[i] != tmp:\n tmp = S[i]\n ans += 1\nprint(ans-1)",
"S = input()",
"S",
"input()",
"input",
"ans = 0",
"ans",
"0",
"tmp = S[0]",
"tmp",
"S[0]",
"S",
"0",
"N = len(S)",
"N",
"len(S)",
"len",
"S",
"if N == 1:\n print(0)\n exit()",
"N == 1",
"N",
"1",
"print(0)",
"print",
"0",
"exit()",
"exit",
"for i in range(1, N):\n if i == N-1:\n ans += 1\n if S[i] != tmp:\n tmp = S[i]\n ans += 1",
"i",
"range(1, N)",
"range",
"1",
"N",
"if i == N-1:\n ans += 1\n ",
"i == N-1",
"i",
"N-1",
"N",
"1",
"ans += 1",
"ans",
"1",
"if S[i] != tmp:\n tmp = S[i]\n ans += 1",
"S[i] != tmp",
"S[i]",
"S",
"i",
"tmp",
"tmp = S[i]",
"tmp",
"S[i]",
"S",
"i",
"ans += 1",
"ans",
"1",
"print(ans-1)",
"print",
"ans-1",
"ans",
"1",
"N = len(S)",
"len(S)",
"N",
"ans = 0",
"0",
"ans",
"ans += 1",
"1",
"ans",
"S = input()",
"input()",
"S",
"tmp = S[0]",
"S[0]",
"tmp",
"ans += 1",
"1",
"ans",
"tmp = S[i]",
"S[i]",
"tmp"
] |
S = input()
ans = 0
tmp = S[0]
N = len(S)
if N == 1:
print(0)
exit()
for i in range(1, N):
if i == N-1:
ans += 1
if S[i] != tmp:
tmp = S[i]
ans += 1
print(ans-1)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13
] |
[
[
36,
2
],
[
30,
6
],
[
37,
8
],
[
33,
11
],
[
15,
14
],
[
37,
14
],
[
31,
18
],
[
43,
18
],
[
14,
19
],
[
39,
21
],
[
42,
24
],
[
14,
25
],
[
40,
28
],
[
34,
28
],
[
30,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
14,
42
],
[
42,
43
]
] |
[
"S = input()\nprev = S[0]\ncount = 0\nfor c in S:\n if prev != c:\n count += 1\n prev = c\nprint(count)",
"S = input()",
"S",
"input()",
"input",
"prev = S[0]",
"prev",
"S[0]",
"S",
"0",
"count = 0",
"count",
"0",
"for c in S:\n if prev != c:\n count += 1\n prev = c",
"c",
"S",
"if prev != c:\n count += 1\n prev = c",
"prev != c",
"prev",
"c",
"count += 1",
"count",
"1",
"prev = c",
"prev",
"c",
"print(count)",
"print",
"count",
"prev = S[0]",
"S[0]",
"prev",
"count = 0",
"0",
"count",
"S = input()",
"input()",
"S",
"count += 1",
"1",
"count",
"prev = c",
"c",
"prev"
] |
S = input()
prev = S[0]
count = 0
for c in S:
if prev != c:
count += 1
prev = c
print(count)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
13,
13
] |
[
[
30,
2
],
[
36,
6
],
[
31,
8
],
[
39,
11
],
[
15,
14
],
[
31,
14
],
[
14,
18
],
[
37,
19
],
[
43,
19
],
[
33,
21
],
[
42,
24
],
[
14,
25
],
[
34,
28
],
[
40,
28
],
[
30,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
14,
42
],
[
42,
43
]
] |
[
"s=input()\nmozi=s[0]\ncount=0\nfor i in s:\n if i!=mozi:\n count+=1\n mozi=i\nprint(count)",
"s=input()",
"s",
"input()",
"input",
"mozi=s[0]",
"mozi",
"s[0]",
"s",
"0",
"count=0",
"count",
"0",
"for i in s:\n if i!=mozi:\n count+=1\n mozi=i",
"i",
"s",
"if i!=mozi:\n count+=1\n mozi=i",
"i!=mozi",
"i",
"mozi",
"count+=1",
"count",
"1",
"mozi=i",
"mozi",
"i",
"print(count)",
"print",
"count",
"s=input()",
"input()",
"s",
"count+=1",
"1",
"count",
"mozi=s[0]",
"s[0]",
"mozi",
"count=0",
"0",
"count",
"mozi=i",
"i",
"mozi"
] |
s=input()
mozi=s[0]
count=0
for i in s:
if i!=mozi:
count+=1
mozi=i
print(count)
|
[
7,
15,
13,
15,
13,
12,
13,
12,
13,
14,
2,
13,
17,
29,
17,
14,
2,
18,
13,
2,
13,
17,
18,
13,
2,
13,
17,
29,
4,
13,
2,
13,
17,
29,
2,
4,
13,
2,
13,
17,
17,
23,
13,
0,
13,
4,
13,
0,
13,
18,
13,
17,
41,
28,
13,
13,
4,
8,
2,
13,
13,
17,
17,
0,
13,
13,
4,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
4,
18,
13,
13,
2,
2,
17,
17,
17,
4,
18,
13,
13,
2,
2,
2,
17,
17,
17,
17,
4,
18,
4,
18,
13,
13,
0,
13,
13,
13,
10,
12,
13
] |
[
[
42,
11
],
[
42,
20
],
[
42,
25
],
[
42,
31
],
[
42,
38
],
[
42,
42
],
[
45,
44
],
[
49,
48
],
[
44,
50
],
[
55,
54
],
[
44,
54
],
[
48,
59
],
[
54,
60
],
[
65,
64
],
[
8,
69
],
[
64,
72
],
[
44,
72
],
[
105,
104
],
[
109,
105
]
] |
[
"import threading\nimport sys\n\n\ndef main():\n def solve(n):\n if n == 1:\n return 0\n else:\n if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n S = input()\n first_s = S[0]\n S = [1 if first_s == s else 0 for s in S]\n\n print(solve(len(S)))\n\n\nif __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024 * 2)\n threading.stack_size(128 * 1024 * 1024 * 2)\n threading.Thread(target=main).start()",
"import threading",
"threading",
"import sys",
"sys",
"def main():\n def solve(n):\n if n == 1:\n return 0\n else:\n if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n S = input()\n first_s = S[0]\n S = [1 if first_s == s else 0 for s in S]\n\n print(solve(len(S)))",
"main",
"def solve(n):\n if n == 1:\n return 0\n else:\n if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n ",
"solve",
"if n == 1:\n return 0\n else:\n if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n ",
"n == 1",
"n",
"1",
"return 0",
"0",
"if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n ",
"S[n - 2] == S[n - 1]",
"S[n - 2]",
"S",
"n - 2",
"n",
"2",
"S[n - 1]",
"S",
"n - 1",
"n",
"1",
"return solve(n - 1)",
"solve(n - 1)",
"solve",
"n - 1",
"n",
"1",
"return solve(n - 1) + 1",
"solve(n - 1) + 1",
"solve(n - 1)",
"solve",
"n - 1",
"n",
"1",
"1",
"n",
"n",
"S = input()",
"S",
"input()",
"input",
"first_s = S[0]",
"first_s",
"S[0]",
"S",
"0",
"1 if first_s == s else 0 for s in S",
"for s in S",
"s",
"S",
"for s in S",
"1 if first_s == s else 0",
"first_s == s",
"first_s",
"s",
"1",
"0",
"S = [1 if first_s == s else 0 for s in S]",
"S",
"[1 if first_s == s else 0 for s in S]",
"print(solve(len(S)))",
"print",
"solve(len(S))",
"solve",
"len(S)",
"len",
"S",
"if __name__ == \"__main__\":\n\n sys.setrecursionlimit(1024 * 1024 * 2)\n threading.stack_size(128 * 1024 * 1024 * 2)\n threading.Thread(target=main).start()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"sys.setrecursionlimit(1024 * 1024 * 2)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"1024 * 1024 * 2",
"1024 * 1024",
"1024",
"1024",
"2",
"threading.stack_size(128 * 1024 * 1024 * 2)",
"threading.stack_size",
"threading",
"stack_size",
"128 * 1024 * 1024 * 2",
"128 * 1024 * 1024",
"128 * 1024",
"128",
"1024",
"1024",
"2",
"threading.Thread(target=main).start()",
"threading.Thread(target=main).start",
"threading.Thread(target=main)",
"threading.Thread",
"threading",
"Thread",
"target=main",
"target",
"main",
"start",
"def main():\n def solve(n):\n if n == 1:\n return 0\n else:\n if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n S = input()\n first_s = S[0]\n S = [1 if first_s == s else 0 for s in S]\n\n print(solve(len(S)))",
"def main():\n def solve(n):\n if n == 1:\n return 0\n else:\n if S[n - 2] == S[n - 1]:\n return solve(n - 1)\n else:\n return solve(n - 1) + 1\n\n S = input()\n first_s = S[0]\n S = [1 if first_s == s else 0 for s in S]\n\n print(solve(len(S)))",
"main"
] |
import threading
import sys
def main():
def solve(n):
if n == 1:
return 0
else:
if S[n - 2] == S[n - 1]:
return solve(n - 1)
else:
return solve(n - 1) + 1
S = input()
first_s = S[0]
S = [1 if first_s == s else 0 for s in S]
print(solve(len(S)))
if __name__ == "__main__":
sys.setrecursionlimit(1024 * 1024 * 2)
threading.stack_size(128 * 1024 * 1024 * 2)
threading.Thread(target=main).start()
|
[
7,
0,
13,
4,
13,
14,
2,
4,
13,
13,
17,
4,
13,
17,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
13,
0,
13,
17,
4,
13,
13,
10,
13,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13
] |
[
[
50,
2
],
[
51,
9
],
[
53,
17
],
[
51,
19
],
[
56,
22
],
[
26,
25
],
[
51,
27
],
[
25,
32
],
[
54,
33
],
[
45,
33
],
[
44,
35
],
[
25,
36
],
[
47,
38
],
[
48,
42
],
[
57,
42
],
[
25,
44
],
[
44,
45
],
[
47,
48
],
[
50,
51
],
[
53,
54
],
[
56,
57
]
] |
[
"S = input()\n\nif len(S) == 1:\n print(0)\n exit()\n\nc0 = S[0]\ncnt = 0\nfor c in S[1:]:\n if c != c0:\n c0 = c\n cnt += 1 \nprint(cnt)",
"S = input()",
"S",
"input()",
"input",
"if len(S) == 1:\n print(0)\n exit()",
"len(S) == 1",
"len(S)",
"len",
"S",
"1",
"print(0)",
"print",
"0",
"exit()",
"exit",
"c0 = S[0]",
"c0",
"S[0]",
"S",
"0",
"cnt = 0",
"cnt",
"0",
"for c in S[1:]:\n if c != c0:\n c0 = c\n cnt += 1 ",
"c",
"S[1:]",
"S",
"1:",
"1",
"if c != c0:\n c0 = c\n cnt += 1 ",
"c != c0",
"c",
"c0",
"c0 = c",
"c0",
"c",
"cnt += 1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"c0 = c",
"c",
"c0",
"cnt += 1",
"1",
"cnt",
"S = input()",
"input()",
"S",
"c0 = S[0]",
"S[0]",
"c0",
"cnt = 0",
"0",
"cnt"
] |
S = input()
if len(S) == 1:
print(0)
exit()
c0 = S[0]
cnt = 0
for c in S[1:]:
if c != c0:
c0 = c
cnt += 1
print(cnt)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
0,
13,
18,
13,
13,
14,
40,
18,
13,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13
] |
[
[
42,
2
],
[
48,
6
],
[
10,
9
],
[
43,
14
],
[
9,
17
],
[
45,
20
],
[
43,
22
],
[
9,
23
],
[
43,
27
],
[
9,
28
],
[
52,
29
],
[
46,
29
],
[
54,
31
],
[
51,
34
],
[
43,
36
],
[
9,
37
],
[
55,
40
],
[
49,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
]
] |
[
"s = input()\ncount = 0\nfor i in range(len(s)):\n if(i==0):\n now = s[i]\n else:\n if(s[i] != now):\n count += 1\n now = s[i]\nprint(count)",
"s = input()",
"s",
"input()",
"input",
"count = 0",
"count",
"0",
"for i in range(len(s)):\n if(i==0):\n now = s[i]\n else:\n if(s[i] != now):\n count += 1\n now = s[i]",
"i",
"range(len(s))",
"range",
"len(s)",
"len",
"s",
"if(i==0):\n now = s[i]\n else:\n if(s[i] != now):\n count += 1\n ",
"i==0",
"i",
"0",
"now = s[i]",
"now",
"s[i]",
"s",
"i",
"if(s[i] != now):\n count += 1\n ",
"s[i] != now",
"s[i]",
"s",
"i",
"now",
"count += 1",
"count",
"1",
"now = s[i]",
"now",
"s[i]",
"s",
"i",
"print(count)",
"print",
"count",
"s = input()",
"input()",
"s",
"now = s[i]",
"s[i]",
"now",
"count = 0",
"0",
"count",
"now = s[i]",
"s[i]",
"now",
"count += 1",
"1",
"count"
] |
s = input()
count = 0
for i in range(len(s)):
if(i==0):
now = s[i]
else:
if(s[i] != now):
count += 1
now = s[i]
print(count)
|
[
7,
15,
13,
15,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
18,
18,
13,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
17,
17,
0,
13,
17,
12,
13,
0,
13,
4,
18,
4,
13,
13,
4,
13,
2,
4,
13,
4,
13,
4,
13,
13,
17,
29,
14,
2,
13,
17,
4,
13,
10,
17,
13,
10,
2,
13,
10,
18,
13,
10,
12,
13,
10,
18,
13,
10,
18,
13
] |
[
[
83,
5
],
[
74,
12
],
[
80,
19
],
[
71,
33
],
[
68,
38
],
[
44,
43
],
[
75,
47
],
[
43,
58
],
[
78,
66
],
[
68,
69
],
[
71,
72
],
[
74,
75
],
[
80,
81
],
[
83,
84
]
] |
[
"import sys\nfrom itertools import groupby\n\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\nsys.setrecursionlimit(10 ** 9)\nINF = 1 << 60\nMOD = 1000000007\n\n\ndef main():\n S = readline().strip()\n\n print(len(list(groupby(S))) - 1)\n\n return\n\n\nif __name__ == '__main__':\n main()",
"import sys",
"sys",
"from itertools import groupby",
"read = sys.stdin.read",
"read",
"sys.stdin.read",
"sys.stdin",
"sys",
"stdin",
"read",
"readline = sys.stdin.readline",
"readline",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"readlines = sys.stdin.readlines",
"readlines",
"sys.stdin.readlines",
"sys.stdin",
"sys",
"stdin",
"readlines",
"sys.setrecursionlimit(10 ** 9)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10 ** 9",
"10",
"9",
"INF = 1 << 60",
"INF",
"1 << 60",
"1",
"60",
"MOD = 1000000007",
"MOD",
"1000000007",
"def main():\n S = readline().strip()\n\n print(len(list(groupby(S))) - 1)\n\n return",
"main",
"S = readline().strip()",
"S",
"readline().strip()",
"().strip",
"()",
"readline",
"strip",
"print(len(list(groupby(S))) - 1)",
"print",
"len(list(groupby(S))) - 1",
"len(list(groupby(S)))",
"len",
"list(groupby(S))",
"list",
"groupby(S)",
"groupby",
"S",
"1",
"return",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"MOD = 1000000007",
"1000000007",
"MOD",
"INF = 1 << 60",
"1 << 60",
"INF",
"readline = sys.stdin.readline",
"sys.stdin.readline",
"readline",
"def main():\n S = readline().strip()\n\n print(len(list(groupby(S))) - 1)\n\n return",
"def main():\n S = readline().strip()\n\n print(len(list(groupby(S))) - 1)\n\n return",
"main",
"readlines = sys.stdin.readlines",
"sys.stdin.readlines",
"readlines",
"read = sys.stdin.read",
"sys.stdin.read",
"read"
] |
import sys
from itertools import groupby
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
S = readline().strip()
print(len(list(groupby(S))) - 1)
return
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
18,
13,
17,
0,
13,
17,
0,
13,
39,
28,
13,
4,
13,
13,
14,
40,
18,
13,
13,
13,
4,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
0,
13,
17,
4,
18,
13,
13,
13,
4,
13,
2,
4,
13,
13,
17,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13,
10,
39,
13,
10,
18,
13
] |
[
[
75,
2
],
[
72,
8
],
[
76,
11
],
[
84,
13
],
[
76,
15
],
[
78,
18
],
[
81,
21
],
[
25,
24
],
[
73,
27
],
[
76,
31
],
[
24,
32
],
[
85,
33
],
[
67,
33
],
[
82,
36
],
[
79,
38
],
[
70,
38
],
[
64,
38
],
[
66,
40
],
[
76,
42
],
[
24,
43
],
[
63,
45
],
[
69,
48
],
[
82,
52
],
[
70,
54
],
[
64,
54
],
[
79,
54
],
[
82,
60
],
[
63,
64
],
[
66,
67
],
[
69,
70
],
[
72,
73
],
[
75,
76
],
[
78,
79
],
[
81,
82
],
[
84,
85
]
] |
[
"s = str(input())\nn = len(s)\ncur = s[0]\ncnt = 0\nL = []\nfor i in range(n):\n if s[i] != cur:\n L.append(cnt)\n cur = s[i]\n cnt = 1\n else:\n cnt += 1\nelse:\n L.append(cnt)\n#print(L)\nprint(len(L)-1)",
"s = str(input())",
"s",
"str(input())",
"str",
"input()",
"input",
"n = len(s)",
"n",
"len(s)",
"len",
"s",
"cur = s[0]",
"cur",
"s[0]",
"s",
"0",
"cnt = 0",
"cnt",
"0",
"L = []",
"L",
"[]",
"for i in range(n):\n if s[i] != cur:\n L.append(cnt)\n cur = s[i]\n cnt = 1\n else:\n cnt += 1\nelse:\n L.append(cnt)\n#print(L)",
"i",
"range(n)",
"range",
"n",
"if s[i] != cur:\n L.append(cnt)\n cur = s[i]\n cnt = 1\n else:\n cnt += 1",
"s[i] != cur",
"s[i]",
"s",
"i",
"cur",
"L.append(cnt)",
"L.append",
"L",
"append",
"cnt",
"cur = s[i]",
"cur",
"s[i]",
"s",
"i",
"cnt = 1",
"cnt",
"1",
"cnt += 1",
"cnt",
"1",
"L.append(cnt)",
"L.append",
"L",
"append",
"cnt",
"print(len(L)-1)",
"print",
"len(L)-1",
"len(L)",
"len",
"L",
"1",
"cnt = 1",
"1",
"cnt",
"cur = s[i]",
"s[i]",
"cur",
"cnt += 1",
"1",
"cnt",
"n = len(s)",
"len(s)",
"n",
"s = str(input())",
"str(input())",
"s",
"cnt = 0",
"0",
"cnt",
"L = []",
"[]",
"L",
"cur = s[0]",
"s[0]",
"cur"
] |
s = str(input())
n = len(s)
cur = s[0]
cnt = 0
L = []
for i in range(n):
if s[i] != cur:
L.append(cnt)
cur = s[i]
cnt = 1
else:
cnt += 1
else:
L.append(cnt)
#print(L)
print(len(L)-1)
|
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
15,
15,
0,
13,
18,
4,
13,
39,
17,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13
] |
[
[
48,
4
],
[
57,
13
],
[
49,
16
],
[
54,
20
],
[
24,
23
],
[
58,
29
],
[
58,
34
],
[
23,
35
],
[
58,
37
],
[
23,
39
],
[
51,
42
],
[
52,
46
],
[
55,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
]
] |
[
"import sys\ninput = sys.stdin.readline\nfrom collections import *\nfrom itertools import permutations\n\nS = input()[:-1]\nans = 0\n\nfor i in range(len(S)-1):\n if S[i]!=S[i+1]:\n ans += 1\n \nprint(ans)",
"import sys",
"sys",
"input = sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"from collections import *",
"from itertools import permutations",
"S = input()[:-1]",
"S",
"input()[:-1]",
"()",
"input",
":-1",
"-1",
"ans = 0",
"ans",
"0",
"for i in range(len(S)-1):\n if S[i]!=S[i+1]:\n ans += 1\n ",
"i",
"range(len(S)-1)",
"range",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"if S[i]!=S[i+1]:\n ans += 1\n ",
"S[i]!=S[i+1]",
"S[i]",
"S",
"i",
"S[i+1]",
"S",
"i+1",
"i",
"1",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"input = sys.stdin.readline",
"sys.stdin.readline",
"input",
"ans += 1",
"1",
"ans",
"ans = 0",
"0",
"ans",
"S = input()[:-1]",
"input()[:-1]",
"S"
] |
import sys
input = sys.stdin.readline
from collections import *
from itertools import permutations
S = input()[:-1]
ans = 0
for i in range(len(S)-1):
if S[i]!=S[i+1]:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
9,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13
] |
[
[
47,
2
],
[
44,
6
],
[
48,
9
],
[
38,
11
],
[
15,
14
],
[
45,
18
],
[
48,
23
],
[
14,
24
],
[
48,
26
],
[
14,
28
],
[
41,
32
],
[
42,
36
],
[
39,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
]
] |
[
"s=input()\nn=len(s)\nans=0\nfor i in range(n-1):\n if s[i]==s[i+1]:\n continue\n else:\n ans+=1\nprint(ans)",
"s=input()",
"s",
"input()",
"input",
"n=len(s)",
"n",
"len(s)",
"len",
"s",
"ans=0",
"ans",
"0",
"for i in range(n-1):\n if s[i]==s[i+1]:\n continue\n else:\n ans+=1",
"i",
"range(n-1)",
"range",
"n-1",
"n",
"1",
"if s[i]==s[i+1]:\n continue\n else:\n ans+=1",
"s[i]==s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"continue",
"ans+=1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans=0",
"0",
"ans",
"ans+=1",
"1",
"ans",
"n=len(s)",
"len(s)",
"n",
"s=input()",
"input()",
"s"
] |
s=input()
n=len(s)
ans=0
for i in range(n-1):
if s[i]==s[i+1]:
continue
else:
ans+=1
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
39,
2
],
[
42,
8
],
[
12,
11
],
[
40,
17
],
[
40,
22
],
[
11,
23
],
[
40,
25
],
[
11,
27
],
[
36,
30
],
[
37,
34
],
[
43,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"S = list(input())\nc = 0\nfor i in range(len(S)-1):\n if S[i] != S[i+1]:\n c += 1\nprint(c)",
"S = list(input())",
"S",
"list(input())",
"list",
"input()",
"input",
"c = 0",
"c",
"0",
"for i in range(len(S)-1):\n if S[i] != S[i+1]:\n c += 1",
"i",
"range(len(S)-1)",
"range",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"if S[i] != S[i+1]:\n c += 1",
"S[i] != S[i+1]",
"S[i]",
"S",
"i",
"S[i+1]",
"S",
"i+1",
"i",
"1",
"c += 1",
"c",
"1",
"print(c)",
"print",
"c",
"c += 1",
"1",
"c",
"S = list(input())",
"list(input())",
"S",
"c = 0",
"0",
"c"
] |
S = list(input())
c = 0
for i in range(len(S)-1):
if S[i] != S[i+1]:
c += 1
print(c)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
13,
17,
14,
2,
13,
18,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
13,
14,
2,
13,
18,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
17,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13
] |
[
[
81,
2
],
[
87,
6
],
[
82,
8
],
[
90,
11
],
[
105,
14
],
[
18,
17
],
[
82,
23
],
[
106,
26
],
[
85,
26
],
[
97,
26
],
[
88,
30
],
[
100,
30
],
[
103,
30
],
[
82,
32
],
[
17,
33
],
[
88,
36
],
[
100,
36
],
[
103,
36
],
[
82,
38
],
[
17,
39
],
[
93,
41
],
[
96,
44
],
[
102,
47
],
[
82,
49
],
[
17,
50
],
[
88,
53
],
[
100,
53
],
[
103,
53
],
[
82,
55
],
[
17,
56
],
[
88,
59
],
[
100,
59
],
[
103,
59
],
[
82,
61
],
[
17,
62
],
[
78,
64
],
[
84,
67
],
[
99,
70
],
[
82,
72
],
[
17,
73
],
[
79,
76
],
[
94,
76
],
[
91,
76
],
[
78,
79
],
[
81,
82
],
[
84,
85
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
],
[
105,
106
]
] |
[
"s= input()\n\nnow = s[0]\nans = 0\nflg = 0\nfor i in range(1,len(s)):\n if flg == 0:\n if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 1\n now = s[i]\n\n else:\n if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 0\n now = s[i]\n \nprint(ans)",
"s= input()",
"s",
"input()",
"input",
"now = s[0]",
"now",
"s[0]",
"s",
"0",
"ans = 0",
"ans",
"0",
"flg = 0",
"flg",
"0",
"for i in range(1,len(s)):\n if flg == 0:\n if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 1\n now = s[i]\n\n else:\n if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 0\n now = s[i]\n ",
"i",
"range(1,len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if flg == 0:\n if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 1\n now = s[i]\n\n else:\n if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 0\n now = s[i]\n ",
"flg == 0",
"flg",
"0",
"if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 1\n now = s[i]\n\n ",
"now == s[i]",
"now",
"s[i]",
"s",
"i",
"elif now != s[i]:\n ans += 1\n flg = 1\n now = s[i]\n\n ",
"now != s[i]",
"now",
"s[i]",
"s",
"i",
"ans += 1",
"ans",
"1",
"flg = 1",
"flg",
"1",
"now = s[i]",
"now",
"s[i]",
"s",
"i",
"if now == s[i]:\n pass\n elif now != s[i]:\n ans += 1\n flg = 0\n now = s[i]\n ",
"now == s[i]",
"now",
"s[i]",
"s",
"i",
"elif now != s[i]:\n ans += 1\n flg = 0\n now = s[i]\n ",
"now != s[i]",
"now",
"s[i]",
"s",
"i",
"ans += 1",
"ans",
"1",
"flg = 0",
"flg",
"0",
"now = s[i]",
"now",
"s[i]",
"s",
"i",
"print(ans)",
"print",
"ans",
"ans += 1",
"1",
"ans",
"s= input()",
"input()",
"s",
"flg = 0",
"0",
"flg",
"now = s[0]",
"s[0]",
"now",
"ans = 0",
"0",
"ans",
"ans += 1",
"1",
"ans",
"flg = 1",
"1",
"flg",
"now = s[i]",
"s[i]",
"now",
"now = s[i]",
"s[i]",
"now",
"flg = 0",
"0",
"flg"
] |
s= input()
now = s[0]
ans = 0
flg = 0
for i in range(1,len(s)):
if flg == 0:
if now == s[i]:
pass
elif now != s[i]:
ans += 1
flg = 1
now = s[i]
else:
if now == s[i]:
pass
elif now != s[i]:
ans += 1
flg = 0
now = s[i]
print(ans)
|
[
7,
12,
13,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
13,
0,
13,
17,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
9,
8
],
[
4,
10
],
[
14,
13
],
[
17,
16
],
[
4,
18
],
[
16,
23
],
[
8,
24
],
[
26,
24
],
[
27,
26
],
[
16,
27
],
[
30,
29
],
[
29,
33
],
[
13,
33
],
[
42,
39
]
] |
[
"def main():\n S = input()\n p = S[0]\n c = 0\n for s in S[1:]:\n if s != p:\n p = s\n c += 1\n print(c)\n \nif __name__ == \"__main__\":\n main()",
"def main():\n S = input()\n p = S[0]\n c = 0\n for s in S[1:]:\n if s != p:\n p = s\n c += 1\n print(c)\n ",
"main",
"S = input()",
"S",
"input()",
"input",
"p = S[0]",
"p",
"S[0]",
"S",
"0",
"c = 0",
"c",
"0",
"for s in S[1:]:\n if s != p:\n p = s\n c += 1\n ",
"s",
"S[1:]",
"S",
"1:",
"1",
"if s != p:\n p = s\n c += 1\n ",
"s != p",
"s",
"p",
"p = s",
"p",
"s",
"c += 1",
"c",
"1",
"print(c)",
"print",
"c",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n S = input()\n p = S[0]\n c = 0\n for s in S[1:]:\n if s != p:\n p = s\n c += 1\n print(c)\n ",
"def main():\n S = input()\n p = S[0]\n c = 0\n for s in S[1:]:\n if s != p:\n p = s\n c += 1\n print(c)\n ",
"main"
] |
def main():
S = input()
p = S[0]
c = 0
for s in S[1:]:
if s != p:
p = s
c += 1
print(c)
if __name__ == "__main__":
main()
|
[
7,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
18,
13,
2,
13,
17,
4,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13
] |
[
[
42,
2
],
[
39,
6
],
[
10,
9
],
[
43,
15
],
[
43,
19
],
[
9,
21
],
[
43,
24
],
[
9,
25
],
[
45,
27
],
[
43,
29
],
[
9,
31
],
[
46,
37
],
[
40,
37
],
[
39,
40
],
[
42,
43
],
[
45,
46
]
] |
[
"s = input()\n\nans = ''\nfor i in range(1, len(s)):\n if s[i - 1] != s[i]:\n ans += s[i - 1]\n\nprint(len(ans))",
"s = input()",
"s",
"input()",
"input",
"ans = ''",
"ans",
"''",
"for i in range(1, len(s)):\n if s[i - 1] != s[i]:\n ans += s[i - 1]",
"i",
"range(1, len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[i - 1] != s[i]:\n ans += s[i - 1]",
"s[i - 1] != s[i]",
"s[i - 1]",
"s",
"i - 1",
"i",
"1",
"s[i]",
"s",
"i",
"ans += s[i - 1]",
"ans",
"s[i - 1]",
"s",
"i - 1",
"i",
"1",
"print(len(ans))",
"print",
"len(ans)",
"len",
"ans",
"ans = ''",
"''",
"ans",
"s = input()",
"input()",
"s",
"ans += s[i - 1]",
"s[i - 1]",
"ans"
] |
s = input()
ans = ''
for i in range(1, len(s)):
if s[i - 1] != s[i]:
ans += s[i - 1]
print(len(ans))
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
4,
13,
13,
28,
13,
4,
13,
17,
13,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
36,
2
],
[
45,
6
],
[
42,
9
],
[
37,
12
],
[
15,
14
],
[
43,
18
],
[
37,
22
],
[
14,
23
],
[
37,
25
],
[
14,
27
],
[
39,
30
],
[
40,
34
],
[
46,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
],
[
45,
46
]
] |
[
"s = input()\ncount = 0\nt = len(s)\nfor i in range(1,t):\n if s[i] != s[i-1]:\n count+=1\nprint(count)",
"s = input()",
"s",
"input()",
"input",
"count = 0",
"count",
"0",
"t = len(s)",
"t",
"len(s)",
"len",
"s",
"for i in range(1,t):\n if s[i] != s[i-1]:\n count+=1",
"i",
"range(1,t)",
"range",
"1",
"t",
"if s[i] != s[i-1]:\n count+=1",
"s[i] != s[i-1]",
"s[i]",
"s",
"i",
"s[i-1]",
"s",
"i-1",
"i",
"1",
"count+=1",
"count",
"1",
"print(count)",
"print",
"count",
"s = input()",
"input()",
"s",
"count+=1",
"1",
"count",
"t = len(s)",
"len(s)",
"t",
"count = 0",
"0",
"count"
] |
s = input()
count = 0
t = len(s)
for i in range(1,t):
if s[i] != s[i-1]:
count+=1
print(count)
|
[
7,
12,
13,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
18,
13,
13,
13,
14,
2,
13,
17,
0,
13,
17,
0,
13,
18,
13,
13,
29,
13,
23,
13,
12,
13,
29,
4,
13,
13,
23,
13,
12,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
29,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] |
[
[
5,
4
],
[
8,
7
],
[
11,
10
],
[
37,
15
],
[
37,
19
],
[
10,
20
],
[
7,
21
],
[
30,
21
],
[
7,
24
],
[
30,
24
],
[
28,
27
],
[
31,
30
],
[
37,
32
],
[
10,
33
],
[
27,
35
],
[
4,
35
],
[
37,
37
],
[
72,
42
],
[
45,
43
],
[
45,
45
],
[
50,
49
],
[
66,
55
],
[
49,
56
],
[
69,
63
]
] |
[
"#!/usr/bin/env python3\n\n# from numba import njit\n\n# input = stdin.readline\n\ndef calcDivision(s):\n res = 0\n prev = \"\"\n for i in range(len(s)):\n if s[i] == prev:\n pass\n else:\n if prev == \"\":\n pass\n else:\n res += 1\n prev = s[i]\n return res\n\n# @njit\ndef solve(s):\n return calcDivision(s)\n\n\n\ndef main():\n s = input()\n print(solve(s))\n return\n\nif __name__ == '__main__':\n main()",
"def calcDivision(s):\n res = 0\n prev = \"\"\n for i in range(len(s)):\n if s[i] == prev:\n pass\n else:\n if prev == \"\":\n pass\n else:\n res += 1\n prev = s[i]\n return res\n\n# @njit",
"calcDivision",
"res = 0",
"res",
"0",
"prev = \"\"",
"prev",
"\"\"",
"for i in range(len(s)):\n if s[i] == prev:\n pass\n else:\n if prev == \"\":\n pass\n else:\n res += 1\n prev = s[i]\n ",
"i",
"range(len(s))",
"range",
"len(s)",
"len",
"s",
"if s[i] == prev:\n pass\n else:\n if prev == \"\":\n pass\n else:\n res += 1\n ",
"s[i] == prev",
"s[i]",
"s",
"i",
"prev",
"if prev == \"\":\n pass\n else:\n res += 1\n ",
"prev == \"\"",
"prev",
"\"\"",
"res += 1",
"res",
"1",
"prev = s[i]",
"prev",
"s[i]",
"s",
"i",
"return res",
"res",
"s",
"s",
"def solve(s):\n return calcDivision(s)",
"solve",
"return calcDivision(s)",
"calcDivision(s)",
"calcDivision",
"s",
"s",
"s",
"def main():\n s = input()\n print(solve(s))\n return",
"main",
"s = input()",
"s",
"input()",
"input",
"print(solve(s))",
"print",
"solve(s)",
"solve",
"s",
"return",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def solve(s):\n return calcDivision(s)",
"def solve(s):\n return calcDivision(s)",
"solve",
"def main():\n s = input()\n print(solve(s))\n return",
"def main():\n s = input()\n print(solve(s))\n return",
"main",
"def calcDivision(s):\n res = 0\n prev = \"\"\n for i in range(len(s)):\n if s[i] == prev:\n pass\n else:\n if prev == \"\":\n pass\n else:\n res += 1\n prev = s[i]\n return res\n\n# @njit",
"def calcDivision(s):\n res = 0\n prev = \"\"\n for i in range(len(s)):\n if s[i] == prev:\n pass\n else:\n if prev == \"\":\n pass\n else:\n res += 1\n prev = s[i]\n return res\n\n# @njit",
"calcDivision"
] |
#!/usr/bin/env python3
# from numba import njit
# input = stdin.readline
def calcDivision(s):
res = 0
prev = ""
for i in range(len(s)):
if s[i] == prev:
pass
else:
if prev == "":
pass
else:
res += 1
prev = s[i]
return res
# @njit
def solve(s):
return calcDivision(s)
def main():
s = input()
print(solve(s))
return
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13
] |
[
[
39,
2
],
[
45,
6
],
[
33,
9
],
[
40,
11
],
[
15,
14
],
[
40,
16
],
[
34,
21
],
[
43,
21
],
[
14,
22
],
[
36,
24
],
[
42,
27
],
[
14,
28
],
[
37,
31
],
[
46,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
14,
42
],
[
42,
43
],
[
45,
46
]
] |
[
"s = input()\n\nans = 0\nbef = s[0]\nfor c in s[1:]:\n if bef != c:\n ans += 1\n bef = c\n\nprint(ans)",
"s = input()",
"s",
"input()",
"input",
"ans = 0",
"ans",
"0",
"bef = s[0]",
"bef",
"s[0]",
"s",
"0",
"for c in s[1:]:\n if bef != c:\n ans += 1\n bef = c",
"c",
"s[1:]",
"s",
"1:",
"1",
"if bef != c:\n ans += 1\n ",
"bef != c",
"bef",
"c",
"ans += 1",
"ans",
"1",
"bef = c",
"bef",
"c",
"print(ans)",
"print",
"ans",
"bef = s[0]",
"s[0]",
"bef",
"ans += 1",
"1",
"ans",
"s = input()",
"input()",
"s",
"bef = c",
"c",
"bef",
"ans = 0",
"0",
"ans"
] |
s = input()
ans = 0
bef = s[0]
for c in s[1:]:
if bef != c:
ans += 1
bef = c
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
39,
17,
17,
0,
13,
17,
14,
2,
18,
13,
17,
17,
0,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
2,
2,
13,
17,
2,
18,
13,
39,
13,
2,
13,
17,
17,
0,
13,
17,
0,
13,
17,
14,
2,
2,
13,
17,
2,
18,
13,
39,
13,
2,
13,
17,
17,
0,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
39,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
99,
2
],
[
93,
6
],
[
84,
11
],
[
100,
16
],
[
96,
20
],
[
90,
23
],
[
27,
26
],
[
100,
32
],
[
91,
37
],
[
97,
37
],
[
82,
37
],
[
103,
37
],
[
100,
41
],
[
26,
45
],
[
78,
49
],
[
102,
52
],
[
103,
57
],
[
91,
57
],
[
97,
57
],
[
82,
57
],
[
100,
61
],
[
26,
65
],
[
87,
69
],
[
81,
72
],
[
88,
76
],
[
79,
76
],
[
85,
76
],
[
78,
79
],
[
81,
82
],
[
84,
85
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
],
[
102,
103
]
] |
[
"S = input()\n\nls = [\"WB\", \"BW\"]\n\ncnt = 0\nif S[0] == \"W\":\n i = 0\nelse:\n i = 1\n\nfor j in range(len(S)-1):\n if i == 0 and S[j:j+2] == \"WB\":\n cnt += 1\n i = 1\n if i == 1 and S[j:j+2] == \"BW\":\n cnt += 1\n i = 0\n \nprint(cnt)",
"S = input()",
"S",
"input()",
"input",
"ls = [\"WB\", \"BW\"]",
"ls",
"[\"WB\", \"BW\"]",
"\"WB\"",
"\"BW\"",
"cnt = 0",
"cnt",
"0",
"if S[0] == \"W\":\n i = 0\nelse:\n i = 1",
"S[0] == \"W\"",
"S[0]",
"S",
"0",
"\"W\"",
"i = 0",
"i",
"0",
"i = 1",
"i",
"1",
"for j in range(len(S)-1):\n if i == 0 and S[j:j+2] == \"WB\":\n cnt += 1\n i = 1\n if i == 1 and S[j:j+2] == \"BW\":\n cnt += 1\n i = 0\n ",
"j",
"range(len(S)-1)",
"range",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"if i == 0 and S[j:j+2] == \"WB\":\n cnt += 1\n i = 1\n ",
"i == 0 and S[j:j+2] == \"WB\"",
"i == 0",
"i",
"0",
"S[j:j+2] == \"WB\"",
"S[j:j+2]",
"S",
"j:j+2",
"j",
"j+2",
"j",
"2",
"\"WB\"",
"cnt += 1",
"cnt",
"1",
"i = 1",
"i",
"1",
"if i == 1 and S[j:j+2] == \"BW\":\n cnt += 1\n i = 0\n ",
"i == 1 and S[j:j+2] == \"BW\"",
"i == 1",
"i",
"1",
"S[j:j+2] == \"BW\"",
"S[j:j+2]",
"S",
"j:j+2",
"j",
"j+2",
"j",
"2",
"\"BW\"",
"cnt += 1",
"cnt",
"1",
"i = 0",
"i",
"0",
"print(cnt)",
"print",
"cnt",
"cnt += 1",
"1",
"cnt",
"i = 0",
"0",
"i",
"cnt = 0",
"0",
"cnt",
"cnt += 1",
"1",
"cnt",
"i = 1",
"1",
"i",
"ls = [\"WB\", \"BW\"]",
"[\"WB\", \"BW\"]",
"ls",
"i = 0",
"0",
"i",
"S = input()",
"input()",
"S",
"i = 1",
"1",
"i"
] |
S = input()
ls = ["WB", "BW"]
cnt = 0
if S[0] == "W":
i = 0
else:
i = 1
for j in range(len(S)-1):
if i == 0 and S[j:j+2] == "WB":
cnt += 1
i = 1
if i == 1 and S[j:j+2] == "BW":
cnt += 1
i = 0
print(cnt)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
4,
13,
13,
0,
13,
18,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
13,
18,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13
] |
[
[
48,
2
],
[
42,
6
],
[
54,
9
],
[
49,
12
],
[
57,
14
],
[
49,
16
],
[
20,
19
],
[
55,
23
],
[
58,
26
],
[
46,
26
],
[
49,
28
],
[
19,
29
],
[
45,
31
],
[
49,
33
],
[
19,
34
],
[
51,
36
],
[
52,
40
],
[
43,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
]
] |
[
"S=input()\nans=0\nN=len(S)\nnow=S[0]\nfor i in range(1,N):\n if now!=S[i]:\n now=S[i]\n ans+=1\nprint(ans)",
"S=input()",
"S",
"input()",
"input",
"ans=0",
"ans",
"0",
"N=len(S)",
"N",
"len(S)",
"len",
"S",
"now=S[0]",
"now",
"S[0]",
"S",
"0",
"for i in range(1,N):\n if now!=S[i]:\n now=S[i]\n ans+=1",
"i",
"range(1,N)",
"range",
"1",
"N",
"if now!=S[i]:\n now=S[i]\n ans+=1",
"now!=S[i]",
"now",
"S[i]",
"S",
"i",
"now=S[i]",
"now",
"S[i]",
"S",
"i",
"ans+=1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans=0",
"0",
"ans",
"now=S[i]",
"S[i]",
"now",
"S=input()",
"input()",
"S",
"ans+=1",
"1",
"ans",
"N=len(S)",
"len(S)",
"N",
"now=S[0]",
"S[0]",
"now"
] |
S=input()
ans=0
N=len(S)
now=S[0]
for i in range(1,N):
if now!=S[i]:
now=S[i]
ans+=1
print(ans)
|
[
7,
15,
13,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13
] |
[
[
44,
4
],
[
41,
8
],
[
45,
10
],
[
50,
13
],
[
17,
16
],
[
45,
22
],
[
42,
25
],
[
54,
25
],
[
45,
27
],
[
16,
28
],
[
47,
30
],
[
53,
33
],
[
45,
35
],
[
16,
36
],
[
48,
39
],
[
51,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
],
[
53,
54
]
] |
[
"import sys\n\ns = input()\n\nbefore = s[0]\nans = 0\nfor cx in range(1, len(s)):\n if before != s[cx]:\n ans += 1\n before = s[cx]\n\nprint(ans)",
"import sys",
"sys",
"s = input()",
"s",
"input()",
"input",
"before = s[0]",
"before",
"s[0]",
"s",
"0",
"ans = 0",
"ans",
"0",
"for cx in range(1, len(s)):\n if before != s[cx]:\n ans += 1\n before = s[cx]",
"cx",
"range(1, len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if before != s[cx]:\n ans += 1\n before = s[cx]",
"before != s[cx]",
"before",
"s[cx]",
"s",
"cx",
"ans += 1",
"ans",
"1",
"before = s[cx]",
"before",
"s[cx]",
"s",
"cx",
"print(ans)",
"print",
"ans",
"before = s[0]",
"s[0]",
"before",
"s = input()",
"input()",
"s",
"ans += 1",
"1",
"ans",
"ans = 0",
"0",
"ans",
"before = s[cx]",
"s[cx]",
"before"
] |
import sys
s = input()
before = s[0]
ans = 0
for cx in range(1, len(s)):
if before != s[cx]:
ans += 1
before = s[cx]
print(ans)
|
[
7,
41,
28,
13,
4,
13,
4,
8,
2,
13,
17,
17,
17,
0,
13,
13,
0,
13,
39,
0,
13,
17,
0,
13,
17,
28,
13,
13,
14,
2,
13,
17,
14,
40,
13,
17,
4,
18,
13,
13,
13,
0,
13,
17,
0,
13,
17,
14,
2,
13,
17,
14,
40,
13,
17,
4,
18,
13,
13,
13,
0,
13,
17,
0,
13,
17,
14,
40,
13,
17,
4,
18,
13,
13,
13,
14,
40,
13,
17,
4,
18,
13,
13,
13,
4,
13,
2,
4,
13,
13,
17,
10,
39,
13,
10,
17,
13,
10,
13,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] |
[
[
4,
3
],
[
3,
9
],
[
98,
14
],
[
92,
17
],
[
107,
20
],
[
110,
23
],
[
27,
26
],
[
99,
26
],
[
26,
30
],
[
111,
34
],
[
105,
34
],
[
96,
34
],
[
93,
38
],
[
111,
40
],
[
105,
40
],
[
96,
40
],
[
95,
42
],
[
101,
45
],
[
26,
49
],
[
108,
53
],
[
114,
53
],
[
102,
53
],
[
93,
57
],
[
108,
59
],
[
114,
59
],
[
102,
59
],
[
113,
61
],
[
104,
64
],
[
114,
68
],
[
102,
68
],
[
108,
68
],
[
93,
72
],
[
114,
74
],
[
102,
74
],
[
108,
74
],
[
105,
77
],
[
96,
77
],
[
111,
77
],
[
93,
81
],
[
105,
83
],
[
96,
83
],
[
111,
83
],
[
93,
89
],
[
92,
93
],
[
95,
96
],
[
98,
99
],
[
101,
102
],
[
104,
105
],
[
107,
108
],
[
110,
111
],
[
113,
114
]
] |
[
"S = [1 if x==\"W\" else 0 for x in input()]\n\ngroups = []\ntmp = 0\nzeros = 0\nfor n in S:\n if n == 1:\n if zeros != 0:#直前まで0だったとき\n groups.append(zeros)\n zeros = 0#リセット\n tmp += 1\n elif n == 0:\n if tmp != 0:#直前まで1だったとき\n groups.append(tmp)\n tmp = 0#リセット\n zeros -= 1\n\n#終端の処理\nif tmp != 0:\n groups.append(tmp)\nif zeros != 0:\n groups.append(zeros)\n \nprint(len(groups)-1)",
"1 if x==\"W\" else 0 for x in input()",
"for x in input()",
"x",
"input()",
"input",
"for x in input()",
"1 if x==\"W\" else 0",
"x==\"W\"",
"x",
"\"W\"",
"1",
"0",
"S = [1 if x==\"W\" else 0 for x in input()]",
"S",
"[1 if x==\"W\" else 0 for x in input()]",
"groups = []",
"groups",
"[]",
"tmp = 0",
"tmp",
"0",
"zeros = 0",
"zeros",
"0",
"for n in S:\n if n == 1:\n if zeros != 0:#直前まで0だったとき\n groups.append(zeros)\n zeros = 0#リセット\n tmp += 1\n elif n == 0:\n if tmp != 0:#直前まで1だったとき\n groups.append(tmp)\n tmp = 0#リセット\n zeros -= 1\n\n#終端の処理",
"n",
"S",
"if n == 1:\n if zeros != 0:#直前まで0だったとき\n groups.append(zeros)\n zeros = 0#リセット\n tmp += 1\n elif n == 0:\n if tmp != 0:#直前まで1だったとき\n groups.append(tmp)\n tmp = 0#リセット\n zeros -= 1\n\n#終端の処理",
"n == 1",
"n",
"1",
"if zeros != 0:#直前まで0だったとき\n groups.append(zeros)\n zeros = 0#リセット\n ",
"zeros != 0",
"zeros",
"0",
"groups.append(zeros)",
"groups.append",
"groups",
"append",
"zeros",
"zeros = 0",
"zeros",
"0",
"tmp += 1",
"tmp",
"1",
"elif n == 0:\n if tmp != 0:#直前まで1だったとき\n groups.append(tmp)\n tmp = 0#リセット\n zeros -= 1\n\n#終端の処理",
"n == 0",
"n",
"0",
"if tmp != 0:#直前まで1だったとき\n groups.append(tmp)\n tmp = 0#リセット\n ",
"tmp != 0",
"tmp",
"0",
"groups.append(tmp)",
"groups.append",
"groups",
"append",
"tmp",
"tmp = 0",
"tmp",
"0",
"zeros -= 1",
"zeros",
"1",
"if tmp != 0:\n groups.append(tmp)",
"tmp != 0",
"tmp",
"0",
"groups.append(tmp)",
"groups.append",
"groups",
"append",
"tmp",
"if zeros != 0:\n groups.append(zeros)\n ",
"zeros != 0",
"zeros",
"0",
"groups.append(zeros)",
"groups.append",
"groups",
"append",
"zeros",
"print(len(groups)-1)",
"print",
"len(groups)-1",
"len(groups)",
"len",
"groups",
"1",
"groups = []",
"[]",
"groups",
"zeros = 0",
"0",
"zeros",
"S = [1 if x==\"W\" else 0 for x in input()]",
"[1 if x==\"W\" else 0 for x in input()]",
"S",
"tmp += 1",
"1",
"tmp",
"zeros -= 1",
"1",
"zeros",
"tmp = 0",
"0",
"tmp",
"zeros = 0",
"0",
"zeros",
"tmp = 0",
"0",
"tmp"
] |
S = [1 if x=="W" else 0 for x in input()]
groups = []
tmp = 0
zeros = 0
for n in S:
if n == 1:
if zeros != 0:#直前まで0だったとき
groups.append(zeros)
zeros = 0#リセット
tmp += 1
elif n == 0:
if tmp != 0:#直前まで1だったとき
groups.append(tmp)
tmp = 0#リセット
zeros -= 1
#終端の処理
if tmp != 0:
groups.append(tmp)
if zeros != 0:
groups.append(zeros)
print(len(groups)-1)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
13,
17,
42,
2,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13,
10,
17,
13
] |
[
[
38,
2
],
[
47,
6
],
[
41,
8
],
[
48,
12
],
[
51,
12
],
[
39,
16
],
[
39,
21
],
[
48,
22
],
[
51,
22
],
[
39,
24
],
[
48,
26
],
[
51,
26
],
[
44,
29
],
[
50,
32
],
[
45,
36
],
[
42,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] |
[
"s=input()\nnow,ans=0,0\nwhile now<len(s)-1:\n if s[now]!=s[now+1]:\n ans+=1\n now+=1\nprint(ans)",
"s=input()",
"s",
"input()",
"input",
"now,ans=0,0",
"now",
"0",
"ans",
"0",
"while now<len(s)-1:\n if s[now]!=s[now+1]:\n ans+=1\n now+=1",
"now<len(s)-1",
"now",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[now]!=s[now+1]:\n ans+=1\n ",
"s[now]!=s[now+1]",
"s[now]",
"s",
"now",
"s[now+1]",
"s",
"now+1",
"now",
"1",
"ans+=1",
"ans",
"1",
"now+=1",
"now",
"1",
"print(ans)",
"print",
"ans",
"s=input()",
"input()",
"s",
"ans=0,0",
"0",
"ans",
"ans+=1",
"1",
"ans",
"now,ans=0,0",
"0",
"now",
"now+=1",
"1",
"now"
] |
s=input()
now,ans=0,0
while now<len(s)-1:
if s[now]!=s[now+1]:
ans+=1
now+=1
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
39,
2
],
[
36,
8
],
[
12,
11
],
[
40,
17
],
[
40,
22
],
[
11,
23
],
[
40,
25
],
[
11,
27
],
[
42,
30
],
[
43,
34
],
[
37,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"S = list(input())\nans = 0\n\nfor n in range(len(S)-1):\n if S[n] != S[n+1]:\n ans += 1\nprint(ans)",
"S = list(input())",
"S",
"list(input())",
"list",
"input()",
"input",
"ans = 0",
"ans",
"0",
"for n in range(len(S)-1):\n if S[n] != S[n+1]:\n ans += 1",
"n",
"range(len(S)-1)",
"range",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"if S[n] != S[n+1]:\n ans += 1",
"S[n] != S[n+1]",
"S[n]",
"S",
"n",
"S[n+1]",
"S",
"n+1",
"n",
"1",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans = 0",
"0",
"ans",
"S = list(input())",
"list(input())",
"S",
"ans += 1",
"1",
"ans"
] |
S = list(input())
ans = 0
for n in range(len(S)-1):
if S[n] != S[n+1]:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
13,
14,
2,
13,
13,
9,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
18,
13,
10,
13,
13,
10,
4,
13,
10,
17,
13
] |
[
[
40,
2
],
[
34,
6
],
[
41,
8
],
[
31,
11
],
[
15,
14
],
[
41,
14
],
[
35,
18
],
[
38,
18
],
[
14,
19
],
[
43,
22
],
[
37,
25
],
[
14,
26
],
[
44,
29
],
[
32,
29
],
[
31,
32
],
[
34,
35
],
[
14,
37
],
[
37,
38
],
[
40,
41
],
[
43,
44
]
] |
[
"S = input()\nnow = S[0]\ncnt = 0\nfor s in S:\n if now == s:\n continue\n cnt += 1\n now = s\nprint(cnt)",
"S = input()",
"S",
"input()",
"input",
"now = S[0]",
"now",
"S[0]",
"S",
"0",
"cnt = 0",
"cnt",
"0",
"for s in S:\n if now == s:\n continue\n cnt += 1\n now = s",
"s",
"S",
"if now == s:\n continue\n ",
"now == s",
"now",
"s",
"continue",
"cnt += 1",
"cnt",
"1",
"now = s",
"now",
"s",
"print(cnt)",
"print",
"cnt",
"cnt = 0",
"0",
"cnt",
"now = S[0]",
"S[0]",
"now",
"now = s",
"s",
"now",
"S = input()",
"input()",
"S",
"cnt += 1",
"1",
"cnt"
] |
S = input()
now = S[0]
cnt = 0
for s in S:
if now == s:
continue
cnt += 1
now = s
print(cnt)
|
[
7,
15,
13,
4,
18,
13,
13,
2,
17,
17,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
0,
13,
4,
13,
0,
13,
4,
13,
13,
4,
13,
4,
13,
40,
18,
13,
13,
18,
13,
2,
13,
17,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
4,
13,
10,
12,
13,
10,
12,
13,
10,
4,
13
] |
[
[
62,
25
],
[
60,
27
],
[
71,
29
],
[
63,
32
],
[
57,
32
],
[
63,
39
],
[
57,
39
],
[
63,
42
],
[
57,
42
],
[
62,
63
],
[
71,
72
]
] |
[
"import sys\n\nsys.setrecursionlimit(10**7)\ndef I(): return int(sys.stdin.readline().rstrip())\ndef MI(): return map(int,sys.stdin.readline().rstrip().split())\ndef LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり\ndef LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり\ndef LS2(): return list(sys.stdin.readline().rstrip()) #空白なし\n\n\nS = LS2()\nN = len(S)\n\nprint(sum(S[i] != S[i+1] for i in range(N-1)))",
"import sys",
"sys",
"sys.setrecursionlimit(10**7)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**7",
"10",
"7",
"def I(): return int(sys.stdin.readline().rstrip())",
"I",
"def MI(): return map(int,sys.stdin.readline().rstrip().split())",
"MI",
"def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり",
"LI",
"def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし",
"LI2",
"def S(): return sys.stdin.readline().rstrip()",
"S",
"def LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり",
"LS",
"def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし",
"LS2",
"S = LS2()",
"S",
"LS2()",
"LS2",
"N = len(S)",
"N",
"len(S)",
"len",
"S",
"print(sum(S[i] != S[i+1] for i in range(N-1)))",
"print",
"sum(S[i] != S[i+1] for i in range(N-1))",
"sum",
"S[i] != S[i+1]",
"S[i]",
"S",
"i",
"S[i+1]",
"S",
"i+1",
"i",
"1",
"def LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり",
"def LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり",
"LS",
"def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり",
"def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり",
"LI",
"def I(): return int(sys.stdin.readline().rstrip())",
"def I(): return int(sys.stdin.readline().rstrip())",
"I",
"def S(): return sys.stdin.readline().rstrip()",
"def S(): return sys.stdin.readline().rstrip()",
"S",
"def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし",
"def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし",
"LS2",
"S = LS2()",
"LS2()",
"S",
"def MI(): return map(int,sys.stdin.readline().rstrip().split())",
"def MI(): return map(int,sys.stdin.readline().rstrip().split())",
"MI",
"def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし",
"def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし",
"LI2",
"N = len(S)",
"len(S)",
"N"
] |
import sys
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり
def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし
S = LS2()
N = len(S)
print(sum(S[i] != S[i+1] for i in range(N-1)))
|
[
7,
0,
13,
4,
13,
4,
13,
4,
13,
40,
18,
13,
13,
18,
13,
2,
13,
17,
10,
4,
13
] |
[
[
19,
2
],
[
20,
11
],
[
20,
14
],
[
19,
20
]
] |
[
"s = input()\n\nprint(sum(s[i] != s[i - 1] for i in range(1, len(s))))",
"s = input()",
"s",
"input()",
"input",
"print(sum(s[i] != s[i - 1] for i in range(1, len(s))))",
"print",
"sum(s[i] != s[i - 1] for i in range(1, len(s)))",
"sum",
"s[i] != s[i - 1]",
"s[i]",
"s",
"i",
"s[i - 1]",
"s",
"i - 1",
"i",
"1",
"s = input()",
"input()",
"s"
] |
s = input()
print(sum(s[i] != s[i - 1] for i in range(1, len(s))))
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
13,
14,
40,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13
] |
[
[
57,
2
],
[
42,
6
],
[
58,
9
],
[
48,
11
],
[
58,
13
],
[
51,
16
],
[
20,
19
],
[
43,
23
],
[
58,
27
],
[
19,
28
],
[
49,
29
],
[
55,
29
],
[
54,
31
],
[
58,
33
],
[
19,
34
],
[
45,
36
],
[
46,
40
],
[
52,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
]
] |
[
"s=input()\nn=len(s)\ntmp=s[0]\ncnt=0\nfor i in range(1, n):\n if s[i]!=tmp:\n tmp=s[i]\n cnt+=1\nprint(cnt)",
"s=input()",
"s",
"input()",
"input",
"n=len(s)",
"n",
"len(s)",
"len",
"s",
"tmp=s[0]",
"tmp",
"s[0]",
"s",
"0",
"cnt=0",
"cnt",
"0",
"for i in range(1, n):\n if s[i]!=tmp:\n tmp=s[i]\n cnt+=1",
"i",
"range(1, n)",
"range",
"1",
"n",
"if s[i]!=tmp:\n tmp=s[i]\n cnt+=1",
"s[i]!=tmp",
"s[i]",
"s",
"i",
"tmp",
"tmp=s[i]",
"tmp",
"s[i]",
"s",
"i",
"cnt+=1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"n=len(s)",
"len(s)",
"n",
"cnt+=1",
"1",
"cnt",
"tmp=s[0]",
"s[0]",
"tmp",
"cnt=0",
"0",
"cnt",
"tmp=s[i]",
"s[i]",
"tmp",
"s=input()",
"input()",
"s"
] |
s=input()
n=len(s)
tmp=s[0]
cnt=0
for i in range(1, n):
if s[i]!=tmp:
tmp=s[i]
cnt+=1
print(cnt)
|
[
7,
15,
13,
12,
13,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
12,
13,
10,
17,
13
] |
[
[
41,
6
],
[
45,
8
],
[
47,
10
],
[
14,
13
],
[
42,
19
],
[
42,
24
],
[
13,
26
],
[
42,
29
],
[
13,
30
],
[
38,
32
],
[
39,
36
],
[
48,
36
],
[
38,
39
],
[
41,
42
],
[
47,
48
]
] |
[
"import sys\ndef LS2(): return list(sys.stdin.readline().rstrip()) #空白なし\n\nS = LS2()\n\nans = 0\nfor i in range(len(S)-1):\n if S[i+1] != S[i]:\n ans += 1\n\nprint(ans)",
"import sys",
"sys",
"def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし",
"LS2",
"S = LS2()",
"S",
"LS2()",
"LS2",
"ans = 0",
"ans",
"0",
"for i in range(len(S)-1):\n if S[i+1] != S[i]:\n ans += 1",
"i",
"range(len(S)-1)",
"range",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"if S[i+1] != S[i]:\n ans += 1",
"S[i+1] != S[i]",
"S[i+1]",
"S",
"i+1",
"i",
"1",
"S[i]",
"S",
"i",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans += 1",
"1",
"ans",
"S = LS2()",
"LS2()",
"S",
"def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし",
"def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし",
"LS2",
"ans = 0",
"0",
"ans"
] |
import sys
def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし
S = LS2()
ans = 0
for i in range(len(S)-1):
if S[i+1] != S[i]:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
39,
28,
13,
4,
13,
2,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
4,
18,
13,
13,
13,
4,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
39,
13
] |
[
[
46,
2
],
[
43,
8
],
[
47,
11
],
[
49,
13
],
[
17,
16
],
[
44,
20
],
[
47,
25
],
[
16,
26
],
[
47,
28
],
[
16,
30
],
[
50,
34
],
[
16,
36
],
[
50,
41
],
[
43,
44
],
[
46,
47
],
[
49,
50
]
] |
[
"l = list(input())\nn = len(l)\n\nseg = []\nfor i in range(n-1):\n if l[i] != l[i+1]:\n seg.append(i)\nprint(len(seg))",
"l = list(input())",
"l",
"list(input())",
"list",
"input()",
"input",
"n = len(l)",
"n",
"len(l)",
"len",
"l",
"seg = []",
"seg",
"[]",
"for i in range(n-1):\n if l[i] != l[i+1]:\n seg.append(i)",
"i",
"range(n-1)",
"range",
"n-1",
"n",
"1",
"if l[i] != l[i+1]:\n seg.append(i)",
"l[i] != l[i+1]",
"l[i]",
"l",
"i",
"l[i+1]",
"l",
"i+1",
"i",
"1",
"seg.append(i)",
"seg.append",
"seg",
"append",
"i",
"print(len(seg))",
"print",
"len(seg)",
"len",
"seg",
"n = len(l)",
"len(l)",
"n",
"l = list(input())",
"list(input())",
"l",
"seg = []",
"[]",
"seg"
] |
l = list(input())
n = len(l)
seg = []
for i in range(n-1):
if l[i] != l[i+1]:
seg.append(i)
print(len(seg))
|
[
7,
15,
13,
13,
13,
13,
13,
13,
15,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
0,
13,
4,
13,
0,
13,
39,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
18,
13,
17,
13,
4,
18,
13,
13,
13,
0,
13,
2,
4,
13,
13,
17,
4,
13,
13,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] |
[
[
22,
21
],
[
70,
23
],
[
26,
25
],
[
21,
28
],
[
32,
31
],
[
21,
33
],
[
25,
39
],
[
31,
41
],
[
25,
44
],
[
31,
46
],
[
49,
48
],
[
25,
52
],
[
48,
56
],
[
61,
58
]
] |
[
"import bisect,collections,copy,itertools,math,string\nimport sys\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI(): return list(map(int,sys.stdin.readline().rstrip().split()))\ndef S(): return sys.stdin.readline().rstrip()\ndef LS(): return list(sys.stdin.readline().rstrip().split())\ndef main():\n s = S()\n lst = [s[0]]\n\n for char in s[1:]:\n if lst[-1] != char:\n lst.append(char)\n\n ans = len(lst)-1\n print(ans)\nmain()",
"import bisect,collections,copy,itertools,math,string",
"bisect",
"collections",
"copy",
"itertools",
"math",
"string",
"import sys",
"sys",
"def I(): return int(sys.stdin.readline().rstrip())",
"I",
"def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))",
"LI",
"def S(): return sys.stdin.readline().rstrip()",
"S",
"def LS(): return list(sys.stdin.readline().rstrip().split())",
"LS",
"def main():\n s = S()\n lst = [s[0]]\n\n for char in s[1:]:\n if lst[-1] != char:\n lst.append(char)\n\n ans = len(lst)-1\n print(ans)",
"main",
"s = S()",
"s",
"S()",
"S",
"lst = [s[0]]",
"lst",
"[s[0]]",
"s[0]",
"s",
"0",
"for char in s[1:]:\n if lst[-1] != char:\n lst.append(char)\n\n ",
"char",
"s[1:]",
"s",
"1:",
"1",
"if lst[-1] != char:\n lst.append(char)\n\n ",
"lst[-1] != char",
"lst[-1]",
"lst",
"-1",
"char",
"lst.append(char)",
"lst.append",
"lst",
"append",
"char",
"ans = len(lst)-1",
"ans",
"len(lst)-1",
"len(lst)",
"len",
"lst",
"1",
"print(ans)",
"print",
"ans",
"main()",
"main",
"def main():\n s = S()\n lst = [s[0]]\n\n for char in s[1:]:\n if lst[-1] != char:\n lst.append(char)\n\n ans = len(lst)-1\n print(ans)",
"def main():\n s = S()\n lst = [s[0]]\n\n for char in s[1:]:\n if lst[-1] != char:\n lst.append(char)\n\n ans = len(lst)-1\n print(ans)",
"main",
"def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))",
"def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))",
"LI",
"def LS(): return list(sys.stdin.readline().rstrip().split())",
"def LS(): return list(sys.stdin.readline().rstrip().split())",
"LS",
"def S(): return sys.stdin.readline().rstrip()",
"def S(): return sys.stdin.readline().rstrip()",
"S",
"def I(): return int(sys.stdin.readline().rstrip())",
"def I(): return int(sys.stdin.readline().rstrip())",
"I"
] |
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
s = S()
lst = [s[0]]
for char in s[1:]:
if lst[-1] != char:
lst.append(char)
ans = len(lst)-1
print(ans)
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
18,
13
] |
[
[
50,
2
],
[
53,
8
],
[
51,
10
],
[
47,
13
],
[
17,
16
],
[
51,
22
],
[
54,
25
],
[
45,
25
],
[
51,
27
],
[
16,
28
],
[
44,
30
],
[
51,
32
],
[
16,
33
],
[
41,
35
],
[
42,
39
],
[
48,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
],
[
53,
54
]
] |
[
"s = str(input())\ncolor = s[0]\ncnt = 0\nfor i in range(1,len(s)):\n if color != s[i]:\n color = s[i]\n cnt += 1\nprint(cnt)",
"s = str(input())",
"s",
"str(input())",
"str",
"input()",
"input",
"color = s[0]",
"color",
"s[0]",
"s",
"0",
"cnt = 0",
"cnt",
"0",
"for i in range(1,len(s)):\n if color != s[i]:\n color = s[i]\n cnt += 1",
"i",
"range(1,len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if color != s[i]:\n color = s[i]\n cnt += 1",
"color != s[i]",
"color",
"s[i]",
"s",
"i",
"color = s[i]",
"color",
"s[i]",
"s",
"i",
"cnt += 1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"cnt += 1",
"1",
"cnt",
"color = s[i]",
"s[i]",
"color",
"cnt = 0",
"0",
"cnt",
"s = str(input())",
"str(input())",
"s",
"color = s[0]",
"s[0]",
"color"
] |
s = str(input())
color = s[0]
cnt = 0
for i in range(1,len(s)):
if color != s[i]:
color = s[i]
cnt += 1
print(cnt)
|
[
7,
0,
13,
4,
13,
0,
13,
39,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
4,
18,
13,
13,
18,
13,
13,
4,
18,
13,
13,
18,
13,
17,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
39,
13
] |
[
[
49,
2
],
[
52,
6
],
[
10,
9
],
[
50,
15
],
[
50,
20
],
[
9,
21
],
[
50,
23
],
[
9,
25
],
[
53,
29
],
[
50,
32
],
[
9,
33
],
[
53,
36
],
[
50,
39
],
[
53,
46
],
[
49,
50
],
[
52,
53
]
] |
[
"s=input()\nt=[]\nfor i in range(len(s)-1):\n if s[i]!=s[i+1]:\n t.append(s[i])\nt.append(s[-1])\nprint(len(t)-1)",
"s=input()",
"s",
"input()",
"input",
"t=[]",
"t",
"[]",
"for i in range(len(s)-1):\n if s[i]!=s[i+1]:\n t.append(s[i])",
"i",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[i]!=s[i+1]:\n t.append(s[i])",
"s[i]!=s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"t.append(s[i])",
"t.append",
"t",
"append",
"s[i]",
"s",
"i",
"t.append(s[-1])",
"t.append",
"t",
"append",
"s[-1]",
"s",
"-1",
"print(len(t)-1)",
"print",
"len(t)-1",
"len(t)",
"len",
"t",
"1",
"s=input()",
"input()",
"s",
"t=[]",
"[]",
"t"
] |
s=input()
t=[]
for i in range(len(s)-1):
if s[i]!=s[i+1]:
t.append(s[i])
t.append(s[-1])
print(len(t)-1)
|
[
7,
0,
13,
4,
13,
4,
13,
2,
4,
18,
13,
13,
17,
4,
18,
13,
13,
17,
10,
4,
13
] |
[
[
19,
2
],
[
20,
10
],
[
20,
15
],
[
19,
20
]
] |
[
"S = input()\nprint(S.count(\"WB\")+S.count(\"BW\"))",
"S = input()",
"S",
"input()",
"input",
"print(S.count(\"WB\")+S.count(\"BW\"))",
"print",
"S.count(\"WB\")+S.count(\"BW\")",
"S.count(\"WB\")",
"S.count",
"S",
"count",
"\"WB\"",
"S.count(\"BW\")",
"S.count",
"S",
"count",
"\"BW\"",
"S = input()",
"input()",
"S"
] |
S = input()
print(S.count("WB")+S.count("BW"))
|
[
7,
12,
13,
0,
13,
4,
13,
0,
13,
18,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
40,
18,
13,
13,
18,
13,
2,
4,
13,
13,
17,
0,
13,
2,
13,
18,
13,
13,
4,
13,
2,
4,
13,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
9,
8
],
[
4,
10
],
[
14,
13
],
[
4,
18
],
[
4,
22
],
[
13,
23
],
[
8,
25
],
[
32,
25
],
[
8,
29
],
[
32,
29
],
[
33,
32
],
[
8,
34
],
[
32,
34
],
[
4,
36
],
[
13,
37
],
[
32,
43
],
[
8,
43
],
[
53,
50
]
] |
[
"def main():\n S = input()\n A = S[0]\n\n for i in range(len(S)):\n if(S[i]!=A[len(A)-1]):\n A = A + S[i]\n\n print(len(A)-1)\n\n\n\nif __name__ == '__main__':\n main()",
"def main():\n S = input()\n A = S[0]\n\n for i in range(len(S)):\n if(S[i]!=A[len(A)-1]):\n A = A + S[i]\n\n print(len(A)-1)",
"main",
"S = input()",
"S",
"input()",
"input",
"A = S[0]",
"A",
"S[0]",
"S",
"0",
"for i in range(len(S)):\n if(S[i]!=A[len(A)-1]):\n A = A + S[i]\n\n ",
"i",
"range(len(S))",
"range",
"len(S)",
"len",
"S",
"if(S[i]!=A[len(A)-1]):\n A = A + S[i]\n\n ",
"S[i]!=A[len(A)-1]",
"S[i]",
"S",
"i",
"A[len(A)-1]",
"A",
"len(A)-1",
"len(A)",
"len",
"A",
"1",
"A = A + S[i]",
"A",
"A + S[i]",
"A",
"S[i]",
"S",
"i",
"print(len(A)-1)",
"print",
"len(A)-1",
"len(A)",
"len",
"A",
"1",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n S = input()\n A = S[0]\n\n for i in range(len(S)):\n if(S[i]!=A[len(A)-1]):\n A = A + S[i]\n\n print(len(A)-1)",
"def main():\n S = input()\n A = S[0]\n\n for i in range(len(S)):\n if(S[i]!=A[len(A)-1]):\n A = A + S[i]\n\n print(len(A)-1)",
"main"
] |
def main():
S = input()
A = S[0]
for i in range(len(S)):
if(S[i]!=A[len(A)-1]):
A = A + S[i]
print(len(A)-1)
if __name__ == '__main__':
main()
|
[
7,
12,
13,
15,
0,
13,
4,
13,
0,
13,
17,
28,
13,
13,
4,
13,
13,
0,
13,
17,
4,
13,
2,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
6,
5
],
[
10,
9
],
[
5,
16
],
[
19,
18
],
[
18,
23
],
[
9,
23
],
[
33,
30
]
] |
[
"def main():\n from itertools import groupby\n s = input()\n c = 0\n for k, g in groupby(s):\n c += 1\n\n print(c - 1)\n\n\nif __name__ == '__main__':\n main()",
"def main():\n from itertools import groupby\n s = input()\n c = 0\n for k, g in groupby(s):\n c += 1\n\n print(c - 1)",
"main",
"from itertools import groupby",
"s = input()",
"s",
"input()",
"input",
"c = 0",
"c",
"0",
"for k, g in groupby(s):\n c += 1\n\n ",
"k",
"g",
"groupby(s)",
"groupby",
"s",
"c += 1",
"c",
"1",
"print(c - 1)",
"print",
"c - 1",
"c",
"1",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n from itertools import groupby\n s = input()\n c = 0\n for k, g in groupby(s):\n c += 1\n\n print(c - 1)",
"def main():\n from itertools import groupby\n s = input()\n c = 0\n for k, g in groupby(s):\n c += 1\n\n print(c - 1)",
"main"
] |
def main():
from itertools import groupby
s = input()
c = 0
for k, g in groupby(s):
c += 1
print(c - 1)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
2,
13,
17,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13
] |
[
[
50,
2
],
[
41,
8
],
[
51,
11
],
[
44,
13
],
[
17,
16
],
[
42,
20
],
[
51,
25
],
[
16,
26
],
[
51,
28
],
[
16,
30
],
[
47,
33
],
[
48,
38
],
[
45,
38
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] |
[
"s=list(input())\nn=len(s)\nans=1\nfor i in range(n-1):\n if s[i]!=s[i+1]:\n ans+=1\nprint(ans-1)",
"s=list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"n=len(s)",
"n",
"len(s)",
"len",
"s",
"ans=1",
"ans",
"1",
"for i in range(n-1):\n if s[i]!=s[i+1]:\n ans+=1",
"i",
"range(n-1)",
"range",
"n-1",
"n",
"1",
"if s[i]!=s[i+1]:\n ans+=1",
"s[i]!=s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"ans+=1",
"ans",
"1",
"print(ans-1)",
"print",
"ans-1",
"ans",
"1",
"n=len(s)",
"len(s)",
"n",
"ans=1",
"1",
"ans",
"ans+=1",
"1",
"ans",
"s=list(input())",
"list(input())",
"s"
] |
s=list(input())
n=len(s)
ans=1
for i in range(n-1):
if s[i]!=s[i+1]:
ans+=1
print(ans-1)
|
[
7,
15,
13,
15,
15,
15,
13,
15,
0,
13,
2,
4,
13,
17,
17,
0,
13,
4,
13,
17,
12,
13,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
2,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
2,
13,
17,
0,
13,
4,
13,
17,
10,
4,
13,
10,
4,
13,
10,
2,
13,
10,
12,
13,
10,
17,
13
] |
[
[
78,
9
],
[
72,
16
],
[
24,
23
],
[
28,
27
],
[
31,
30
],
[
23,
36
],
[
23,
40
],
[
30,
41
],
[
23,
43
],
[
30,
45
],
[
49,
48
],
[
48,
53
],
[
27,
53
],
[
84,
56
],
[
60,
59
],
[
85,
64
],
[
75,
67
],
[
82,
69
],
[
72,
73
],
[
75,
76
],
[
78,
79
],
[
84,
85
]
] |
[
"# -*- coding: utf-8 -*-\nimport sys\nfrom collections import deque, defaultdict\nfrom math import sqrt, factorial, gcd, ceil\n# def input(): return sys.stdin.readline()[:-1] # warning not \\n\n# def input(): return sys.stdin.buffer.readline().strip() # warning bytes\n# def input(): return sys.stdin.buffer.readline().decode('utf-8')\nimport string\n# string.ascii_lowercase\nfrom bisect import bisect_left\nMOD = int(1e9)+7\nINF = float('inf')\n\n\ndef solve():\n # n, m = [int(x) for x in input().split()]\n s = input()\n seg = 1\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n seg += 1\n print(seg - 1)\n\nt = 1\n# t = int(input())\nfor case in range(1,t+1):\n ans = solve()\n\n\n\"\"\"\n\nazyxwvutsrqponmlkjihgfedcb\n\n\"\"\"",
"import sys",
"sys",
"from collections import deque, defaultdict",
"from math import sqrt, factorial, gcd, ceil",
"import string",
"string",
"from bisect import bisect_left",
"MOD = int(1e9)+7",
"MOD",
"int(1e9)+7",
"int(1e9)",
"int",
"1e9",
"7",
"INF = float('inf')",
"INF",
"float('inf')",
"float",
"'inf'",
"def solve():\n # n, m = [int(x) for x in input().split()]\n s = input()\n seg = 1\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n seg += 1\n print(seg - 1)",
"solve",
"s = input()",
"s",
"input()",
"input",
"seg = 1",
"seg",
"1",
"for i in range(1, len(s)):\n if s[i] != s[i-1]:\n seg += 1\n ",
"i",
"range(1, len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[i] != s[i-1]:\n seg += 1\n ",
"s[i] != s[i-1]",
"s[i]",
"s",
"i",
"s[i-1]",
"s",
"i-1",
"i",
"1",
"seg += 1",
"seg",
"1",
"print(seg - 1)",
"print",
"seg - 1",
"seg",
"1",
"t = 1",
"t",
"1",
"for case in range(1,t+1):\n ans = solve()",
"case",
"range(1,t+1)",
"range",
"1",
"t+1",
"t",
"1",
"ans = solve()",
"ans",
"solve()",
"solve",
"\"\"\"\n\nazyxwvutsrqponmlkjihgfedcb\n\n\"\"\"",
"INF = float('inf')",
"float('inf')",
"INF",
"ans = solve()",
"solve()",
"ans",
"MOD = int(1e9)+7",
"int(1e9)+7",
"MOD",
"def solve():\n # n, m = [int(x) for x in input().split()]\n s = input()\n seg = 1\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n seg += 1\n print(seg - 1)",
"def solve():\n # n, m = [int(x) for x in input().split()]\n s = input()\n seg = 1\n for i in range(1, len(s)):\n if s[i] != s[i-1]:\n seg += 1\n print(seg - 1)",
"solve",
"t = 1",
"1",
"t"
] |
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd, ceil
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')
import string
# string.ascii_lowercase
from bisect import bisect_left
MOD = int(1e9)+7
INF = float('inf')
def solve():
# n, m = [int(x) for x in input().split()]
s = input()
seg = 1
for i in range(1, len(s)):
if s[i] != s[i-1]:
seg += 1
print(seg - 1)
t = 1
# t = int(input())
for case in range(1,t+1):
ans = solve()
"""
azyxwvutsrqponmlkjihgfedcb
"""
|
[
7,
15,
15,
15,
13,
4,
18,
13,
13,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
29,
4,
13,
4,
13,
13,
4,
18,
4,
13,
13,
12,
13,
29,
4,
13,
4,
13,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
0,
13,
18,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
12,
13,
10,
18,
13,
10,
18,
13,
10,
12,
13,
10,
17,
13,
10,
4,
13,
10,
2,
13,
10,
17,
13
] |
[
[
96,
11
],
[
93,
38
],
[
90,
42
],
[
46,
45
],
[
94,
50
],
[
45,
53
],
[
81,
56
],
[
94,
58
],
[
45,
59
],
[
85,
62
],
[
82,
62
],
[
94,
64
],
[
45,
65
],
[
99,
67
],
[
84,
70
],
[
94,
72
],
[
45,
73
],
[
100,
76
],
[
91,
76
],
[
81,
82
],
[
84,
85
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
]
] |
[
"#from statistics import median\n#import collections\n#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]\n#from fractions import gcd\nfrom itertools import combinations,permutations # (string,3) 3回\n#from collections import deque\nfrom collections import deque,defaultdict\n#import bisect\n#\n# d = m - k[i] - k[j]\n# if kk[bisect.bisect_right(kk,d) - 1] == d:\n#\n#\n#\n# pythonで無理なときは、pypyでやると正解するかも!!\n#\n#\n\nimport sys\nsys.setrecursionlimit(10000000)\nmod = 10**9 + 7\n#mod = 9982443453\ndef readInts():\n return list(map(int,input().split()))\ndef I():\n return int(input())\nS = input()\ncnt = 0\nfor i in range(len(S)):\n if i == 0:\n prv = S[i]\n else:\n if prv != S[i]:\n cnt += 1\n prv = S[i]\n else:\n pass\nprint(cnt)",
"from itertools import combinations,permutations",
"from collections import deque,defaultdict",
"import sys",
"sys",
"sys.setrecursionlimit(10000000)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10000000",
"mod = 10**9 + 7",
"mod",
"10**9 + 7",
"10**9",
"10",
"9",
"7",
"def readInts():\n return list(map(int,input().split()))",
"readInts",
"return list(map(int,input().split()))",
"list(map(int,input().split()))",
"list",
"map(int,input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"def I():\n return int(input())",
"I",
"return int(input())",
"int(input())",
"int",
"input()",
"input",
"S = input()",
"S",
"input()",
"input",
"cnt = 0",
"cnt",
"0",
"for i in range(len(S)):\n if i == 0:\n prv = S[i]\n else:\n if prv != S[i]:\n cnt += 1\n prv = S[i]\n else:\n pass",
"i",
"range(len(S))",
"range",
"len(S)",
"len",
"S",
"if i == 0:\n prv = S[i]\n else:\n if prv != S[i]:\n cnt += 1\n prv = S[i]\n else:\n pass",
"i == 0",
"i",
"0",
"prv = S[i]",
"prv",
"S[i]",
"S",
"i",
"if prv != S[i]:\n cnt += 1\n prv = S[i]\n else:\n pass",
"prv != S[i]",
"prv",
"S[i]",
"S",
"i",
"cnt += 1",
"cnt",
"1",
"prv = S[i]",
"prv",
"S[i]",
"S",
"i",
"print(cnt)",
"print",
"cnt",
"def I():\n return int(input())",
"def I():\n return int(input())",
"I",
"prv = S[i]",
"S[i]",
"prv",
"prv = S[i]",
"S[i]",
"prv",
"def readInts():\n return list(map(int,input().split()))",
"def readInts():\n return list(map(int,input().split()))",
"readInts",
"cnt = 0",
"0",
"cnt",
"S = input()",
"input()",
"S",
"mod = 10**9 + 7",
"10**9 + 7",
"mod",
"cnt += 1",
"1",
"cnt"
] |
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
from itertools import combinations,permutations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
# d = m - k[i] - k[j]
# if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも!!
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
return list(map(int,input().split()))
def I():
return int(input())
S = input()
cnt = 0
for i in range(len(S)):
if i == 0:
prv = S[i]
else:
if prv != S[i]:
cnt += 1
prv = S[i]
else:
pass
print(cnt)
|
[
7,
0,
13,
4,
13,
41,
28,
13,
4,
13,
2,
4,
13,
13,
17,
4,
40,
18,
13,
13,
18,
13,
2,
13,
17,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
31,
2
],
[
8,
7
],
[
32,
13
],
[
32,
18
],
[
7,
19
],
[
32,
21
],
[
7,
23
],
[
31,
32
]
] |
[
"s = input()\nprint(sum((s[i] != s[i+1] for i in range(len(s)-1))))",
"s = input()",
"s",
"input()",
"input",
"s[i] != s[i+1] for i in range(len(s)-1)",
"for i in range(len(s)-1)",
"i",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"for i in range(len(s)-1)",
"s[i] != s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"print(sum((s[i] != s[i+1] for i in range(len(s)-1))))",
"print",
"sum((s[i] != s[i+1] for i in range(len(s)-1)))",
"sum",
"(s[i] != s[i+1] for i in range(len(s)-1))",
"s = input()",
"input()",
"s"
] |
s = input()
print(sum((s[i] != s[i+1] for i in range(len(s)-1))))
|
[
7,
15,
13,
0,
13,
4,
13,
0,
13,
4,
18,
13,
13,
17,
17,
13,
0,
13,
4,
18,
13,
13,
17,
17,
13,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
33,
4
],
[
39,
8
],
[
34,
15
],
[
36,
17
],
[
40,
24
],
[
34,
24
],
[
37,
30
],
[
40,
30
],
[
34,
30
],
[
33,
34
],
[
36,
37
],
[
39,
40
]
] |
[
"#!/usr/bin/env python3\n\nimport re\nS = input()\nS = re.sub(\"W+\", \"W\", S)\nS = re.sub(\"B+\", \"B\", S)\nprint(len(S) - 1)",
"import re",
"re",
"S = input()",
"S",
"input()",
"input",
"S = re.sub(\"W+\", \"W\", S)",
"S",
"re.sub(\"W+\", \"W\", S)",
"re.sub",
"re",
"sub",
"\"W+\"",
"\"W\"",
"S",
"S = re.sub(\"B+\", \"B\", S)",
"S",
"re.sub(\"B+\", \"B\", S)",
"re.sub",
"re",
"sub",
"\"B+\"",
"\"B\"",
"S",
"print(len(S) - 1)",
"print",
"len(S) - 1",
"len(S)",
"len",
"S",
"1",
"S = input()",
"input()",
"S",
"S = re.sub(\"B+\", \"B\", S)",
"re.sub(\"B+\", \"B\", S)",
"S",
"S = re.sub(\"W+\", \"W\", S)",
"re.sub(\"W+\", \"W\", S)",
"S"
] |
#!/usr/bin/env python3
import re
S = input()
S = re.sub("W+", "W", S)
S = re.sub("B+", "B", S)
print(len(S) - 1)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
40,
13,
18,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13
] |
[
[
38,
2
],
[
50,
6
],
[
39,
8
],
[
44,
11
],
[
15,
14
],
[
39,
19
],
[
51,
22
],
[
42,
22
],
[
39,
24
],
[
14,
25
],
[
47,
27
],
[
41,
30
],
[
39,
32
],
[
14,
33
],
[
48,
36
],
[
45,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] |
[
"S = input()\nnow = S[0]\nans = 0\nfor i in range(len(S)):\n if now != S[i]:\n ans += 1\n now = S[i]\nprint(ans)",
"S = input()",
"S",
"input()",
"input",
"now = S[0]",
"now",
"S[0]",
"S",
"0",
"ans = 0",
"ans",
"0",
"for i in range(len(S)):\n if now != S[i]:\n ans += 1\n now = S[i]",
"i",
"range(len(S))",
"range",
"len(S)",
"len",
"S",
"if now != S[i]:\n ans += 1\n now = S[i]",
"now != S[i]",
"now",
"S[i]",
"S",
"i",
"ans += 1",
"ans",
"1",
"now = S[i]",
"now",
"S[i]",
"S",
"i",
"print(ans)",
"print",
"ans",
"S = input()",
"input()",
"S",
"now = S[i]",
"S[i]",
"now",
"ans = 0",
"0",
"ans",
"ans += 1",
"1",
"ans",
"now = S[0]",
"S[0]",
"now"
] |
S = input()
now = S[0]
ans = 0
for i in range(len(S)):
if now != S[i]:
ans += 1
now = S[i]
print(ans)
|
[
7,
12,
13,
15,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
17,
13,
4,
13,
13,
0,
13,
17,
28,
13,
13,
4,
13,
13,
13,
14,
40,
13,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
6,
5
],
[
10,
9
],
[
5,
14
],
[
10,
16
],
[
16,
19
],
[
22,
21
],
[
9,
28
],
[
16,
29
],
[
21,
36
],
[
45,
42
]
] |
[
"def main():\n from itertools import tee\n\n S = input()\n it1, it2 = tee(iter(S), 2)\n next(it2)\n\n ans = 0\n for c1, c2 in zip(it1, it2):\n if c1 != c2: ans += 1\n print(ans)\n\n\nif __name__ == '__main__':\n main()",
"def main():\n from itertools import tee\n\n S = input()\n it1, it2 = tee(iter(S), 2)\n next(it2)\n\n ans = 0\n for c1, c2 in zip(it1, it2):\n if c1 != c2: ans += 1\n print(ans)",
"main",
"from itertools import tee",
"S = input()",
"S",
"input()",
"input",
"it1, it2 = tee(iter(S), 2)",
"it1",
"tee(iter(S), 2)",
"tee",
"iter(S)",
"iter",
"S",
"2",
"it2",
"next(it2)",
"next",
"it2",
"ans = 0",
"ans",
"0",
"for c1, c2 in zip(it1, it2):\n if c1 != c2: ans += 1\n ",
"c1",
"c2",
"zip(it1, it2)",
"zip",
"it1",
"it2",
"if c1 != c2: ans += 1\n ",
"c1 != c2",
"c1",
"c2",
"print(ans)",
"print",
"ans",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def main():\n from itertools import tee\n\n S = input()\n it1, it2 = tee(iter(S), 2)\n next(it2)\n\n ans = 0\n for c1, c2 in zip(it1, it2):\n if c1 != c2: ans += 1\n print(ans)",
"def main():\n from itertools import tee\n\n S = input()\n it1, it2 = tee(iter(S), 2)\n next(it2)\n\n ans = 0\n for c1, c2 in zip(it1, it2):\n if c1 != c2: ans += 1\n print(ans)",
"main"
] |
def main():
from itertools import tee
S = input()
it1, it2 = tee(iter(S), 2)
next(it2)
ans = 0
for c1, c2 in zip(it1, it2):
if c1 != c2: ans += 1
print(ans)
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
13,
13,
10,
17,
13,
10,
17,
13,
10,
18,
13,
10,
4,
13
] |
[
[
47,
2
],
[
44,
8
],
[
48,
10
],
[
38,
13
],
[
17,
16
],
[
48,
18
],
[
45,
23
],
[
36,
23
],
[
16,
24
],
[
41,
26
],
[
35,
29
],
[
16,
30
],
[
42,
33
],
[
39,
33
],
[
16,
35
],
[
35,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
]
] |
[
"line = list(input())\ntemp = line[0]\ncnt = 0\nfor c in line[1:]:\n\tif temp != c:\n\t\tcnt += 1\n\t\ttemp = c\n\nprint(cnt)",
"line = list(input())",
"line",
"list(input())",
"list",
"input()",
"input",
"temp = line[0]",
"temp",
"line[0]",
"line",
"0",
"cnt = 0",
"cnt",
"0",
"for c in line[1:]:\n\tif temp != c:\n\t\tcnt += 1\n\t\ttemp = c",
"c",
"line[1:]",
"line",
"1:",
"1",
"if temp != c:\n\t\tcnt += 1\n\t\ttemp = c",
"temp != c",
"temp",
"c",
"cnt += 1",
"cnt",
"1",
"temp = c",
"temp",
"c",
"print(cnt)",
"print",
"cnt",
"temp = c",
"c",
"temp",
"cnt = 0",
"0",
"cnt",
"cnt += 1",
"1",
"cnt",
"temp = line[0]",
"line[0]",
"temp",
"line = list(input())",
"list(input())",
"line"
] |
line = list(input())
temp = line[0]
cnt = 0
for c in line[1:]:
if temp != c:
cnt += 1
temp = c
print(cnt)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13
] |
[
[
36,
2
],
[
42,
8
],
[
12,
11
],
[
37,
17
],
[
37,
22
],
[
11,
23
],
[
37,
25
],
[
11,
27
],
[
39,
30
],
[
40,
34
],
[
43,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"s = list(input())\ncnt = 0\nfor i in range(len(s)-1):\n if s[i] != s[i+1]:\n cnt += 1\nprint(cnt)",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"cnt = 0",
"cnt",
"0",
"for i in range(len(s)-1):\n if s[i] != s[i+1]:\n cnt += 1",
"i",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[i] != s[i+1]:\n cnt += 1",
"s[i] != s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"cnt += 1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"s = list(input())",
"list(input())",
"s",
"cnt += 1",
"1",
"cnt",
"cnt = 0",
"0",
"cnt"
] |
s = list(input())
cnt = 0
for i in range(len(s)-1):
if s[i] != s[i+1]:
cnt += 1
print(cnt)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
14,
2,
4,
13,
13,
17,
4,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
46,
2
],
[
43,
6
],
[
47,
12
],
[
19,
18
],
[
47,
24
],
[
47,
29
],
[
18,
30
],
[
47,
32
],
[
18,
34
],
[
49,
37
],
[
50,
41
],
[
44,
41
],
[
43,
44
],
[
46,
47
],
[
49,
50
]
] |
[
"S = input()\nc = 0\nif set(S) == 0:\n print(0)\nelse:\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n c += 1\nprint(c)",
"S = input()",
"S",
"input()",
"input",
"c = 0",
"c",
"0",
"if set(S) == 0:\n print(0)\nelse:\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n c += 1",
"set(S) == 0",
"set(S)",
"set",
"S",
"0",
"print(0)",
"print",
"0",
"for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n c += 1",
"i",
"range(len(S) - 1)",
"range",
"len(S) - 1",
"len(S)",
"len",
"S",
"1",
"if S[i] != S[i + 1]:\n c += 1",
"S[i] != S[i + 1]",
"S[i]",
"S",
"i",
"S[i + 1]",
"S",
"i + 1",
"i",
"1",
"c += 1",
"c",
"1",
"print(c)",
"print",
"c",
"c = 0",
"0",
"c",
"S = input()",
"input()",
"S",
"c += 1",
"1",
"c"
] |
S = input()
c = 0
if set(S) == 0:
print(0)
else:
for i in range(len(S) - 1):
if S[i] != S[i + 1]:
c += 1
print(c)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
2,
13,
18,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
47,
2
],
[
38,
6
],
[
48,
8
],
[
50,
11
],
[
15,
14
],
[
48,
19
],
[
39,
22
],
[
42,
22
],
[
48,
24
],
[
14,
25
],
[
44,
27
],
[
41,
30
],
[
48,
32
],
[
14,
33
],
[
45,
36
],
[
51,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] |
[
"s = input()\na = s[0]\nc = 0\nfor i in range(len(s)):\n if a == s[i]:\n pass\n else:\n c += 1\n a = s[i]\nprint(c)",
"s = input()",
"s",
"input()",
"input",
"a = s[0]",
"a",
"s[0]",
"s",
"0",
"c = 0",
"c",
"0",
"for i in range(len(s)):\n if a == s[i]:\n pass\n else:\n c += 1\n a = s[i]",
"i",
"range(len(s))",
"range",
"len(s)",
"len",
"s",
"if a == s[i]:\n pass\n else:\n c += 1\n a = s[i]",
"a == s[i]",
"a",
"s[i]",
"s",
"i",
"c += 1",
"c",
"1",
"a = s[i]",
"a",
"s[i]",
"s",
"i",
"print(c)",
"print",
"c",
"a = s[0]",
"s[0]",
"a",
"a = s[i]",
"s[i]",
"a",
"c += 1",
"1",
"c",
"s = input()",
"input()",
"s",
"c = 0",
"0",
"c"
] |
s = input()
a = s[0]
c = 0
for i in range(len(s)):
if a == s[i]:
pass
else:
c += 1
a = s[i]
print(c)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
42,
17,
28,
13,
4,
13,
4,
13,
13,
14,
40,
18,
13,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
0,
13,
18,
13,
39,
13,
3,
3,
4,
13,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
18,
13,
10,
4,
13,
10,
17,
13
] |
[
[
60,
2
],
[
57,
6
],
[
61,
8
],
[
48,
11
],
[
17,
16
],
[
61,
21
],
[
52,
21
],
[
61,
25
],
[
52,
25
],
[
16,
26
],
[
58,
27
],
[
55,
27
],
[
63,
29
],
[
54,
32
],
[
61,
34
],
[
52,
34
],
[
16,
35
],
[
51,
37
],
[
61,
39
],
[
52,
39
],
[
64,
46
],
[
49,
46
],
[
48,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
],
[
60,
61
],
[
63,
64
]
] |
[
"S = input()\nX = S[0]\nans = 0\nwhile 1: \n for i in range(len(S)):\n if S[i] != X:\n ans += 1\n X =S[i]\n S = S[i:]\n break\n else:\n break\nprint(ans)\n ",
"S = input()",
"S",
"input()",
"input",
"X = S[0]",
"X",
"S[0]",
"S",
"0",
"ans = 0",
"ans",
"0",
"while 1: \n for i in range(len(S)):\n if S[i] != X:\n ans += 1\n X =S[i]\n S = S[i:]\n break\n else:\n break",
"1",
"for i in range(len(S)):\n if S[i] != X:\n ans += 1\n X =S[i]\n S = S[i:]\n break\n else:\n break",
"i",
"range(len(S))",
"range",
"len(S)",
"len",
"S",
"if S[i] != X:\n ans += 1\n X =S[i]\n S = S[i:]\n break\n ",
"S[i] != X",
"S[i]",
"S",
"i",
"X",
"ans += 1",
"ans",
"1",
"X =S[i]",
"X",
"S[i]",
"S",
"i",
"S = S[i:]",
"S",
"S[i:]",
"S",
"i:",
"i",
"break",
"break",
"print(ans)",
"print",
"ans",
"ans = 0",
"0",
"ans",
"S = S[i:]",
"S[i:]",
"S",
"X =S[i]",
"S[i]",
"X",
"X = S[0]",
"S[0]",
"X",
"S = input()",
"input()",
"S",
"ans += 1",
"1",
"ans"
] |
S = input()
X = S[0]
ans = 0
while 1:
for i in range(len(S)):
if S[i] != X:
ans += 1
X =S[i]
S = S[i:]
break
else:
break
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
17,
28,
13,
13,
14,
2,
13,
17,
0,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
13,
13,
10,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13
] |
[
[
44,
2
],
[
47,
6
],
[
35,
9
],
[
13,
12
],
[
45,
12
],
[
48,
16
],
[
39,
16
],
[
42,
16
],
[
41,
19
],
[
12,
20
],
[
12,
23
],
[
48,
24
],
[
39,
24
],
[
42,
24
],
[
50,
26
],
[
38,
29
],
[
12,
30
],
[
51,
33
],
[
36,
33
],
[
35,
36
],
[
12,
38
],
[
38,
39
],
[
12,
41
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] |
[
"s = input()\nprev = None\ntotal = 0\nfor i in s:\n if prev == None:\n prev = i\n else:\n if (i != prev):\n total += 1\n prev = i\n else:\n pass\nprint(total)",
"s = input()",
"s",
"input()",
"input",
"prev = None",
"prev",
"None",
"total = 0",
"total",
"0",
"for i in s:\n if prev == None:\n prev = i\n else:\n if (i != prev):\n total += 1\n prev = i\n else:\n pass",
"i",
"s",
"if prev == None:\n prev = i\n else:\n if (i != prev):\n total += 1\n prev = i\n else:\n pass",
"prev == None",
"prev",
"None",
"prev = i",
"prev",
"i",
"if (i != prev):\n total += 1\n prev = i\n else:\n pass",
"i != prev",
"i",
"prev",
"total += 1",
"total",
"1",
"prev = i",
"prev",
"i",
"print(total)",
"print",
"total",
"total = 0",
"0",
"total",
"prev = i",
"i",
"prev",
"prev = i",
"i",
"prev",
"s = input()",
"input()",
"s",
"prev = None",
"None",
"prev",
"total += 1",
"1",
"total"
] |
s = input()
prev = None
total = 0
for i in s:
if prev == None:
prev = i
else:
if (i != prev):
total += 1
prev = i
else:
pass
print(total)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13,
10,
17,
13
] |
[
[
41,
2
],
[
44,
8
],
[
50,
11
],
[
42,
13
],
[
17,
16
],
[
42,
22
],
[
42,
26
],
[
16,
27
],
[
51,
28
],
[
48,
28
],
[
47,
30
],
[
42,
32
],
[
16,
33
],
[
53,
35
],
[
54,
39
],
[
45,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
],
[
53,
54
]
] |
[
"s = list(input())\nans = 0\nt = s[0]\nfor i in range(1,len(s)):\n if s[i] != t:\n t = s[i]\n ans += 1\nprint(ans)",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"ans = 0",
"ans",
"0",
"t = s[0]",
"t",
"s[0]",
"s",
"0",
"for i in range(1,len(s)):\n if s[i] != t:\n t = s[i]\n ans += 1",
"i",
"range(1,len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[i] != t:\n t = s[i]\n ans += 1",
"s[i] != t",
"s[i]",
"s",
"i",
"t",
"t = s[i]",
"t",
"s[i]",
"s",
"i",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"s = list(input())",
"list(input())",
"s",
"ans = 0",
"0",
"ans",
"t = s[i]",
"s[i]",
"t",
"t = s[0]",
"s[0]",
"t",
"ans += 1",
"1",
"ans"
] |
s = list(input())
ans = 0
t = s[0]
for i in range(1,len(s)):
if s[i] != t:
t = s[i]
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
18,
13
] |
[
[
33,
2
],
[
45,
6
],
[
34,
8
],
[
39,
11
],
[
15,
14
],
[
34,
16
],
[
14,
21
],
[
46,
22
],
[
43,
22
],
[
36,
24
],
[
42,
27
],
[
14,
28
],
[
37,
31
],
[
40,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
14,
42
],
[
42,
43
],
[
45,
46
]
] |
[
"S = input()\n\nprev = S[0]\nswitch_count = 0\nfor bw in S[1:]:\n if bw != prev:\n switch_count += 1\n prev = bw\n\nprint(switch_count) ",
"S = input()",
"S",
"input()",
"input",
"prev = S[0]",
"prev",
"S[0]",
"S",
"0",
"switch_count = 0",
"switch_count",
"0",
"for bw in S[1:]:\n if bw != prev:\n switch_count += 1\n prev = bw",
"bw",
"S[1:]",
"S",
"1:",
"1",
"if bw != prev:\n switch_count += 1\n ",
"bw != prev",
"bw",
"prev",
"switch_count += 1",
"switch_count",
"1",
"prev = bw",
"prev",
"bw",
"print(switch_count)",
"print",
"switch_count",
"S = input()",
"input()",
"S",
"switch_count += 1",
"1",
"switch_count",
"switch_count = 0",
"0",
"switch_count",
"prev = bw",
"bw",
"prev",
"prev = S[0]",
"S[0]",
"prev"
] |
S = input()
prev = S[0]
switch_count = 0
for bw in S[1:]:
if bw != prev:
switch_count += 1
prev = bw
print(switch_count)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13,
10,
17,
13,
10,
18,
13
] |
[
[
38,
2
],
[
35,
8
],
[
47,
11
],
[
39,
13
],
[
17,
16
],
[
39,
18
],
[
16,
23
],
[
48,
24
],
[
42,
24
],
[
44,
26
],
[
41,
29
],
[
16,
30
],
[
45,
33
],
[
36,
33
],
[
35,
36
],
[
38,
39
],
[
16,
41
],
[
41,
42
],
[
44,
45
],
[
47,
48
]
] |
[
"s=list(input())\ncnt=0\nbf=s[0]\nfor i in s[1:]:\n if i!=bf:\n cnt+=1\n bf=i\nprint(cnt)",
"s=list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"cnt=0",
"cnt",
"0",
"bf=s[0]",
"bf",
"s[0]",
"s",
"0",
"for i in s[1:]:\n if i!=bf:\n cnt+=1\n bf=i",
"i",
"s[1:]",
"s",
"1:",
"1",
"if i!=bf:\n cnt+=1\n ",
"i!=bf",
"i",
"bf",
"cnt+=1",
"cnt",
"1",
"bf=i",
"bf",
"i",
"print(cnt)",
"print",
"cnt",
"cnt=0",
"0",
"cnt",
"s=list(input())",
"list(input())",
"s",
"bf=i",
"i",
"bf",
"cnt+=1",
"1",
"cnt",
"bf=s[0]",
"s[0]",
"bf"
] |
s=list(input())
cnt=0
bf=s[0]
for i in s[1:]:
if i!=bf:
cnt+=1
bf=i
print(cnt)
|
[
7,
12,
13,
0,
13,
4,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
18,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
4,
13,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
11,
10
],
[
14,
13
],
[
4,
19
],
[
4,
24
],
[
13,
25
],
[
4,
27
],
[
13,
29
],
[
33,
32
],
[
4,
36
],
[
40,
39
],
[
43,
42
],
[
4,
48
],
[
4,
53
],
[
42,
54
],
[
4,
56
],
[
42,
58
],
[
62,
61
],
[
32,
67
],
[
10,
67
],
[
61,
68
],
[
39,
68
],
[
77,
74
]
] |
[
"def main():\n S = list(input())\n r = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n r += 1\n\n S.reverse()\n l = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n l += 1 \n\n print(min(r, l))\nif __name__ == \"__main__\":\n main()",
"def main():\n S = list(input())\n r = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n r += 1\n\n S.reverse()\n l = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n l += 1 \n\n print(min(r, l))",
"main",
"S = list(input())",
"S",
"list(input())",
"list",
"input()",
"input",
"r = 0",
"r",
"0",
"for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n r += 1\n\n ",
"i",
"range(len(S) - 1)",
"range",
"len(S) - 1",
"len(S)",
"len",
"S",
"1",
"if S[i] != S[i + 1]:\n r += 1\n\n ",
"S[i] != S[i + 1]",
"S[i]",
"S",
"i",
"S[i + 1]",
"S",
"i + 1",
"i",
"1",
"r += 1",
"r",
"1",
"S.reverse()",
"S.reverse",
"S",
"reverse",
"l = 0",
"l",
"0",
"for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n l += 1 \n\n ",
"i",
"range(len(S) - 1)",
"range",
"len(S) - 1",
"len(S)",
"len",
"S",
"1",
"if S[i] != S[i + 1]:\n l += 1 \n\n ",
"S[i] != S[i + 1]",
"S[i]",
"S",
"i",
"S[i + 1]",
"S",
"i + 1",
"i",
"1",
"l += 1",
"l",
"1",
"print(min(r, l))",
"print",
"min(r, l)",
"min",
"r",
"l",
"if __name__ == \"__main__\":\n main()",
"__name__ == \"__main__\"",
"__name__",
"\"__main__\"",
"main()",
"main",
"def main():\n S = list(input())\n r = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n r += 1\n\n S.reverse()\n l = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n l += 1 \n\n print(min(r, l))",
"def main():\n S = list(input())\n r = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n r += 1\n\n S.reverse()\n l = 0\n\n for i in range(len(S) - 1):\n if S[i] != S[i + 1]:\n l += 1 \n\n print(min(r, l))",
"main"
] |
def main():
S = list(input())
r = 0
for i in range(len(S) - 1):
if S[i] != S[i + 1]:
r += 1
S.reverse()
l = 0
for i in range(len(S) - 1):
if S[i] != S[i + 1]:
l += 1
print(min(r, l))
if __name__ == "__main__":
main()
|
[
7,
15,
13,
15,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
12,
13,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
2,
13,
17,
10,
18,
13,
10,
12,
13,
10,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
13,
13,
10,
17,
13,
10,
12,
13,
10,
12,
13,
10,
17,
13,
10,
12,
13
] |
[
[
56,
20
],
[
80,
24
],
[
50,
27
],
[
57,
29
],
[
33,
32
],
[
57,
32
],
[
32,
36
],
[
51,
37
],
[
69,
37
],
[
71,
39
],
[
68,
42
],
[
32,
43
],
[
72,
47
],
[
81,
47
],
[
50,
51
],
[
56,
57
],
[
32,
68
],
[
68,
69
],
[
71,
72
],
[
80,
81
]
] |
[
"import numpy as np\nimport sys\ndef sinput(): return sys.stdin.readline()\ndef iinput(): return int(sinput())\ndef imap(): return map(int, sinput().split())\ndef fmap(): return map(float, sinput().split())\ndef iarr(): return list(imap())\ndef farr(): return list(fmap())\ndef sarr(): return sinput().split()\n\ns = input()\nans = 1\ntmp = s[0]\nfor i in s:\n if i != tmp:\n ans += 1\n tmp = i\nprint(ans-1)",
"import numpy as np",
"numpy",
"import sys",
"sys",
"def sinput(): return sys.stdin.readline()",
"sinput",
"def iinput(): return int(sinput())",
"iinput",
"def imap(): return map(int, sinput().split())",
"imap",
"def fmap(): return map(float, sinput().split())",
"fmap",
"def iarr(): return list(imap())",
"iarr",
"def farr(): return list(fmap())",
"farr",
"def sarr(): return sinput().split()",
"sarr",
"s = input()",
"s",
"input()",
"input",
"ans = 1",
"ans",
"1",
"tmp = s[0]",
"tmp",
"s[0]",
"s",
"0",
"for i in s:\n if i != tmp:\n ans += 1\n tmp = i",
"i",
"s",
"if i != tmp:\n ans += 1\n tmp = i",
"i != tmp",
"i",
"tmp",
"ans += 1",
"ans",
"1",
"tmp = i",
"tmp",
"i",
"print(ans-1)",
"print",
"ans-1",
"ans",
"1",
"tmp = s[0]",
"s[0]",
"tmp",
"def farr(): return list(fmap())",
"def farr(): return list(fmap())",
"farr",
"s = input()",
"input()",
"s",
"def iinput(): return int(sinput())",
"def iinput(): return int(sinput())",
"iinput",
"def fmap(): return map(float, sinput().split())",
"def fmap(): return map(float, sinput().split())",
"fmap",
"def iarr(): return list(imap())",
"def iarr(): return list(imap())",
"iarr",
"tmp = i",
"i",
"tmp",
"ans += 1",
"1",
"ans",
"def sinput(): return sys.stdin.readline()",
"def sinput(): return sys.stdin.readline()",
"sinput",
"def imap(): return map(int, sinput().split())",
"def imap(): return map(int, sinput().split())",
"imap",
"ans = 1",
"1",
"ans",
"def sarr(): return sinput().split()",
"def sarr(): return sinput().split()",
"sarr"
] |
import numpy as np
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()
s = input()
ans = 1
tmp = s[0]
for i in s:
if i != tmp:
ans += 1
tmp = i
print(ans-1)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
39,
17,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
2,
18,
13,
13,
18,
13,
2,
13,
17,
9,
0,
13,
17,
4,
13,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
47,
2
],
[
41,
6
],
[
48,
8
],
[
50,
12
],
[
16,
15
],
[
42,
21
],
[
48,
21
],
[
42,
26
],
[
48,
26
],
[
15,
27
],
[
42,
29
],
[
48,
29
],
[
15,
31
],
[
44,
35
],
[
45,
39
],
[
51,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
]
] |
[
"s = input()\ns = s[::-1]\nans = 0\nfor i in range(len(s)-1):\n if s[i] == s[i+1]:\n continue \n else:\n ans += 1\nprint(ans)",
"s = input()",
"s",
"input()",
"input",
"s = s[::-1]",
"s",
"s[::-1]",
"s",
"::-1",
"-1",
"ans = 0",
"ans",
"0",
"for i in range(len(s)-1):\n if s[i] == s[i+1]:\n continue \n else:\n ans += 1",
"i",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[i] == s[i+1]:\n continue \n else:\n ans += 1",
"s[i] == s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"continue",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"s = s[::-1]",
"s[::-1]",
"s",
"ans += 1",
"1",
"ans",
"s = input()",
"input()",
"s",
"ans = 0",
"0",
"ans"
] |
s = input()
s = s[::-1]
ans = 0
for i in range(len(s)-1):
if s[i] == s[i+1]:
continue
else:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
39,
2
],
[
36,
9
],
[
13,
12
],
[
40,
18
],
[
40,
22
],
[
12,
23
],
[
40,
25
],
[
12,
27
],
[
42,
30
],
[
43,
34
],
[
37,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"S = input().strip()\ncnt = 0\nfor i in range(1,len(S)):\n if S[i]!=S[i-1]:\n cnt += 1\nprint(cnt)",
"S = input().strip()",
"S",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"cnt = 0",
"cnt",
"0",
"for i in range(1,len(S)):\n if S[i]!=S[i-1]:\n cnt += 1",
"i",
"range(1,len(S))",
"range",
"1",
"len(S)",
"len",
"S",
"if S[i]!=S[i-1]:\n cnt += 1",
"S[i]!=S[i-1]",
"S[i]",
"S",
"i",
"S[i-1]",
"S",
"i-1",
"i",
"1",
"cnt += 1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"cnt = 0",
"0",
"cnt",
"S = input().strip()",
"input().strip()",
"S",
"cnt += 1",
"1",
"cnt"
] |
S = input().strip()
cnt = 0
for i in range(1,len(S)):
if S[i]!=S[i-1]:
cnt += 1
print(cnt)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
18,
13,
13,
17,
0,
13,
4,
18,
13,
13,
17,
4,
13,
2,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
33,
2
],
[
36,
6
],
[
34,
9
],
[
39,
11
],
[
34,
14
],
[
30,
18
],
[
34,
21
],
[
40,
27
],
[
31,
28
],
[
30,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
]
] |
[
"s=input()\nn=len(s)\nans=s.count(\"WB\")\nanss=s.count(\"BW\")\nprint(ans+anss)",
"s=input()",
"s",
"input()",
"input",
"n=len(s)",
"n",
"len(s)",
"len",
"s",
"ans=s.count(\"WB\")",
"ans",
"s.count(\"WB\")",
"s.count",
"s",
"count",
"\"WB\"",
"anss=s.count(\"BW\")",
"anss",
"s.count(\"BW\")",
"s.count",
"s",
"count",
"\"BW\"",
"print(ans+anss)",
"print",
"ans+anss",
"ans",
"anss",
"anss=s.count(\"BW\")",
"s.count(\"BW\")",
"anss",
"s=input()",
"input()",
"s",
"n=len(s)",
"len(s)",
"n",
"ans=s.count(\"WB\")",
"s.count(\"WB\")",
"ans"
] |
s=input()
n=len(s)
ans=s.count("WB")
anss=s.count("BW")
print(ans+anss)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13
] |
[
[
43,
2
],
[
46,
8
],
[
49,
11
],
[
44,
13
],
[
17,
16
],
[
44,
22
],
[
44,
26
],
[
16,
27
],
[
44,
29
],
[
16,
31
],
[
40,
34
],
[
41,
38
],
[
47,
38
],
[
40,
41
],
[
43,
44
],
[
46,
47
],
[
49,
50
]
] |
[
"S = list(input())\nans = 0\nnow = S[0]\nfor i in range(1,len(S)):\n if S[i] != S[i - 1]:\n ans += 1\nprint(ans)",
"S = list(input())",
"S",
"list(input())",
"list",
"input()",
"input",
"ans = 0",
"ans",
"0",
"now = S[0]",
"now",
"S[0]",
"S",
"0",
"for i in range(1,len(S)):\n if S[i] != S[i - 1]:\n ans += 1",
"i",
"range(1,len(S))",
"range",
"1",
"len(S)",
"len",
"S",
"if S[i] != S[i - 1]:\n ans += 1",
"S[i] != S[i - 1]",
"S[i]",
"S",
"i",
"S[i - 1]",
"S",
"i - 1",
"i",
"1",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans += 1",
"1",
"ans",
"S = list(input())",
"list(input())",
"S",
"ans = 0",
"0",
"ans",
"now = S[0]",
"S[0]",
"now"
] |
S = list(input())
ans = 0
now = S[0]
for i in range(1,len(S)):
if S[i] != S[i - 1]:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
37,
2
],
[
40,
6
],
[
10,
9
],
[
38,
15
],
[
38,
20
],
[
9,
21
],
[
38,
23
],
[
9,
25
],
[
34,
28
],
[
35,
32
],
[
41,
32
],
[
34,
35
],
[
37,
38
],
[
40,
41
]
] |
[
"a = input()\nd = 0\nfor i in range(len(a)-1):\n if a[i]!=a[i+1]:\n d +=1\nprint(d)",
"a = input()",
"a",
"input()",
"input",
"d = 0",
"d",
"0",
"for i in range(len(a)-1):\n if a[i]!=a[i+1]:\n d +=1",
"i",
"range(len(a)-1)",
"range",
"len(a)-1",
"len(a)",
"len",
"a",
"1",
"if a[i]!=a[i+1]:\n d +=1",
"a[i]!=a[i+1]",
"a[i]",
"a",
"i",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"d +=1",
"d",
"1",
"print(d)",
"print",
"d",
"d +=1",
"1",
"d",
"a = input()",
"input()",
"a",
"d = 0",
"0",
"d"
] |
a = input()
d = 0
for i in range(len(a)-1):
if a[i]!=a[i+1]:
d +=1
print(d)
|
[
7,
17,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13
] |
[
[
38,
3
],
[
35,
7
],
[
11,
10
],
[
39,
16
],
[
39,
21
],
[
10,
22
],
[
39,
24
],
[
10,
26
],
[
41,
29
],
[
42,
33
],
[
36,
33
],
[
35,
36
],
[
38,
39
],
[
41,
42
]
] |
[
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 30 02:12:31 2020\n\n@author: liang\n\"\"\"\n\nS = input()\nans = 0\nfor i in range(len(S) - 1):\n if S[i] != S[i+1]:\n ans += 1\n\nprint(ans)",
"\"\"\"\nCreated on Wed Sep 30 02:12:31 2020\n\n@author: liang\n\"\"\"",
"S = input()",
"S",
"input()",
"input",
"ans = 0",
"ans",
"0",
"for i in range(len(S) - 1):\n if S[i] != S[i+1]:\n ans += 1",
"i",
"range(len(S) - 1)",
"range",
"len(S) - 1",
"len(S)",
"len",
"S",
"1",
"if S[i] != S[i+1]:\n ans += 1",
"S[i] != S[i+1]",
"S[i]",
"S",
"i",
"S[i+1]",
"S",
"i+1",
"i",
"1",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans = 0",
"0",
"ans",
"S = input()",
"input()",
"S",
"ans += 1",
"1",
"ans"
] |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 02:12:31 2020
@author: liang
"""
S = input()
ans = 0
for i in range(len(S) - 1):
if S[i] != S[i+1]:
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
13,
0,
13,
17,
4,
13,
2,
13,
17,
10,
4,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
17,
13
] |
[
[
32,
2
],
[
44,
8
],
[
38,
11
],
[
15,
14
],
[
33,
14
],
[
14,
18
],
[
39,
19
],
[
42,
19
],
[
41,
21
],
[
14,
22
],
[
35,
24
],
[
36,
29
],
[
45,
29
],
[
32,
33
],
[
35,
36
],
[
38,
39
],
[
14,
41
],
[
41,
42
],
[
44,
45
]
] |
[
"S=list(input())\nc=0;m=''\nfor i in S:\n if i!=m:\n m=i\n c+=1\nprint(c-1)",
"S=list(input())",
"S",
"list(input())",
"list",
"input()",
"input",
"c=0",
"c",
"0",
"m=''",
"m",
"''",
"for i in S:\n if i!=m:\n m=i\n c+=1",
"i",
"S",
"if i!=m:\n m=i\n c+=1",
"i!=m",
"i",
"m",
"m=i",
"m",
"i",
"c+=1",
"c",
"1",
"print(c-1)",
"print",
"c-1",
"c",
"1",
"S=list(input())",
"list(input())",
"S",
"c+=1",
"1",
"c",
"m=''",
"''",
"m",
"m=i",
"i",
"m",
"c=0",
"0",
"c"
] |
S=list(input())
c=0;m=''
for i in S:
if i!=m:
m=i
c+=1
print(c-1)
|
[
7,
15,
13,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
4,
18,
13,
13,
13,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
4,
13
] |
[
[
29,
4
],
[
26,
10
],
[
30,
17
],
[
27,
23
],
[
26,
27
],
[
29,
30
]
] |
[
"import itertools\ns = list(input())\ngr = list(itertools.groupby(s))\nprint(len(gr)-1)",
"import itertools",
"itertools",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"gr = list(itertools.groupby(s))",
"gr",
"list(itertools.groupby(s))",
"list",
"itertools.groupby(s)",
"itertools.groupby",
"itertools",
"groupby",
"s",
"print(len(gr)-1)",
"print",
"len(gr)-1",
"len(gr)",
"len",
"gr",
"1",
"gr = list(itertools.groupby(s))",
"list(itertools.groupby(s))",
"gr",
"s = list(input())",
"list(input())",
"s"
] |
import itertools
s = list(input())
gr = list(itertools.groupby(s))
print(len(gr)-1)
|
[
7,
15,
13,
0,
13,
18,
18,
13,
13,
13,
0,
13,
4,
18,
4,
13,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
40,
18,
13,
13,
13,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
18,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13
] |
[
[
51,
4
],
[
54,
11
],
[
52,
15
],
[
63,
18
],
[
55,
20
],
[
60,
23
],
[
27,
26
],
[
55,
32
],
[
55,
36
],
[
26,
37
],
[
64,
38
],
[
58,
38
],
[
57,
40
],
[
55,
42
],
[
26,
43
],
[
66,
45
],
[
67,
49
],
[
61,
49
],
[
51,
52
],
[
54,
55
],
[
57,
58
],
[
60,
61
],
[
63,
64
],
[
66,
67
]
] |
[
"import sys\ninput=sys.stdin.readline\ns=input().rstrip()\nt=s[0]\nans=0\nfor i in range(1,len(s)):\n if s[i]!=t:\n t=s[i]\n ans+=1\nprint(ans)",
"import sys",
"sys",
"input=sys.stdin.readline",
"input",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
"s=input().rstrip()",
"s",
"input().rstrip()",
"().rstrip",
"()",
"input",
"rstrip",
"t=s[0]",
"t",
"s[0]",
"s",
"0",
"ans=0",
"ans",
"0",
"for i in range(1,len(s)):\n if s[i]!=t:\n t=s[i]\n ans+=1",
"i",
"range(1,len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[i]!=t:\n t=s[i]\n ans+=1",
"s[i]!=t",
"s[i]",
"s",
"i",
"t",
"t=s[i]",
"t",
"s[i]",
"s",
"i",
"ans+=1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"input=sys.stdin.readline",
"sys.stdin.readline",
"input",
"s=input().rstrip()",
"input().rstrip()",
"s",
"t=s[i]",
"s[i]",
"t",
"ans=0",
"0",
"ans",
"t=s[0]",
"s[0]",
"t",
"ans+=1",
"1",
"ans"
] |
import sys
input=sys.stdin.readline
s=input().rstrip()
t=s[0]
ans=0
for i in range(1,len(s)):
if s[i]!=t:
t=s[i]
ans+=1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13,
10,
17,
13
] |
[
[
45,
2
],
[
42,
6
],
[
46,
9
],
[
48,
11
],
[
15,
14
],
[
43,
20
],
[
46,
25
],
[
14,
26
],
[
46,
28
],
[
14,
30
],
[
39,
33
],
[
40,
37
],
[
49,
37
],
[
39,
40
],
[
42,
43
],
[
45,
46
],
[
48,
49
]
] |
[
"a = input()\nz = list(a)\nd = 0\nfor i in range(len(z)-1):\n if a[i]!=a[i+1]:\n d +=1\nprint(d)",
"a = input()",
"a",
"input()",
"input",
"z = list(a)",
"z",
"list(a)",
"list",
"a",
"d = 0",
"d",
"0",
"for i in range(len(z)-1):\n if a[i]!=a[i+1]:\n d +=1",
"i",
"range(len(z)-1)",
"range",
"len(z)-1",
"len(z)",
"len",
"z",
"1",
"if a[i]!=a[i+1]:\n d +=1",
"a[i]!=a[i+1]",
"a[i]",
"a",
"i",
"a[i+1]",
"a",
"i+1",
"i",
"1",
"d +=1",
"d",
"1",
"print(d)",
"print",
"d",
"d +=1",
"1",
"d",
"z = list(a)",
"list(a)",
"z",
"a = input()",
"input()",
"a",
"d = 0",
"0",
"d"
] |
a = input()
z = list(a)
d = 0
for i in range(len(z)-1):
if a[i]!=a[i+1]:
d +=1
print(d)
|
[
7,
15,
13,
13,
15,
15,
4,
18,
13,
13,
17,
0,
13,
2,
2,
17,
17,
17,
12,
13,
29,
18,
4,
18,
18,
13,
13,
13,
39,
17,
12,
13,
29,
4,
13,
13,
4,
18,
4,
13,
13,
12,
13,
29,
4,
13,
4,
13,
12,
13,
41,
28,
13,
4,
13,
13,
4,
4,
13,
4,
13,
0,
13,
13,
41,
28,
13,
4,
13,
31,
13,
4,
4,
13,
13,
29,
13,
23,
13,
12,
13,
0,
13,
4,
13,
4,
13,
4,
13,
17,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13,
10,
2,
13,
10,
12,
13
] |
[
[
109,
12
],
[
98,
39
],
[
98,
47
],
[
53,
52
],
[
78,
55
],
[
113,
60
],
[
63,
62
],
[
67,
66
],
[
62,
70
],
[
66,
74
],
[
78,
78
],
[
83,
82
],
[
98,
84
],
[
107,
95
],
[
109,
110
]
] |
[
"import sys, math\nfrom collections import defaultdict\nfrom itertools import product\nsys.setrecursionlimit(500000)\nMOD = 10**9+7\n\ndef input():\n return sys.stdin.readline()[:-1]\n\ndef mi():\n return map(int, input().split())\n\ndef ii():\n return int(input())\n\ndef i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]\n\ndef main():\n S = input()\n print(sum(1 for i in range(len(S)-1) if S[i] != S[i+1]))\n\nif __name__ == '__main__':\n main()",
"import sys, math",
"sys",
"math",
"from collections import defaultdict",
"from itertools import product",
"sys.setrecursionlimit(500000)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"500000",
"MOD = 10**9+7",
"MOD",
"10**9+7",
"10**9",
"10",
"9",
"7",
"def input():\n return sys.stdin.readline()[:-1]",
"input",
"return sys.stdin.readline()[:-1]",
"sys.stdin.readline()[:-1]",
"sys.stdin.readline()",
"sys.stdin.readline",
"sys.stdin",
"sys",
"stdin",
"readline",
":-1",
"-1",
"def mi():\n return map(int, input().split())",
"mi",
"return map(int, input().split())",
"map(int, input().split())",
"map",
"int",
"input().split()",
"().split",
"()",
"input",
"split",
"def ii():\n return int(input())",
"ii",
"return int(input())",
"int(input())",
"int",
"input()",
"input",
"def i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]",
"i2",
"list(mi()) for i in range(n)",
"for i in range(n)",
"i",
"range(n)",
"range",
"n",
"for i in range(n)",
"list(mi())",
"list",
"mi()",
"mi",
"tmp = [list(mi()) for i in range(n)]",
"tmp",
"[list(mi()) for i in range(n)]",
"list(i) for i in zip(*tmp)",
"for i in zip(*tmp)",
"i",
"zip(*tmp)",
"zip",
"*tmp",
"tmp",
"for i in zip(*tmp)",
"list(i)",
"list",
"i",
"return [list(i) for i in zip(*tmp)]",
"[list(i) for i in zip(*tmp)]",
"n",
"n",
"def main():\n S = input()\n print(sum(1 for i in range(len(S)-1) if S[i] != S[i+1]))",
"main",
"S = input()",
"S",
"input()",
"input",
"print(sum(1 for i in range(len(S)-1) if S[i] != S[i+1]))",
"print",
"sum(1 for i in range(len(S)-1) if S[i] != S[i+1])",
"sum",
"1",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def input():\n return sys.stdin.readline()[:-1]",
"def input():\n return sys.stdin.readline()[:-1]",
"input",
"def i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]",
"def i2(n):\n tmp = [list(mi()) for i in range(n)]\n return [list(i) for i in zip(*tmp)]",
"i2",
"def ii():\n return int(input())",
"def ii():\n return int(input())",
"ii",
"def main():\n S = input()\n print(sum(1 for i in range(len(S)-1) if S[i] != S[i+1]))",
"def main():\n S = input()\n print(sum(1 for i in range(len(S)-1) if S[i] != S[i+1]))",
"main",
"MOD = 10**9+7",
"10**9+7",
"MOD",
"def mi():\n return map(int, input().split())",
"def mi():\n return map(int, input().split())",
"mi"
] |
import sys, math
from collections import defaultdict
from itertools import product
sys.setrecursionlimit(500000)
MOD = 10**9+7
def input():
return sys.stdin.readline()[:-1]
def mi():
return map(int, input().split())
def ii():
return int(input())
def i2(n):
tmp = [list(mi()) for i in range(n)]
return [list(i) for i in zip(*tmp)]
def main():
S = input()
print(sum(1 for i in range(len(S)-1) if S[i] != S[i+1]))
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
18,
4,
13,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
18,
13,
13,
13,
9,
0,
13,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
18,
13
] |
[
[
43,
2
],
[
49,
9
],
[
44,
11
],
[
46,
14
],
[
18,
17
],
[
44,
23
],
[
44,
27
],
[
17,
28
],
[
50,
29
],
[
56,
29
],
[
55,
32
],
[
44,
34
],
[
17,
35
],
[
52,
37
],
[
53,
41
],
[
47,
41
],
[
43,
44
],
[
46,
47
],
[
49,
50
],
[
52,
53
],
[
55,
56
]
] |
[
"S = input().strip()\n\ntmp = S[0]\ncnt = 0\nfor i in range(1, len(S)):\n if S[i] == tmp:\n continue\n else:\n tmp = S[i]\n cnt += 1\n\nprint(cnt)",
"S = input().strip()",
"S",
"input().strip()",
"().strip",
"()",
"input",
"strip",
"tmp = S[0]",
"tmp",
"S[0]",
"S",
"0",
"cnt = 0",
"cnt",
"0",
"for i in range(1, len(S)):\n if S[i] == tmp:\n continue\n else:\n tmp = S[i]\n cnt += 1",
"i",
"range(1, len(S))",
"range",
"1",
"len(S)",
"len",
"S",
"if S[i] == tmp:\n continue\n else:\n tmp = S[i]\n cnt += 1",
"S[i] == tmp",
"S[i]",
"S",
"i",
"tmp",
"continue",
"tmp = S[i]",
"tmp",
"S[i]",
"S",
"i",
"cnt += 1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"S = input().strip()",
"input().strip()",
"S",
"cnt = 0",
"0",
"cnt",
"tmp = S[0]",
"S[0]",
"tmp",
"cnt += 1",
"1",
"cnt",
"tmp = S[i]",
"S[i]",
"tmp"
] |
S = input().strip()
tmp = S[0]
cnt = 0
for i in range(1, len(S)):
if S[i] == tmp:
continue
else:
tmp = S[i]
cnt += 1
print(cnt)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
39,
18,
13,
17,
0,
13,
17,
28,
13,
13,
14,
2,
13,
18,
13,
17,
9,
0,
13,
17,
4,
18,
13,
13,
13,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
39,
13
] |
[
[
44,
2
],
[
47,
8
],
[
45,
11
],
[
38,
14
],
[
18,
17
],
[
45,
17
],
[
17,
21
],
[
48,
23
],
[
41,
27
],
[
48,
31
],
[
17,
33
],
[
42,
36
],
[
39,
36
],
[
38,
39
],
[
41,
42
],
[
44,
45
],
[
47,
48
]
] |
[
"s = list(input())\ncompress = [s[0]]\n\nans = 0\nfor c in s:\n if c == compress[-1]:\n continue\n ans += 1\n compress.append(c)\n\nprint(ans)",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"compress = [s[0]]",
"compress",
"[s[0]]",
"s[0]",
"s",
"0",
"ans = 0",
"ans",
"0",
"for c in s:\n if c == compress[-1]:\n continue\n ans += 1\n compress.append(c)",
"c",
"s",
"if c == compress[-1]:\n continue\n ",
"c == compress[-1]",
"c",
"compress[-1]",
"compress",
"-1",
"continue",
"ans += 1",
"ans",
"1",
"compress.append(c)",
"compress.append",
"compress",
"append",
"c",
"print(ans)",
"print",
"ans",
"ans = 0",
"0",
"ans",
"ans += 1",
"1",
"ans",
"s = list(input())",
"list(input())",
"s",
"compress = [s[0]]",
"[s[0]]",
"compress"
] |
s = list(input())
compress = [s[0]]
ans = 0
for c in s:
if c == compress[-1]:
continue
ans += 1
compress.append(c)
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
18,
13,
10,
17,
13,
10,
4,
13,
10,
13,
13
] |
[
[
42,
2
],
[
33,
6
],
[
36,
9
],
[
43,
11
],
[
15,
14
],
[
43,
16
],
[
14,
21
],
[
37,
22
],
[
46,
22
],
[
39,
24
],
[
45,
27
],
[
14,
28
],
[
40,
31
],
[
34,
31
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
],
[
14,
45
],
[
45,
46
]
] |
[
"S = input()\n\ncount = 0\nprev = S[0]\nfor s in S[1:]:\n if s != prev:\n count += 1\n prev = s\nprint(count)",
"S = input()",
"S",
"input()",
"input",
"count = 0",
"count",
"0",
"prev = S[0]",
"prev",
"S[0]",
"S",
"0",
"for s in S[1:]:\n if s != prev:\n count += 1\n prev = s",
"s",
"S[1:]",
"S",
"1:",
"1",
"if s != prev:\n count += 1\n ",
"s != prev",
"s",
"prev",
"count += 1",
"count",
"1",
"prev = s",
"prev",
"s",
"print(count)",
"print",
"count",
"count = 0",
"0",
"count",
"prev = S[0]",
"S[0]",
"prev",
"count += 1",
"1",
"count",
"S = input()",
"input()",
"S",
"prev = s",
"s",
"prev"
] |
S = input()
count = 0
prev = S[0]
for s in S[1:]:
if s != prev:
count += 1
prev = s
print(count)
|
[
7,
12,
13,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
4,
13,
10,
12,
13
] |
[
[
5,
4
],
[
9,
8
],
[
12,
11
],
[
4,
17
],
[
4,
22
],
[
11,
23
],
[
4,
25
],
[
11,
27
],
[
31,
30
],
[
30,
34
],
[
8,
34
],
[
39,
36
]
] |
[
"def resolve():\n\ts = input()\n\tk = 0\n\tfor i in range(len(s)-1):\n\t\tif s[i] != s[i+1]:\n\t\t\tk += 1\n\tprint(k)\nresolve()",
"def resolve():\n\ts = input()\n\tk = 0\n\tfor i in range(len(s)-1):\n\t\tif s[i] != s[i+1]:\n\t\t\tk += 1\n\tprint(k)",
"resolve",
"s = input()",
"s",
"input()",
"input",
"k = 0",
"k",
"0",
"for i in range(len(s)-1):\n\t\tif s[i] != s[i+1]:\n\t\t\tk += 1\n\t",
"i",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[i] != s[i+1]:\n\t\t\tk += 1\n\t",
"s[i] != s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"k += 1",
"k",
"1",
"print(k)",
"print",
"k",
"resolve()",
"resolve",
"def resolve():\n\ts = input()\n\tk = 0\n\tfor i in range(len(s)-1):\n\t\tif s[i] != s[i+1]:\n\t\t\tk += 1\n\tprint(k)",
"def resolve():\n\ts = input()\n\tk = 0\n\tfor i in range(len(s)-1):\n\t\tif s[i] != s[i+1]:\n\t\t\tk += 1\n\tprint(k)",
"resolve"
] |
def resolve():
s = input()
k = 0
for i in range(len(s)-1):
if s[i] != s[i+1]:
k += 1
print(k)
resolve()
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
4,
13,
10,
18,
13,
10,
17,
13,
10,
13,
13,
10,
17,
13
] |
[
[
30,
2
],
[
42,
6
],
[
33,
9
],
[
31,
11
],
[
15,
14
],
[
31,
14
],
[
34,
18
],
[
40,
18
],
[
14,
19
],
[
36,
21
],
[
39,
24
],
[
14,
25
],
[
37,
28
],
[
43,
28
],
[
30,
31
],
[
33,
34
],
[
36,
37
],
[
14,
39
],
[
39,
40
],
[
42,
43
]
] |
[
"A=input()\ncnt=0\ntmp=A[0]\nfor i in A:\n if tmp!=i:\n cnt+=1\n tmp=i\nprint(cnt)",
"A=input()",
"A",
"input()",
"input",
"cnt=0",
"cnt",
"0",
"tmp=A[0]",
"tmp",
"A[0]",
"A",
"0",
"for i in A:\n if tmp!=i:\n cnt+=1\n tmp=i",
"i",
"A",
"if tmp!=i:\n cnt+=1\n tmp=i",
"tmp!=i",
"tmp",
"i",
"cnt+=1",
"cnt",
"1",
"tmp=i",
"tmp",
"i",
"print(cnt)",
"print",
"cnt",
"A=input()",
"input()",
"A",
"tmp=A[0]",
"A[0]",
"tmp",
"cnt+=1",
"1",
"cnt",
"tmp=i",
"i",
"tmp",
"cnt=0",
"0",
"cnt"
] |
A=input()
cnt=0
tmp=A[0]
for i in A:
if tmp!=i:
cnt+=1
tmp=i
print(cnt)
|
[
7,
12,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
13,
0,
13,
17,
29,
13,
23,
13,
12,
13,
29,
12,
13,
0,
13,
4,
13,
4,
13,
4,
13,
13,
14,
2,
13,
17,
4,
13,
10,
12,
13,
10,
12,
13,
10,
12,
13
] |
[
[
5,
4
],
[
8,
7
],
[
30,
9
],
[
13,
12
],
[
30,
14
],
[
7,
19
],
[
22,
19
],
[
12,
20
],
[
23,
22
],
[
12,
23
],
[
26,
25
],
[
25,
28
],
[
4,
28
],
[
30,
30
],
[
38,
37
],
[
59,
43
],
[
37,
44
],
[
56,
50
]
] |
[
"def myAnswer(S:str) -> int:\n ans = 0\n pre = S[0]\n for s in S[1:]:\n if (pre != s):\n pre = s\n ans += 1\n return ans\n\ndef modelAnswer():\n return\ndef main():\n S = input()\n\n print(myAnswer(S))\nif __name__ == '__main__':\n main()",
"def myAnswer(S:str) -> int:\n ans = 0\n pre = S[0]\n for s in S[1:]:\n if (pre != s):\n pre = s\n ans += 1\n return ans",
"myAnswer",
"ans = 0",
"ans",
"0",
"pre = S[0]",
"pre",
"S[0]",
"S",
"0",
"for s in S[1:]:\n if (pre != s):\n pre = s\n ans += 1\n ",
"s",
"S[1:]",
"S",
"1:",
"1",
"if (pre != s):\n pre = s\n ans += 1\n ",
"pre != s",
"pre",
"s",
"pre = s",
"pre",
"s",
"ans += 1",
"ans",
"1",
"return ans",
"ans",
"S:str",
"S",
"def modelAnswer():\n return",
"modelAnswer",
"return",
"def main():\n S = input()\n\n print(myAnswer(S))",
"main",
"S = input()",
"S",
"input()",
"input",
"print(myAnswer(S))",
"print",
"myAnswer(S)",
"myAnswer",
"S",
"if __name__ == '__main__':\n main()",
"__name__ == '__main__'",
"__name__",
"'__main__'",
"main()",
"main",
"def modelAnswer():\n return",
"def modelAnswer():\n return",
"modelAnswer",
"def main():\n S = input()\n\n print(myAnswer(S))",
"def main():\n S = input()\n\n print(myAnswer(S))",
"main",
"def myAnswer(S:str) -> int:\n ans = 0\n pre = S[0]\n for s in S[1:]:\n if (pre != s):\n pre = s\n ans += 1\n return ans",
"def myAnswer(S:str) -> int:\n ans = 0\n pre = S[0]\n for s in S[1:]:\n if (pre != s):\n pre = s\n ans += 1\n return ans",
"myAnswer"
] |
def myAnswer(S:str) -> int:
ans = 0
pre = S[0]
for s in S[1:]:
if (pre != s):
pre = s
ans += 1
return ans
def modelAnswer():
return
def main():
S = input()
print(myAnswer(S))
if __name__ == '__main__':
main()
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
18,
13,
2,
13,
17,
18,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
4,
13,
10,
4,
13
] |
[
[
46,
2
],
[
43,
6
],
[
47,
9
],
[
37,
11
],
[
15,
14
],
[
44,
18
],
[
47,
23
],
[
14,
25
],
[
47,
28
],
[
14,
29
],
[
40,
31
],
[
41,
35
],
[
38,
35
],
[
37,
38
],
[
40,
41
],
[
43,
44
],
[
46,
47
]
] |
[
"s=input()\nn=len(s)\n\nans=0\nfor i in range(n-1):\n if s[i+1]!=s[i]:\n ans+=1\n\nprint(ans)",
"s=input()",
"s",
"input()",
"input",
"n=len(s)",
"n",
"len(s)",
"len",
"s",
"ans=0",
"ans",
"0",
"for i in range(n-1):\n if s[i+1]!=s[i]:\n ans+=1",
"i",
"range(n-1)",
"range",
"n-1",
"n",
"1",
"if s[i+1]!=s[i]:\n ans+=1",
"s[i+1]!=s[i]",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"s[i]",
"s",
"i",
"ans+=1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans=0",
"0",
"ans",
"ans+=1",
"1",
"ans",
"n=len(s)",
"len(s)",
"n",
"s=input()",
"input()",
"s"
] |
s=input()
n=len(s)
ans=0
for i in range(n-1):
if s[i+1]!=s[i]:
ans+=1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
4,
13,
40,
13,
13,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
4,
13
] |
[
[
21,
2
],
[
27,
6
],
[
22,
9
],
[
24,
11
],
[
25,
19
],
[
21,
22
],
[
24,
25
],
[
27,
28
]
] |
[
"S = input()\nl = len(S)\nans = sum(a != b for a,b in zip(S[:l-1],S[1:]))\nprint(ans)",
"S = input()",
"S",
"input()",
"input",
"l = len(S)",
"l",
"len(S)",
"len",
"S",
"ans = sum(a != b for a,b in zip(S[:l-1],S[1:]))",
"ans",
"sum(a != b for a,b in zip(S[:l-1],S[1:]))",
"sum",
"a != b",
"a",
"b",
"print(ans)",
"print",
"ans",
"S = input()",
"input()",
"S",
"ans = sum(a != b for a,b in zip(S[:l-1],S[1:]))",
"sum(a != b for a,b in zip(S[:l-1],S[1:]))",
"ans",
"l = len(S)",
"len(S)",
"l"
] |
S = input()
l = len(S)
ans = sum(a != b for a,b in zip(S[:l-1],S[1:]))
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
4,
13,
17,
4,
13,
13,
14,
2,
18,
13,
13,
13,
9,
0,
13,
17,
0,
13,
18,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13,
10,
18,
13
] |
[
[
43,
2
],
[
52,
6
],
[
44,
8
],
[
46,
11
],
[
15,
14
],
[
44,
20
],
[
44,
24
],
[
14,
25
],
[
53,
26
],
[
50,
26
],
[
40,
29
],
[
49,
32
],
[
44,
34
],
[
14,
35
],
[
41,
38
],
[
47,
38
],
[
40,
41
],
[
43,
44
],
[
46,
47
],
[
49,
50
],
[
52,
53
]
] |
[
"s = input()\nwb = s[0]\nc = 0\nfor i in range(1, len(s)):\n if s[i] == wb:\n continue\n else:\n c += 1\n wb = s[i]\n\nprint(c)",
"s = input()",
"s",
"input()",
"input",
"wb = s[0]",
"wb",
"s[0]",
"s",
"0",
"c = 0",
"c",
"0",
"for i in range(1, len(s)):\n if s[i] == wb:\n continue\n else:\n c += 1\n wb = s[i]",
"i",
"range(1, len(s))",
"range",
"1",
"len(s)",
"len",
"s",
"if s[i] == wb:\n continue\n else:\n c += 1\n wb = s[i]",
"s[i] == wb",
"s[i]",
"s",
"i",
"wb",
"continue",
"c += 1",
"c",
"1",
"wb = s[i]",
"wb",
"s[i]",
"s",
"i",
"print(c)",
"print",
"c",
"c += 1",
"1",
"c",
"s = input()",
"input()",
"s",
"c = 0",
"0",
"c",
"wb = s[i]",
"s[i]",
"wb",
"wb = s[0]",
"s[0]",
"wb"
] |
s = input()
wb = s[0]
c = 0
for i in range(1, len(s)):
if s[i] == wb:
continue
else:
c += 1
wb = s[i]
print(c)
|
[
7,
15,
13,
0,
13,
18,
13,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
17,
17,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
17,
0,
13,
2,
17,
17,
12,
13,
0,
13,
4,
13,
4,
18,
4,
18,
13,
13,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
2,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
4,
13,
10,
12,
13,
10,
2,
13,
10,
4,
13,
10,
18,
13,
10,
2,
13,
10,
2,
13
] |
[
[
93,
4
],
[
87,
16
],
[
96,
21
],
[
90,
28
],
[
99,
33
],
[
41,
40
],
[
94,
47
],
[
52,
51
],
[
40,
54
],
[
57,
56
],
[
60,
59
],
[
51,
63
],
[
40,
68
],
[
59,
69
],
[
40,
71
],
[
59,
73
],
[
77,
76
],
[
76,
80
],
[
56,
80
],
[
85,
82
],
[
87,
88
],
[
90,
91
],
[
93,
94
],
[
96,
97
],
[
99,
100
]
] |
[
"import sys\n#from collections import defaultdict, deque, Counter\n#import bisect\n#import heapq\n#import math\n#from itertools import accumulate\n#from itertools import permutations as perm\n#from itertools import combinations as comb\n#from itertools import combinations_with_replacement as combr\n#from fractions import gcd\n#import numpy as np\n\nstdin = sys.stdin\nsys.setrecursionlimit(10 ** 7)\nMIN = -10 ** 9\nMOD = 10 ** 9 + 7\nINF = float(\"inf\")\nIINF = 10 ** 18\n\ndef main():\n s = str(stdin.readline().rstrip())\n #A, B, C = map(int, stdin.readline().rstrip().split())\n #l = list(map(int, stdin.readline().rstrip().split()))\n #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]\n #word = [stdin.readline().rstrip() for _ in range(n)]\n #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]\n #zeros = [[0] * w for i in range(h)]\n l = len(s)\n ans = 0\n for i in range(l-1):\n if s[i] != s[i+1]:\n ans += 1\n print(ans)\n\nmain()",
"import sys",
"sys",
"stdin = sys.stdin",
"stdin",
"sys.stdin",
"sys",
"stdin",
"sys.setrecursionlimit(10 ** 7)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10 ** 7",
"10",
"7",
"MIN = -10 ** 9",
"MIN",
"-10 ** 9",
"-10",
"9",
"MOD = 10 ** 9 + 7",
"MOD",
"10 ** 9 + 7",
"10 ** 9",
"10",
"9",
"7",
"INF = float(\"inf\")",
"INF",
"float(\"inf\")",
"float",
"\"inf\"",
"IINF = 10 ** 18",
"IINF",
"10 ** 18",
"10",
"18",
"def main():\n s = str(stdin.readline().rstrip())\n #A, B, C = map(int, stdin.readline().rstrip().split())\n #l = list(map(int, stdin.readline().rstrip().split()))\n #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]\n #word = [stdin.readline().rstrip() for _ in range(n)]\n #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]\n #zeros = [[0] * w for i in range(h)]\n l = len(s)\n ans = 0\n for i in range(l-1):\n if s[i] != s[i+1]:\n ans += 1\n print(ans)",
"main",
"s = str(stdin.readline().rstrip())",
"s",
"str(stdin.readline().rstrip())",
"str",
"stdin.readline().rstrip()",
"stdin.readline().rstrip",
"stdin.readline()",
"stdin.readline",
"stdin",
"readline",
"rstrip",
"l = len(s)",
"l",
"len(s)",
"len",
"s",
"ans = 0",
"ans",
"0",
"for i in range(l-1):\n if s[i] != s[i+1]:\n ans += 1\n ",
"i",
"range(l-1)",
"range",
"l-1",
"l",
"1",
"if s[i] != s[i+1]:\n ans += 1\n ",
"s[i] != s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"main()",
"main",
"def main():\n s = str(stdin.readline().rstrip())\n #A, B, C = map(int, stdin.readline().rstrip().split())\n #l = list(map(int, stdin.readline().rstrip().split()))\n #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]\n #word = [stdin.readline().rstrip() for _ in range(n)]\n #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]\n #zeros = [[0] * w for i in range(h)]\n l = len(s)\n ans = 0\n for i in range(l-1):\n if s[i] != s[i+1]:\n ans += 1\n print(ans)",
"def main():\n s = str(stdin.readline().rstrip())\n #A, B, C = map(int, stdin.readline().rstrip().split())\n #l = list(map(int, stdin.readline().rstrip().split()))\n #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]\n #word = [stdin.readline().rstrip() for _ in range(n)]\n #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]\n #zeros = [[0] * w for i in range(h)]\n l = len(s)\n ans = 0\n for i in range(l-1):\n if s[i] != s[i+1]:\n ans += 1\n print(ans)",
"main",
"MIN = -10 ** 9",
"-10 ** 9",
"MIN",
"INF = float(\"inf\")",
"float(\"inf\")",
"INF",
"stdin = sys.stdin",
"sys.stdin",
"stdin",
"MOD = 10 ** 9 + 7",
"10 ** 9 + 7",
"MOD",
"IINF = 10 ** 18",
"10 ** 18",
"IINF"
] |
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18
def main():
s = str(stdin.readline().rstrip())
#A, B, C = map(int, stdin.readline().rstrip().split())
#l = list(map(int, stdin.readline().rstrip().split()))
#numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
#word = [stdin.readline().rstrip() for _ in range(n)]
#number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
#zeros = [[0] * w for i in range(h)]
l = len(s)
ans = 0
for i in range(l-1):
if s[i] != s[i+1]:
ans += 1
print(ans)
main()
|
[
7,
0,
13,
4,
13,
12,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
4,
13,
4,
13,
13,
14,
40,
18,
13,
13,
13,
0,
13,
17,
0,
13,
18,
13,
13,
29,
13,
23,
13,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
12,
13
] |
[
[
48,
2
],
[
9,
8
],
[
12,
11
],
[
39,
13
],
[
17,
16
],
[
39,
21
],
[
39,
25
],
[
16,
26
],
[
11,
27
],
[
32,
27
],
[
30,
29
],
[
33,
32
],
[
39,
34
],
[
16,
35
],
[
29,
37
],
[
8,
37
],
[
39,
39
],
[
52,
44
],
[
49,
45
],
[
48,
49
]
] |
[
"S = input()\n\ndef countcomponents(S):\n count = 1\n current = S[0]\n for i in range(len(S)):\n if S[i] != current:\n count += 1\n current = S[i]\n return count\n\nprint(countcomponents(S) - 1)",
"S = input()",
"S",
"input()",
"input",
"def countcomponents(S):\n count = 1\n current = S[0]\n for i in range(len(S)):\n if S[i] != current:\n count += 1\n current = S[i]\n return count",
"countcomponents",
"count = 1",
"count",
"1",
"current = S[0]",
"current",
"S[0]",
"S",
"0",
"for i in range(len(S)):\n if S[i] != current:\n count += 1\n current = S[i]\n ",
"i",
"range(len(S))",
"range",
"len(S)",
"len",
"S",
"if S[i] != current:\n count += 1\n current = S[i]\n ",
"S[i] != current",
"S[i]",
"S",
"i",
"current",
"count += 1",
"count",
"1",
"current = S[i]",
"current",
"S[i]",
"S",
"i",
"return count",
"count",
"S",
"S",
"print(countcomponents(S) - 1)",
"print",
"countcomponents(S) - 1",
"countcomponents(S)",
"countcomponents",
"S",
"1",
"S = input()",
"input()",
"S",
"def countcomponents(S):\n count = 1\n current = S[0]\n for i in range(len(S)):\n if S[i] != current:\n count += 1\n current = S[i]\n return count",
"def countcomponents(S):\n count = 1\n current = S[0]\n for i in range(len(S)):\n if S[i] != current:\n count += 1\n current = S[i]\n return count",
"countcomponents"
] |
S = input()
def countcomponents(S):
count = 1
current = S[0]
for i in range(len(S)):
if S[i] != current:
count += 1
current = S[i]
return count
print(countcomponents(S) - 1)
|
[
7,
15,
13,
15,
13,
4,
18,
13,
13,
17,
15,
15,
13,
15,
13,
0,
13,
2,
2,
17,
17,
17,
0,
13,
4,
13,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
2,
13,
10,
17,
13,
10,
4,
13
] |
[
[
58,
16
],
[
64,
23
],
[
61,
27
],
[
31,
30
],
[
65,
36
],
[
65,
41
],
[
30,
42
],
[
65,
44
],
[
30,
46
],
[
55,
49
],
[
56,
53
],
[
62,
53
],
[
55,
56
],
[
58,
59
],
[
61,
62
],
[
64,
65
]
] |
[
"import sys\nimport itertools\nsys.setrecursionlimit(1000000000)\nfrom heapq import heapify,heappop,heappush,heappushpop\nimport math\nimport collections\nMOD = 10**9+7\n\ns = input()\ncnt = 0\nfor i in range(len(s)-1):\n if s[i] != s[i+1]:\n cnt+=1\nprint(cnt)",
"import sys",
"sys",
"import itertools",
"itertools",
"sys.setrecursionlimit(1000000000)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"1000000000",
"from heapq import heapify,heappop,heappush,heappushpop",
"import math",
"math",
"import collections",
"collections",
"MOD = 10**9+7",
"MOD",
"10**9+7",
"10**9",
"10",
"9",
"7",
"s = input()",
"s",
"input()",
"input",
"cnt = 0",
"cnt",
"0",
"for i in range(len(s)-1):\n if s[i] != s[i+1]:\n cnt+=1",
"i",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[i] != s[i+1]:\n cnt+=1",
"s[i] != s[i+1]",
"s[i]",
"s",
"i",
"s[i+1]",
"s",
"i+1",
"i",
"1",
"cnt+=1",
"cnt",
"1",
"print(cnt)",
"print",
"cnt",
"cnt+=1",
"1",
"cnt",
"MOD = 10**9+7",
"10**9+7",
"MOD",
"cnt = 0",
"0",
"cnt",
"s = input()",
"input()",
"s"
] |
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7
s = input()
cnt = 0
for i in range(len(s)-1):
if s[i] != s[i+1]:
cnt+=1
print(cnt)
|
[
7,
0,
13,
4,
13,
4,
13,
4,
18,
13,
13,
17,
0,
13,
17,
28,
13,
4,
13,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
17,
4,
13,
2,
13,
17,
10,
17,
13,
10,
17,
13,
10,
4,
13
] |
[
[
49,
2
],
[
50,
9
],
[
43,
13
],
[
17,
16
],
[
50,
22
],
[
50,
27
],
[
16,
28
],
[
50,
30
],
[
16,
32
],
[
46,
35
],
[
47,
40
],
[
44,
40
],
[
43,
44
],
[
46,
47
],
[
49,
50
]
] |
[
"s = list(input())\ns.append('X')\ncnt = 0\nfor n in range(len(s)-1):\n\tif s[n] != s[n+1]:\n\t\tcnt += 1\nprint(cnt - 1)",
"s = list(input())",
"s",
"list(input())",
"list",
"input()",
"input",
"s.append('X')",
"s.append",
"s",
"append",
"'X'",
"cnt = 0",
"cnt",
"0",
"for n in range(len(s)-1):\n\tif s[n] != s[n+1]:\n\t\tcnt += 1",
"n",
"range(len(s)-1)",
"range",
"len(s)-1",
"len(s)",
"len",
"s",
"1",
"if s[n] != s[n+1]:\n\t\tcnt += 1",
"s[n] != s[n+1]",
"s[n]",
"s",
"n",
"s[n+1]",
"s",
"n+1",
"n",
"1",
"cnt += 1",
"cnt",
"1",
"print(cnt - 1)",
"print",
"cnt - 1",
"cnt",
"1",
"cnt = 0",
"0",
"cnt",
"cnt += 1",
"1",
"cnt",
"s = list(input())",
"list(input())",
"s"
] |
s = list(input())
s.append('X')
cnt = 0
for n in range(len(s)-1):
if s[n] != s[n+1]:
cnt += 1
print(cnt - 1)
|
[
7,
0,
13,
4,
13,
41,
28,
13,
13,
4,
13,
18,
13,
39,
17,
17,
40,
13,
18,
13,
2,
13,
17,
4,
17,
4,
13,
4,
13,
13,
10,
4,
13
] |
[
[
31,
2
],
[
32,
12
],
[
32,
19
],
[
31,
32
]
] |
[
"S = input()\n\nprint(len([0 for index, c in enumerate(S[1:], 1) if c != S[index - 1]]))",
"S = input()",
"S",
"input()",
"input",
"0 for index, c in enumerate(S[1:], 1) if c != S[index - 1]",
"for index, c in enumerate(S[1:], 1) if c != S[index - 1]",
"index",
"c",
"enumerate(S[1:], 1)",
"enumerate",
"S[1:]",
"S",
"1:",
"1",
"1",
"c != S[index - 1]",
"c",
"S[index - 1]",
"S",
"index - 1",
"index",
"1",
"if c != S[index - 1]",
"0",
"print(len([0 for index, c in enumerate(S[1:], 1) if c != S[index - 1]]))",
"print",
"len([0 for index, c in enumerate(S[1:], 1) if c != S[index - 1]])",
"len",
"[0 for index, c in enumerate(S[1:], 1) if c != S[index - 1]]",
"S = input()",
"input()",
"S"
] |
S = input()
print(len([0 for index, c in enumerate(S[1:], 1) if c != S[index - 1]]))
|
[
7,
15,
13,
12,
13,
12,
13,
4,
18,
13,
13,
2,
17,
17,
0,
13,
2,
4,
13,
4,
13,
39,
17,
0,
13,
39,
0,
13,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
4,
18,
13,
13,
13,
0,
13,
13,
4,
13,
2,
4,
13,
13,
17,
10,
12,
13,
10,
39,
13,
10,
12,
13,
10,
18,
13,
10,
13,
13,
10,
2,
13
] |
[
[
72,
15
],
[
64,
20
],
[
60,
24
],
[
66,
27
],
[
73,
29
],
[
33,
32
],
[
73,
34
],
[
32,
39
],
[
67,
40
],
[
70,
40
],
[
61,
43
],
[
67,
45
],
[
70,
45
],
[
69,
47
],
[
32,
48
],
[
61,
54
],
[
60,
61
],
[
66,
67
],
[
32,
69
],
[
69,
70
],
[
72,
73
]
] |
[
"import sys\ndef input(): return sys.stdin.readline().strip()\ndef mapint(): return map(int, input().split())\nsys.setrecursionlimit(10**9)\n\nS = list(input())+['END']\nlis = []\nnow = S[0]\nfor s in S[1:]:\n if s!=now:\n lis.append(now)\n now = s\n\nprint(len(lis)-1)",
"import sys",
"sys",
"def input(): return sys.stdin.readline().strip()",
"input",
"def mapint(): return map(int, input().split())",
"mapint",
"sys.setrecursionlimit(10**9)",
"sys.setrecursionlimit",
"sys",
"setrecursionlimit",
"10**9",
"10",
"9",
"S = list(input())+['END']",
"S",
"list(input())+['END']",
"list(input())",
"list",
"input()",
"input",
"['END']",
"'END'",
"lis = []",
"lis",
"[]",
"now = S[0]",
"now",
"S[0]",
"S",
"0",
"for s in S[1:]:\n if s!=now:\n lis.append(now)\n now = s",
"s",
"S[1:]",
"S",
"1:",
"1",
"if s!=now:\n lis.append(now)\n now = s",
"s!=now",
"s",
"now",
"lis.append(now)",
"lis.append",
"lis",
"append",
"now",
"now = s",
"now",
"s",
"print(len(lis)-1)",
"print",
"len(lis)-1",
"len(lis)",
"len",
"lis",
"1",
"def mapint(): return map(int, input().split())",
"def mapint(): return map(int, input().split())",
"mapint",
"lis = []",
"[]",
"lis",
"def input(): return sys.stdin.readline().strip()",
"def input(): return sys.stdin.readline().strip()",
"input",
"now = S[0]",
"S[0]",
"now",
"now = s",
"s",
"now",
"S = list(input())+['END']",
"list(input())+['END']",
"S"
] |
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
S = list(input())+['END']
lis = []
now = S[0]
for s in S[1:]:
if s!=now:
lis.append(now)
now = s
print(len(lis)-1)
|
[
7,
15,
0,
13,
4,
13,
0,
13,
4,
13,
4,
13,
13,
4,
13,
2,
4,
13,
13,
17,
10,
4,
13,
10,
4,
13
] |
[
[
21,
3
],
[
24,
7
],
[
22,
12
],
[
25,
18
],
[
21,
22
],
[
24,
25
]
] |
[
"from itertools import groupby\nN=input()\nS=list(groupby(N))\nprint(len(S)-1)",
"from itertools import groupby",
"N=input()",
"N",
"input()",
"input",
"S=list(groupby(N))",
"S",
"list(groupby(N))",
"list",
"groupby(N)",
"groupby",
"N",
"print(len(S)-1)",
"print",
"len(S)-1",
"len(S)",
"len",
"S",
"1",
"N=input()",
"input()",
"N",
"S=list(groupby(N))",
"list(groupby(N))",
"S"
] |
from itertools import groupby
N=input()
S=list(groupby(N))
print(len(S)-1)
|
[
7,
0,
13,
4,
13,
0,
13,
17,
0,
13,
18,
13,
17,
28,
13,
18,
13,
39,
17,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13
] |
[
[
42,
2
],
[
33,
6
],
[
45,
9
],
[
43,
11
],
[
15,
14
],
[
43,
16
],
[
14,
21
],
[
46,
22
],
[
40,
22
],
[
36,
24
],
[
39,
27
],
[
14,
28
],
[
37,
31
],
[
34,
31
],
[
33,
34
],
[
36,
37
],
[
14,
39
],
[
39,
40
],
[
42,
43
],
[
45,
46
]
] |
[
"S = input()\nchange = 0\nflag = S[0]\nfor i in S[1:]:\n if i != flag:\n change +=1\n flag = i\nprint(change)",
"S = input()",
"S",
"input()",
"input",
"change = 0",
"change",
"0",
"flag = S[0]",
"flag",
"S[0]",
"S",
"0",
"for i in S[1:]:\n if i != flag:\n change +=1\n flag = i",
"i",
"S[1:]",
"S",
"1:",
"1",
"if i != flag:\n change +=1\n flag = i",
"i != flag",
"i",
"flag",
"change +=1",
"change",
"1",
"flag = i",
"flag",
"i",
"print(change)",
"print",
"change",
"change = 0",
"0",
"change",
"change +=1",
"1",
"change",
"flag = i",
"i",
"flag",
"S = input()",
"input()",
"S",
"flag = S[0]",
"S[0]",
"flag"
] |
S = input()
change = 0
flag = S[0]
for i in S[1:]:
if i != flag:
change +=1
flag = i
print(change)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
18,
13,
39,
17,
14,
2,
13,
13,
9,
0,
13,
13,
0,
13,
17,
4,
13,
13,
10,
17,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
18,
13
] |
[
[
43,
2
],
[
46,
6
],
[
44,
8
],
[
37,
11
],
[
15,
14
],
[
44,
16
],
[
47,
21
],
[
41,
21
],
[
14,
22
],
[
40,
25
],
[
14,
26
],
[
34,
28
],
[
35,
32
],
[
38,
32
],
[
34,
35
],
[
37,
38
],
[
14,
40
],
[
40,
41
],
[
43,
44
],
[
46,
47
]
] |
[
"S = input()\npres = S[0]\nans = 0\nfor s in S[1:]:\n if pres == s:\n continue\n else:\n pres = s\n ans += 1\nprint(ans)",
"S = input()",
"S",
"input()",
"input",
"pres = S[0]",
"pres",
"S[0]",
"S",
"0",
"ans = 0",
"ans",
"0",
"for s in S[1:]:\n if pres == s:\n continue\n else:\n pres = s\n ans += 1",
"s",
"S[1:]",
"S",
"1:",
"1",
"if pres == s:\n continue\n else:\n pres = s\n ans += 1",
"pres == s",
"pres",
"s",
"continue",
"pres = s",
"pres",
"s",
"ans += 1",
"ans",
"1",
"print(ans)",
"print",
"ans",
"ans += 1",
"1",
"ans",
"ans = 0",
"0",
"ans",
"pres = s",
"s",
"pres",
"S = input()",
"input()",
"S",
"pres = S[0]",
"S[0]",
"pres"
] |
S = input()
pres = S[0]
ans = 0
for s in S[1:]:
if pres == s:
continue
else:
pres = s
ans += 1
print(ans)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
4,
13,
10,
17,
13,
10,
13,
13,
10,
18,
13
] |
[
[
33,
2
],
[
42,
6
],
[
34,
8
],
[
36,
11
],
[
15,
14
],
[
34,
14
],
[
14,
18
],
[
43,
19
],
[
40,
19
],
[
30,
21
],
[
39,
24
],
[
14,
25
],
[
31,
28
],
[
37,
28
],
[
30,
31
],
[
33,
34
],
[
36,
37
],
[
14,
39
],
[
39,
40
],
[
42,
43
]
] |
[
"S = input()\n\ncolor = S[0]\n\ncnt = 0\n\nfor c in S:\n if c != color:\n cnt += 1\n color = c\n\nprint(cnt)",
"S = input()",
"S",
"input()",
"input",
"color = S[0]",
"color",
"S[0]",
"S",
"0",
"cnt = 0",
"cnt",
"0",
"for c in S:\n if c != color:\n cnt += 1\n color = c",
"c",
"S",
"if c != color:\n cnt += 1\n color = c",
"c != color",
"c",
"color",
"cnt += 1",
"cnt",
"1",
"color = c",
"color",
"c",
"print(cnt)",
"print",
"cnt",
"cnt += 1",
"1",
"cnt",
"S = input()",
"input()",
"S",
"cnt = 0",
"0",
"cnt",
"color = c",
"c",
"color",
"color = S[0]",
"S[0]",
"color"
] |
S = input()
color = S[0]
cnt = 0
for c in S:
if c != color:
cnt += 1
color = c
print(cnt)
|
[
7,
0,
13,
4,
13,
0,
13,
18,
13,
17,
0,
13,
17,
28,
13,
13,
14,
40,
13,
13,
0,
13,
17,
0,
13,
13,
4,
13,
13,
10,
17,
13,
10,
13,
13,
10,
4,
13,
10,
17,
13,
10,
18,
13
] |
[
[
36,
2
],
[
42,
6
],
[
37,
8
],
[
39,
11
],
[
15,
14
],
[
37,
14
],
[
43,
18
],
[
34,
18
],
[
14,
19
],
[
30,
21
],
[
33,
24
],
[
14,
25
],
[
31,
28
],
[
40,
28
],
[
30,
31
],
[
14,
33
],
[
33,
34
],
[
36,
37
],
[
39,
40
],
[
42,
43
]
] |
[
"S = input()\nprev = S[0]\ncnt = 0\nfor s in S:\n if prev != s:\n cnt += 1\n prev = s\nprint(cnt)",
"S = input()",
"S",
"input()",
"input",
"prev = S[0]",
"prev",
"S[0]",
"S",
"0",
"cnt = 0",
"cnt",
"0",
"for s in S:\n if prev != s:\n cnt += 1\n prev = s",
"s",
"S",
"if prev != s:\n cnt += 1\n ",
"prev != s",
"prev",
"s",
"cnt += 1",
"cnt",
"1",
"prev = s",
"prev",
"s",
"print(cnt)",
"print",
"cnt",
"cnt += 1",
"1",
"cnt",
"prev = s",
"s",
"prev",
"S = input()",
"input()",
"S",
"cnt = 0",
"0",
"cnt",
"prev = S[0]",
"S[0]",
"prev"
] |
S = input()
prev = S[0]
cnt = 0
for s in S:
if prev != s:
cnt += 1
prev = s
print(cnt)
|
[
7,
0,
13,
4,
13,
4,
13,
0,
13,
4,
13,
13,
0,
13,
17,
28,
13,
4,
13,
17,
2,
4,
13,
13,
17,
14,
40,
18,
13,
13,
18,
13,
2,
13,
17,
0,
13,
2,
13,
17,
4,
13,
13,
10,
4,
13,
10,
4,
13,
10,
2,
13,
10,
17,
13
] |
[
[
44,
2
],
[
47,
8
],
[
45,
11
],
[
53,
13
],
[
17,
16
],
[
48,
23
],
[
48,
28
],
[
16,
29
],
[
48,
31
],
[
16,
33
],
[
50,
36
],
[
54,
38
],
[
51,
38
],
[
51,
42
],
[
54,
42
],
[
44,
45
],
[
47,
48
],
[
50,
51
],
[
53,
54
]
] |
[
"s=str(input())\nsl=list(s)\ncount=0\nfor i in range(0,len(sl)-1):\n if sl[i]!=sl[i+1]:\n count=count+1\nprint(count)",
"s=str(input())",
"s",
"str(input())",
"str",
"input()",
"input",
"sl=list(s)",
"sl",
"list(s)",
"list",
"s",
"count=0",
"count",
"0",
"for i in range(0,len(sl)-1):\n if sl[i]!=sl[i+1]:\n count=count+1",
"i",
"range(0,len(sl)-1)",
"range",
"0",
"len(sl)-1",
"len(sl)",
"len",
"sl",
"1",
"if sl[i]!=sl[i+1]:\n count=count+1",
"sl[i]!=sl[i+1]",
"sl[i]",
"sl",
"i",
"sl[i+1]",
"sl",
"i+1",
"i",
"1",
"count=count+1",
"count",
"count+1",
"count",
"1",
"print(count)",
"print",
"count",
"s=str(input())",
"str(input())",
"s",
"sl=list(s)",
"list(s)",
"sl",
"count=count+1",
"count+1",
"count",
"count=0",
"0",
"count"
] |
s=str(input())
sl=list(s)
count=0
for i in range(0,len(sl)-1):
if sl[i]!=sl[i+1]:
count=count+1
print(count)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.