TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N=int(input())
List=input()
print(List)
c=1
for i in range(1,N):
    if List[i-1]!=List[i]:
        c=c+1
    else:
        c=c+0
print(c)

n=int(input())
s=input()

c=1
for i in range(1,n): 
    if s[i-1]!=s[i]:
        c+=1
print(c)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
s = input()
checks = s[0]
ans = 1
for c in s:
  if c != checks:
    checks = c
    ans += 1
print(ans)

s = input()
checks = s[0]
ans = 1
for c in list(s):
  if c != checks:
    checks = c
    ans += 1
print(ans)

n =int(input())
s = input()
checks = s[0]
ans = 1
for c in list(s):
  if c != checks:
    checks = c
    ans += 1
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
li =list(input().split())
for i in range(n):
  if li[i] == li[i+1]:
    li.remove(li[i])
print(len(li))

n = int(input())
li =list(input())
for i in range(n-1):
  if li[i] == li[i+1]:
    li.remove(li[i])
print(len(li))


n = int(input())
li =list(input())
for i in range(n-1):
  if li[i] == li[i+1]:
    li.remove(li[i])
print(len(li))


n = int(input())
li =list(input().split())
for i in range(n-1):
  if li[i] == li[i+1]:
    li.remove(li[i])
print(len(li))


N = int(input())
li = list(input())
for i in range(N-1):
  if li[i] == li[i+1]:
    li[i] = "P"
p = li.count("P")
print(N-p)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = list(input())

forcuss = 0
j = 1
number = 1
print(S)

while j != N:
    if S[forcuss] == S[j]:
        j = j + 1
        continue
    elif S[forcuss] != S[j]:
        number = number + 1
        forcuss = j
        j = forcuss + 1

print(number)

N = int(input())
S = list(input())

forcuss = 0
j = 1
number = 1

while j != N:
    if S[forcuss] == S[j]:
        j = j + 1
        continue
    elif S[forcuss] != S[j]:
        number = number + 1
        forcuss = j
        j = forcuss + 1

print(number)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = str(input())
s += "A"
q = s[0]
ans = 0
for i in range(n+1):
  if(q==s[i]):
    None:
  else:
    ans += 1
    q = s[i]
print(ans)

n = int(input())
s = str(input())
s += "A"
q = s[0]
ans = 0
for i in range(n+1):
  if(q==s[i]):
    None
  else:
    ans += 1
    q = s[i]
print(ans)


Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
print('input >>')
N = input()
S = input()

ans = 1
left = S[0]
for s in S:
    if not s == left:
        ans += 1
        left = s

print('----------output----------')
print(ans)

# print('input >>')
N = input()
S = input()

ans = 1
left = S[0]
for s in S:
    if not s == left:
        ans += 1
        left = s

# print('----------output----------')
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = input()
for w in 'abcdefghijklmnopqrstuvwxyz':
  if S.find(w) != -1:
    while S.count(w) != 1:
      if S[S.find(w) + 1] == w:
        S.replace(w + w,w)
print(len(S))

N = int(input())
S = input()
for w in 'abcdefghijklmnopqrstuvwxyz':
  if S.find(w) != -1:
    while S.count(w) != 1:
   		 if S[S.find(w) + 1] == w:
    	 	 S.replace(w + w,w)
print(len(S))

N = int(input())
S = input()
ans = 1
for i in range(N):
  if i <= len(S)-2:
    if S[i] !=S[i+1]:
      ans = ans + 1
print(ans)

Verdicts: Time Limit Exceeded

Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
s = list(input())

ans = 0
for i in range(len(s)-1):
    if s[i] !== s[i+1]:
        ans += 1
    else:
        ans = ans

ans += 1

print(ans)

N = int(input())
s = list(input())
ans = 0
for i in range(len(s)-1):
    if s[i] != s[i+1]:
        ans += 1
    else:
        ans = ans
ans += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n=int(input())
s=input()
ans=1

for i in range(n-1):
  flag=s[0]
  if s[i+1]!=flag:
    ans+=flag
    flag=s[i+1]
print(flag)
    

n=int(input())
s=input()
ans=1
flag=s[0]

for i in range(n-1):
  if s[i+1]!=flag:
    ans+=1
    flag=s[i+1]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
number = int(input())
list = list(map(int, input().split()))
ls = sorted(list)
print(ls)
count = 0

for a in range(0, number - 2):
    num_a = ls[a]
    for b in range(a + 1, number - 1):
        num_b = ls[b]
        for c in  range(b + 1, number):
            num_c = ls[c]
            if num_a + num_b > num_c:
                count += 1

print(count)


import re
count = input()
string = input()
result = 1
for num_word in range(0, len(string) - 1):
    if string[num_word] != string[num_word + 1]:
        result += 1
print(result)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
# coding: utf-8
# Your code here!

n = int(input())
s = list(input())

print(s)

i = 0
while(i < len(s)-1):
    if(s[i] == s[i+1]):
        s.pop(i+1)
    else:
        i+=1
print(len(s))


# coding: utf-8
# Your code here!

n = int(input())
s = list(input())


i = 0
while(i < len(s)-1):
    if(s[i] == s[i+1]):
        s.pop(i+1)
    else:
        i+=1
print(len(s))


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = list(str(input()))

new_s = ""
temp=""

for i in range(n):
  if temp != s[i]:
    new_s += s[i]
    temp=s[i]

print(new_s)

n = int(input())
s = list(str(input()))

new_s = ""
temp=""

for i in range(n):
  if temp != s[i]:
    new_s += s[i]
    temp=s[i]

print(len(list(new_s)))

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = input()

counter = 0

for i in range(1,len(s)):
    if s[i-1] != s[i]:
        counter += 1

print(counter)

n = int(input())
s = input()

for i in range(1,len(s)):
    if s[i-1] == s[i]:
        n -= 1

print(n)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
a=input()
s = set(a)
        
        
print(len(s))


n = int(input())
a=input()
l =[]
for i in range(n-1):
    if a[i] != a[i+1]:
        
        l.append(a[i])
print(len(l)+1)


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = list(input())
new_S = ''

for s1,s2 in zip([0]+S,S):
  if s1 != s2:
    new_S += s2

print(new_S)

_,S=open(0);print(sum(1for a,b in zip("0"+S,S)if a!=b))

N,S=open(0);print(sum(1for a,b in zip("0"+S,S)if a!=b))

_,S=input(),input();print(sum(1for a,b in zip("0"+S,S)if a!=b))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = list(input())

for x in range(n-1):
    if s[x] == s[x+1]:
        s[x] = 0

print([i for i in s if i != 0])

n = int(input())
s = list(input())

for x in range(0, n-1):
    if s[x] == s[x+1]:
        s[x] = 0

l = [i for i in s if i != 0]

print(len(l))

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n=int(input())
a=input().strip()
x+=a[0]
for i in range(1,n):
  if a[i]!=a[i-1]:
    x+=a[i]
print(len(x))


n=int(input())
a=input().strip()
x=""
x+=a[0]
for i in range(1,n):
  if a[i]!=a[i-1]:
    x+=a[i]
print(len(x))


Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = input()
s += "1"
ans = 0
for i in range(n):
  if s[i] != s[i+1]:
    ans += 1

n = int(input())
s = input()
s += "1"
ans = 0
for i in range(n):
  if s[i] != s[i+1]:
    ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input()) 
s = input()

ans = set(s)
print(ans)

n = int(input()) 
s = input()

t = ""
cnt = 0
for i in s:
    if i != t:
        cnt += 1
        t = i
print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N=int(input())
S=input()
for i in range(N-1):
    if S[i]==S[i+1]:
       S= S.replace(S[i],'')
print(len(S))

N=int(input())
S=input()
ans=1
for i in range(N-1):
    if S[i]!=S[i+1]:
       ans+=1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
import sys

n = int(input())
s = input()
i = 0
ck = ''
result = ''
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		if s[i] != ck:
			print('ck = ' + ck)
			ck = s[i]
			result += ck
	elif s[i] != ck:
		print('ck = ' + ck)
		ck = s[i]
		result += ck

if s[-1:] != ck:
	result += s[-1:]

print(result)
print(len(result))

import sys

n = int(input())
s = input()
i = 0
ck = ''
result = ''
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		if s[i] != ck:
			ck = s[i]
			result += ck
	elif s[i] != ck:
		ck = s[i]
		result += ck

if s[-1:] != ck:
	result += s[-1:]

print(len(result))

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
ans = 0
pre_s = ''
for s in S:
    if s == pre_s:
        continue
    else:
        pre_s = s
        ans += 1
print(ans)

N = int(input())
S = list(input())

ans = 0
pre_s = ''
for s in S:
    if s == pre_s:
        continue
    else:
        pre_s = s
        ans += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
from itertools import groupby
N = int(input())
S = input()
G = groupby(S)
print(len(G))

from itertools import groupby
N = int(input())
S = input()
G = groupby(S)
print(len(list(G)))

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
str = input()
slim = [str[0]]
for i in range(n):
  if str[i] == slim[-1]:
  	slim.append(str[i]) 
  
print(len(slim))

n = int(input())
str = input()
slim = [str[0]]
for i in range(n):
  if str[i] != slim[-1]:
  	slim.append(str[i]) 
  
print(len(slim))

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = list(input())
counter = 0
last_char = None
for char in S:
  if char != last_char:
    counter += 0
    last_char = char

print(counter)

N = int(input())
S = list(input())
counter = 0
last_char = None
for char in S:
  if char != last_char:
    counter += 1
    last_char = char

print(counter)


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
for i in check:
  S.pop(i)


N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
reversed(check)
for i in check:
  S.pop(i)
print(len(S))

N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
reversed(check)
for i in check:
  S.pop(i)


N=int(input())
S=list(input())
check=0
for i in range(N-1):
  if S[i]==S[i+1]:
    check+=1
 
print(N-check)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
total = input()
slimes = list(input())

pre = ""
last = []

for i in slimes:
    if pre != i:
        last.append(i)
    pre = i
    print(pre)

print(len(last))


total = input()
slimes = list(input())

pre = ""
last = []

for i in slimes:
    if pre != i:
        last.append(i)
    pre = i

print(len(last))


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
import bisect

n = int(input())
l = sorted(list(map(int, input().split())))

ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += bisect.bisect_left(l, l[i]+l[j]) - (j+1)
        
print(ans)

N = int(input())
a = list(input())
count = 1
for i in range(N):
  if i>0:
    if a[i-1]==a[i]:
      pass
    elif a[i-1]!=a[i]:
      count+=1
      
print(count)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
from itertools import groupby
s = input()
print(len(list(groupby(s))))

from itertools import groupby
input()
s=input()
print(len(list(groupby(s))))

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
S = input()
k = 1
for b, a in zip(S[:-1], S[1:]):
    if b==a:
        k += 1
print(k)

_ = input()
S = input()
k = 1
for b, a in zip(S[:-1], S[1:]):
    if b==a:
        k += 1
print(k)

_ = input()
S = input()
k = 1
for b, a in zip(S[:-1], S[1:]):
    if b!=a:
        k += 1
print(k)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split()))
result = 1
for i in range(n-1):
  if A[i]!=A[i+1]:
  	result = result + 1
print(result)

n = int(input())
A = list(input())
result = 1
for i in range(n-1):
  if A[i]!=A[i+1]:
  	result = result + 1
print(result)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = list(input())

count = 0
for i in range(n-1):
    if s[i] != s[i+!]:
        count += 1

print(count+1)

n = int(input())
s = list(input())

count = 0
for i in range(n-1):
    if s[i] != s[i+1]:
        count += 1

print(count+1)

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = input()
S = input()
temp = ""
for cnt in N
	if temp != cnt:
    	temp = cnt
        lst += cnt
n = len(lst)
print("n")

N = input()
S = input()
temp = ""
for cnt in S
	if temp != cnt:
    	temp = cnt
        lst += cnt
n = len(lst)
print("n")

N = input()
S = input()
temp = ""
lst = ""
for cnt in S:
    if temp != cnt:
        temp = cnt
        lst += cnt
n = len("lst")
print("%d" % n)

N = input()
S = input()
temp = ""
lst = ""
for cnt in S:
    if temp != cnt:
        temp = cnt
        lst += cnt
print(len(lst))

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = input()

color_length = []
c = 1

for i in range(n-1):
    
    if s[i] == s[i+1]:
        c += 1
    
    else:
        color_length.append(c)
        c = 1

color_length.append(c)

print(color_length)


n = int(input())
s = input()

color_length = []
c = 1

for i in range(n-1):
    
    if s[i] == s[i+1]:
        c += 1
    
    else:
        color_length.append(c)
        c = 1

color_length.append(c)

print(len(color_length))



Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s =  [str(m) for m in list(str(input()))]
nd = list()
for i in range(n-1):
        if s[i] != s[i+1]:
            nd.append(s[i])
if s[n-2] != s[n-1]:
    nd.append(s[n-1])
print(",".join(nd).replace(",",""))

n = int(input())
s =  [str(m) for m in list(str(input()))]
nd = list()
for i in range(n-1):
        if s[i] != s[i+1]:
            nd.append(s[i])
if s[n-2] != s[n-1]:
    nd.append(s[n-1])
print(nd)

n = int(input())
s =  [str(m) for m in list(str(input()))]
nd = list()
for i in range(n-1):
        if s[i] != s[i+1]:
            nd.append(s[i])

print(len(nd)+1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = N
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = int(N)
for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        result -= 1
print(result)



A = input("")
N = A.split("\n")[0]
S = A.split("\n")[1]
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = 1
for i in range(len(S) - 1):
  if S[i] != S[i + 1]:
    result += 1
print(result)

N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = 0
for i in range(len(S) - 1):
  if S[i] != S[i + 1]:
    result += 1
print(result)



result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

N = input("スライムの数 : ")
S = input("対応する文字列 : ")
result = 0
for i in len(S) - 1:
  if S[i] != S[i + 1]:
    result += 1
print(result)

N = input("N")
S = input("S")
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

N = input("")
S = input("")
result = int(N)
for i in range(len(S) - 1):
  if S[i] == S[i + 1]:
    result -= 1
print(result)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = input()
R = []

for i in range(N-1):
  if(S[i] != S[i+1]):
    R.append(S[i])
  else:
    continue
    
if S[N-2] != S[N-1]:
	R.append(S[N-1])
print(R)

N = int(input())
S = input()
count = 1
for i in range(N-1):
  if S[i] != S[i+1]:
    count += 1
print(count)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = input()

ans = ''
seek = 0

while seek < n:
    first = seek
    while seek < n and s[seek] == s[first]:
        seek += 1
    ans += s[first]

print(ans)


n = int(input())
s = input()

ans = ''
seek = 0

while seek < n:
    first = seek
    while seek < n and s[seek] == s[first]:
        seek += 1
    ans += s[first]

print(len(ans))


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
def main(n,s):
    if n == 1:
        return 1
        
    count = 1
    for i in range(1,n):
        if s[i] != s[i-1]:
            print(s[i] + s[i-1])
            count += 1
    return count

inp = input().split("\n")
n = int(inp[0])
s = inp[1]


print(main(n,s))

def main(n,s):
    if n == 1:
        return 1
        
    count = 1
    for i in range(1,n):
        if s[i] != s[i-1]:
            count += 1
    return count

inp = input().split("\n")
n = int(inp[0])
s = inp[1]


print(main(n,s))

from sys import stdin,stdout

if __name__=="__main__":

    n=int(stdin.readline())

    s=str(input())

    l=s[0]
    cnt=1

    for i in range(1,len(s)):
        if(s[i]!=l):
            cnt+=1
            l=s[i]

    stdout.write(str(cnt)+"\n")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
# coding: utf-8
num = int(input())
colors = list(input())
count = 0

for i in range(num-2):
  if colors[i] != colors[i+1]:
    count += 1
  
print(count+1)

# coding: utf-8
num = int(input())
colors = list(input())
count = 0

for i in range(num-1):
  if colors[i] != colors[i+1]:
    count += 1
  
print(count+1)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline
n = int(rl())
s = rl()
cnt = 0
for i in range(n-1):
  if s[i] != s[i+1]:
    cnt += 1
print(cnt)
  


import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline
n = int(rl())
s = rl()
cnt = 1
for i in range(n-1):
  if s[i] != s[i+1]:
    cnt += 1
print(cnt)
  


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = input()
cnt = 0

for i in range(N-1):
	if S[i] = S[i+1]:
      	cnt += 1

ret = N - cnt

print(ret)


N = int(input())
S = input()
cnt = 0
 
for i in range(N-1):
	if S[i] == S[i+1]:
      cnt += 1
 
print(N - cnt)

N = int(input())
S = input()
cnt = 0
 
for i in range(N-1):
	if S[i] == S[i+1]:
      	cnt += 1

print(N - cnt)

N = int(input())
S = input()
cnt = 0

for i in range(N-1):
  if S[i] == S[i+1]:
    cnt += 1
    
print(N - cnt)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = input()

f = 0
for i in range(1, n):
  if (s[i] != s[i-1]):
    f += 1
    
print(f)

n = int(input())
s = input()

f = 1
for i in range(1, n):
  if (s[i] != s[i-1]):
    f += 1
    
print(f)


Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
# coding: utf-8

n = int(input())

d = input()

s = []
for i in range(n):
    if ((len(s) > 0 and d[i] != s[len(s)-1]) or (len(s) == 0)):
        s.append(d[i])
print(''.join(s))

# coding: utf-8

n = int(input())

d = input()

s = []
for i in range(n):
    if ((len(s) > 0 and d[i] != s[len(s)-1]) or (len(s) == 0)):
        s.append(d[i])
print(len(s))

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
chars = list(input())

if len(chars) == 1:
    print(1)
elif len(chars) == 0:
    print(0)

slime_num = 1
idx_0 = 0
idx_1 = 1

while idx_1 < len(chars):
    if chars[idx_0] != chars[idx_1]:
        slime_num += 1
    idx_1 += 1
    idx_0 += 1

print(slime_num)

n = int(input())

chars = list(input())

if n == 0:
    print(0)
elif n == 1:
    print(1)
else:
    slime_num = 1
    idx_0 = 0
    idx_1 = 1
    
    while idx_1 < n:
        if chars[idx_0] != chars[idx_1]:
            slime_num += 1
        idx_1 += 1
        idx_0 += 1
    
    print(slime_num)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
# -*- coding: utf-8 -*-

# Input
s = [input() for i in range(2)]

N = int(s[0])
S = list(s[1])

print(N)
print(S)

# Process
M = 0

for i in range(1,N):
    if S[i-1] == S[i]:
        M += 1

N = N - M


# Output
print(N)


# -*- coding: utf-8 -*-

# Input
s = [input() for i in range(2)]

N = int(s[0])
S = list(s[1])

# Process
M = 0

for i in range(1,N):
    if S[i-1] == S[i]:
        M += 1

N = N - M

# Output
print(N)

Verdicts: Wrong Answer

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n=int(input())
s=list(input().split())
sum=0
i=1
str=s[0]
while i<=n-1:
  if str == s[i]:
    continue
  else:
    str=s[i]
    sum+=1
print(sum)
  
  
  

n=int(input())
s=input()
sum=1
i=1
str=s[0]
while i<=n-1:
  if str == s[i]:
    i+=1
  else:
    str=s[i]
    sum+=1
    i+=1
    
print(sum)
  
  

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
N = int(input())
S = list(input())

num = 1
ans = 1
for i in S:
    if i == S[num]:
        continue
    else:
        ans += 1
print(ans)

N = int(input())
S = list(input())

ans = 1
for i in range(N):
    if i == N - 1:
        print(ans)
    elif S[i] == S[i + 1]:
        continue
    else:
        ans += 1

Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())
s = input()

b = ''
b += b + s[0]

for i in range(1, n):
  if s[i] != s[i-1]:
    b += b + s[i]

print(b)

n = int(input())
s = input()

ans = 1

for i in range(1, n):
  if s[i] != s[i-1]:
    ans += 1

print(ans)


Verdicts: Runtime Error

Accepted
Problem: There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i-th slime from the left has the color that corresponds to the i-th character of S.  Adjacent slimes with the same color will fuse into one larger slime without changing the color. If there were a slime adjacent to this group of slimes before fusion, that slime is now adjacent to the new larger slime.  Ultimately, how many slimes will be there?

Submission attempts (in order):
n = int(input())

li = list(input())

print(li)
count = 0
for i in range(len(li)-1):
    if li[i] == li[i+1]:
        count = count + 1

print(n-count)

n = int(input())

li = list(input())

count = 0
for i in range(len(li)-1):
    if li[i] == li[i+1]:
        count = count + 1

print(n-count)

Verdicts: Wrong Answer

Accepted