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())
s=input()
x=0
for i in range(0,n-1):
  if s[i]=s[i+1]:
    x+=1
print(n-x)

n=int(input())
s=list(map(int,input().split()))
x=0
for i in range(0,n-1):
  if s[i]=s[i+1]:
    x+=1
print(n-x)

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

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):
N=int(input())
S=input().split()
print(len(set(S))



import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
S = [str(i) for i in readline().decode('utf8').strip()]
print(len(set(S)))




import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
S = [str(i) for i in readline().decode('utf8').strip()]
print(len(set(S)))




import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
S = [str(i) for i in readline().decode('utf8').strip()]
ans = 0
for s, t in zip(S, S[1:]):
    if s != t:
        ans += 1
print(ans + 1)


Verdicts: Runtime Error

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):
import sys
readline = sys.stdin.buffer.readline

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

ans = ""

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

print(ans)


import sys
readline = sys.stdin.buffer.readline

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

ans = ""

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

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):
n=int(input())
s=input()
s=list(s)
print(s)
T=[]
tmp=0
for i in range(len(s)):
    if s[i]!=tmp:
        T.append(s[i])
        tmp=s[i]
print(len(T))

n=int(input())
s=input()
s=list(s)
T=[]
tmp=0
for i in range(len(s)):
    if s[i]!=tmp:
        T.append(s[i])
        tmp=s[i]
print(len(T))

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())
slist = []
for i in range(n):
  slist.append(s[i])
slime = slist[0]
fslist = [slime]
for i in range(1, n):
  if slime != slist[i]:
    fslist.append(slist[i])
    slime = slist[i]
print(len(fslist)

n = int(input())
s = str(input())
slime = s[0]
count = 1
for i in range(1, n):
  if slime != s[i]:
    count += 1
    slime = s[i]
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):
N = int(input())
S = list(input())
 
i = 0
while i == N:
  if S[i] == S[i+1]:
    S.pop(i)
  else:
    i += 1
    
print(len(S))

N = int(input())
S = list(input())
 
length = 1
i = 0
while i < N-1:
  if S[i] == S[i+1]:
    i += 1
  else:
    lendth += 1
    i += 1
    
print(length)

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

i = 0
while i == N:
  if S[i] == S[i+1]:
    S.pop(i)
    continue
  else:
    i += 1

N = int(input())
S = list(map(str, input().split()))

print(S)

N = int(input())
S = list(input())
 
length = 1
i = 0
while i < N-1:
  if S[i] == S[i+1]:
    i += 1
  else:
    length += 1
    i += 1
    
print(length)

Verdicts: Wrong Answer

Runtime Error

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):
import sys

n = int(sys.stdin.readline())
S = list(sys.stdin.readline())

for i in range(1, n):
    if(S[i-1] ==S[i]):
        S[i-1]=""
S = ''.join(S)
#print(S)
print(len(S))

import sys

n = int(sys.stdin.readline())
S = list(sys.stdin.readline().rstrip())

for i in range(1, n):
    if(S[i-1] ==S[i]):
        S[i-1]=""
S = ''.join(S)
#print(S)
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 = input()

S=S +"1"
state=0
bonus_sum=0
gokei=0
bonus=0

for i in range(N):
    print("gokei",gokei)
    print("bonus", bonus)
    print("bonus_sum", bonus_sum)
    print(S[i],S[i+1])
    
    if S[i] != S[i +1 ]:
        gokei=gokei+1
        bonus_sum=bonus_sum +bonus
        bonus=0
    else:
        gokei=gokei +1
        bonus = bonus +1

        
print(gokei - bonus_sum)

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

S=S +"1"
state=0
bonus_sum=0
gokei=0
bonus=0

for i in range(N):
    
    
    
    #print(S[i],S[i+1])
    
    if S[i] != S[i +1 ]:
        gokei=gokei+1
        bonus_sum=bonus_sum +bonus
        bonus=0
    else:
        gokei=gokei +1
        bonus = bonus +1

        
print(gokei - bonus_sum)
        

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()
count = 0
for i in range(1, N + 1):
  if S[i - 1] == S[i]:
    count += 1
print(N - count)

N = int(input())
S = input()
count = 0
for i in range(1, N):
  if S[i - 1] == S[i]:
    count += 1
print(N - 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):
N = int(input())
L = list(map(int, input().split()))

res = 1
for i in range(N-1):
  if L[i+1] != L[i]:
    res += 1
    
print(res)

N = int(input())
L = input()

res = 1
for i in range(N-1):
  if L[i+1] != L[i]:
    res += 1
    
print(res)

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):
s=input()
t=''
a=1
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    a+=1
print(a)

s=input()
t=''
a=1
for i in len(s)-1:
  if s[i]!=s[i+1]:
    a+=1
print(a)

_=input()
s=input()
t=''
a=1
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    a+=1
print(a)

Verdicts: Wrong Answer

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=0
for i in range(N-1):
  if(S[i] == S[i+1]):
    ans++
ans=N-ans
print(ans)

N = int(input())
S = input()
ans=0
for i in range(N-1):
  if(S[i] == S[i+1]):
    ans+=1
ans=N-ans
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()
c=1
for i in range(1,N):
  if not(S[i]==S[i-1]):c+=1
print(c)

n=int(input())
s=input()
l=[]
for i in range(n-1):
    if i==0:l.append(s[0])
    elif s[i]!=s[i+1]:l.append(s[i])
    if i==n-2 and s[i]!=s[i+1]:l.append(s[i+1])
print(len(l))

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

Verdicts: 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().split()
ans=N
for i in range(1,len(S)):
  if S[i]==S[i-1]:
    ans-=1
print(ans)

from itertools import groupby
N=int(input())
s=input()
print(len(groupby(s)))

N=int(input())
S=input().split()
ans=N
for i in range(1,len(S)-1):
  if S[i]==S[i-1]:
    ans-=1
print(ans)

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


Verdicts: Wrong Answer

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):
import itertools
N = input()
S = input()

count = 0

gr = itertools.groupby(s)
for key, group in gr:
    # print(list(group))
    count += 1
print(count)

import itertools
N = input()
S = input()

count = 0

gr = itertools.groupby(S)
for key, group in gr:
    # print(list(group))
    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):
n=int(input())
s=input()
for i in range(n):
    if i==n-1:
        print(s[i])
        continue
    if s[i]!=s[i+1]:
        print(s[i],end='')

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

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
from itertools import accumulate
input = sys.stdin.readline
def inputs():return [int(x) for x in input().split()]
N = int(input())
S= list(input())
s = []
cnt= 1
for i in range(len(S)-1):
  if S[i]==S[i+1]:
    cnt+=1
  else:
    s.append(cnt)
    cnt=1
s.append(cnt)
print(len(s))



import sys
from itertools import accumulate
input = sys.stdin.readline
def inputs():return [int(x) for x in input().split()]
N = int(input())
S= list(input())
s = []
cnt= 1
for i in range(len(S)-2):
  if S[i]==S[i+1]:
    cnt+=1
  else:
    s.append(cnt)
    cnt=1
s.append(cnt)
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(input())

pointer1 = 0
pointer2 = 1
ans = []
ans.append(s[0])
while (pointer2 <= n-1):
  if s[pointer2] == s[pointer1]:
    pointer2 += 1
  elif s[pointer2] != s[pointer1]:
    pointer1 = pointer2
    pointer2 = pointer1 + 1 
    ans.append(s[pointer1])
    
print(''.join(ans))

n = int(input())
s = list(input())
count = 1
for i in range(1,n):
  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):
x=int(input())
s=list(input())
su=s
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        su.pop(i)
    else:
        pass
print(len(su))

n=int(input())
a=input()
s=list(a)
b=list(a)
j=0
for i in range(0,n-1):
    if s[i]==s[i+1]:
        b.pop(i-j)
        j=j+1
    else:
        pass
print(len(b))

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):
20
xxzaffeeeeddfkkkkllq

n=int(input())
d=list(input())
ans=0
for i in range(1,n):
    if d[i-1]!=d[i]:
        ans+=1
print(ans)

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

Verdicts: 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 = int(input())
count = 0
b = " "
for i in range(N):
	
	if b == S[i]:
		count = count + 1
        b = S[i]

print(count)


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

ans = 0
for i in range(N-1):
    if S[i]!=S[i+1]:
        ans = ans + 1
print(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() + "0"
ans = 0

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

print(ans+1)

n = int(input())
s = input()
ans = 1

for i in range(n-1):
  temp = s[i]
  if s[i+1] != temp:
    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()
color = ""
for i in range(len(s)):
  if color != s[i]:
    color = s[i]
    count += 1
print(count)

n = int(input())
s = input()
color = ""
count = 0
for i in range(len(s)):
  if color != s[i]:
    color = s[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):
n = int(input())
s = input().split("")

s = list(set(s))

print(len(s))

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

s = list(set(list(s)))

print(len(s))


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

new = s[0]
count = 1

for i in s:
  if new == i:
    continue;
  else:
    count += 1
    new = i
  
print(count)

Verdicts: 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):
import sys
input = sys.stdin.readline
from itertools import groupby
N = int(input())
s = input()
print(len(list(groupby(s))))

import sys
input = sys.stdin.readline
from itertools import groupby
def print_ans(input_line):
    
    print(len(list(groupby(input_line))))

if __name__ == '__main__':
    N = int(input())
    print_ans(input())

import sys
input = sys.stdin.readline
from itertools import groupby
N = int(input())
print(len(list(groupby(input()))))

import sys
input = sys.stdin.readline
from itertools import groupby
def print_ans(input_line):
    
    print(len(list(groupby(input_line))))

if __name__ == '__main__':
    N = int(input().rstrip())
    s = input().rstrip()
    print_ans(s)

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):
X=int(input())
Y = input()
res=""
a=""
for i in Y:
  if res!=i:
    res=i
    a+=i
print(a)

X=int(input())
Y = input()
r=""
a=0
for i in Y:
  if r!=i:
    r=i
    a+=1
print(a)

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
N = int(input())
S = input()
if N == 1:
    print("1")
    sys.exit()
ans = 0
for i in range(N - 1):
    print(i)
    if S[i] != S[i + 1]:
        ans += 1
        print("if_1")
    if i == N - 2:
        ans += 1
        print("if_2")

print(ans)

import sys
N = int(input())
S = input()
if N == 1:
    print("1")
    sys.exit()
ans = 0
for i in range(N - 1):
    print(i)
    if S[i] != S[i + 1]:
        ans += 1
    if i == N - 2:
        ans += 1

print(ans)

import sys
N = int(input())
S = input()
if N == 1:
    print("1")
    sys.exit()
ans = 0
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans += 1
    if i == N - 2:
        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())
s = input()
l =[s[0]]
for c in s:
  if c == l[-1]:
    l.append(c)
print(len(l))

n = int(input())
s = input()
l =[s[0]]
for c in s:
  if c != l[-1]:
    l.append(c)
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())
S=str(input())
s=list(S)
i=1
while True:
    if i > n:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1

print(len(s))


n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if n ==1:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1
    if i > n:
        break
print(len(s))

n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if i >= n:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1

print(len(s))


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):
n=int(input())
l=list(input())
now=l[0]
count=0
for i in range(1,n):
  if now!=l[i]:
    count+=1
    now=l[i]
  else:
    pass
print(count)

n=int(input())
l=list(input())
now=l[0]
count=0
for i in range(1,n):
  if now!=l[i]:
    count+=1
    now=l[i]
  else:
    pass
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):
n=int(input())
S=input()
s=list(S)
 
print(s)
def jokyolist(s):
  jokyo=[]
  
  for i in range(len(s)-1):
    if s[i]==s[i+1]:
      jokyo.append(i)
    jokyo=sorted(jokyo,reverse=True)
  return jokyo
 
def remov(s,jokyo):
  for i in range(len(jokyo)):
    s.pop(jokyo[i])
    return s
def removtimes(jokyo):
  t=len(jokyo)
  return t
 
i=0
while i<=n:
  jokyo=jokyolist(s)
  if removtimes(jokyo)==0:
    break
  s=remov(s,jokyo)
  i+=1

print(len(s))


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


def jokyolist(s):
  jokyo=[]
  
  for i in range(len(s)-1):
    if s[i]==s[i+1]:
      jokyo.append(i)
    jokyo=sorted(jokyo,reverse=TRUE)
  return jokyo

def remov(s,jokyo):
  for i in range(len(jokyo)):
    s.pop(jokyo[i])
    return s
def removtimes(jokyo):
  t=len(jokyo)
  return t


while:
  jokyo=jokyolist(s)
  if removtimes(jokyo)==0:
    break:
  s=remov(s,jokyo)

print(len(s))


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

p=[]
#print(s)
for i in range(n-1):
  if s[i]==s[i+1]:
    p.append(i)
p.sort(reverse=True)
l=len(p)

for i in range(l):
    #print(p[i])
    s.pop(p[i])

print(len(s))


Verdicts: Wrong Answer

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())
n=int(input())
s=input()
l=[]

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

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):
N=int(input())
S=str(input())

ans=N

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

print(ans)






N=int(input())
S=str(input())

ans=N

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):
N=int(input())
S=input()

ans=0
p=''
for i in range(N):
    if p != S[i]:
        result += 1
        p=S[i]
print(ans)

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

ans=0
p=''
for i in range(N):
    if p != S[i]:
        ans += 1
        p=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):
N = int(input())
S = str(input())
fusion = []
for i in range(N-1):
    if S[i+1] != S[i]:
        fusion +=(S[i])
fusion +=S[N-1]
print(fusion)
print(len(fusion))

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

print(len(fusion))

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())
i = 0
count = 0
while i < N:
    while S[i] == S[i-1]:
      i += 1
    count +=1
    i +=1
print(count)

N = int(input())
S = list(input())
i = 0
count = 0
while i < N-1:
    while S[i] == S[i+1]:
      i += 1
      if i == N-1:
        break
    if i == N-1:
      break
    count +=1
    i +=1
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):
N=int(input())
S=input()

for i in range(len(S)-2):
  while S[i]==S[i+1]:
    if S[i]==S[i+1]:
      S.remove(S[i])

print(len(S))

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

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

print(N)

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):
def T():
    N=int(input())
    S=input()
    c=''
    t=0
    for s in S:
        if s==c:
            t+=1
        c=s
    return(t)
print(N-T())

def T():
    N=int(input())
    c=''
    for s in input():
        if s==c:
            N-=1
        c=s
    return(N)
print(T())

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()

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


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

num = n
for i in range(n-1,0,-1):
    if s[i]==s[i-1]:
        s = s[:i] + s[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):
def resolve():
    n = int(input())

    targets = input()
    ans = 1

    for i in range(len(targets)-1):
        if targets[i] == targets[i+1]:
            pass
        else:
            ans += 1

    print(ans)


def resolve():
    n = int(input())

    targets = input()
    ans = 1

    for i in range(len(targets)-1):
        if targets[i] == targets[i+1]:
            pass
        else:
            ans += 1

    print(ans)
resolve()

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):
a = int(input())
s = input()
i = 0
while(i<len(s)-1):
  if s[i] == s[i+1]:
    s.pop(i)
  else:
    i+=1
print(len(s))

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

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())
from collections import OrderedDict
ll = list(OrderedDict.fromkeys(li).keys())
s = ''
for i in range(len(ll)):
  s += ll[i]
print(s)

n = int(input())
s = input()
di ={}
answer = 0
for i in s:
  if i in di:
    continue
  else:
    di[i] = 1
    answer += 1
    
print(answer)

n = int(input())
s = input()
li = []
answer = 0
temp = ''
for i in s:
    if temp == i:
        continue
    else:
        temp = i
        answer += 1
        
print(answer)
        


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())
S=str(input())
cnt=1

for i in range(len(S)):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1

print(cnt)

N=int(input())
S=str(input())
cnt=1

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

N=int(input())
S=str(input())
cnt=1

for i in range(len(S)):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)

N=int(input())
S=str(input())
cnt=1

for i in range(len(S)-1):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(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().split()

list = []
befor

for i in len(S):
  if len(list) == 0:
    list.append(S[i])
  else:
    if list[-1] == S[i]:
      continue
    else:
      list.append(S[i])
print(len(list))

N = int(input())
S = list(input())
 
list = []
 
for i in range(len(S)):
  if len(list) == 0:
    list.append(S[i])
  else:
    if list[-1] == S[i]:
      continue
    else:
      list.append(S[i])


print(len(list))

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, *D = map(int, open(0).read().split())

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        ans += D[i] * D[j]

print(ans)


from itertools import groupby

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

G = [len(tuple(v)) for k, v in groupby(S)]
print(len(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())
x = list(input())
for i in range(n-1,1,-1):
  if x[i]==x[i-1]:
    x.pop(i)
print(len(x))

n = int(input())
x = list(input())
for i in range(n,1,-1):
  if x[i]==x[i-1]:
    x.pop(i)
print(len(x))

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

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


n = int(input())
x = list(input())
count = n
for i in range(n-1):
  if x[i]==x[i+1]:
    count-=1
print(count)

Verdicts: Wrong Answer

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()

S = S + 'A'
last = S[0]
cnt = 0
for s in S[1:]:
    if last == s:
        continue
    else:
        cnt += 1
        last = s
print(cnt-1)

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

S = S + 'A'
last = S[0]
cnt = 0
for s in S[1:]:
    if last == s:
        continue
    else:
        cnt += 1
        last = s
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())
colors = list(input())
before = ""
ans = 0
for color in colors:
  if color != before:
    ans += 1
  else:
    before = color
print(ans)

N = int(input())
colors = list(input())
before = ""
ans = 0
for color in colors:
  if color != before:
    ans += 1
    before = color
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):
def main():
    n = input()
    slimes = list(input())

    print(n, slimes)
    one = 0
    count = 0
    for slime in slimes:
        if one != slime:
            count+=1
        one = slime
    print(count)
if __name__ == "__main__":
    main()


def main():
    n = input()
    slimes = list(input())

    one = 0
    count = 0
    for slime in slimes:
        if one != slime:
            count+=1
        one = slime
    print(count)
if __name__ == "__main__":
    main()


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):
while True:
    n = input()
    s = input()
    n = int(n)
    if(n==len(s)):
         break
    else:
        print("error")

d  = ''

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

d += s[len(s)-1]
print(d)


while True:
    n = input()
    s = input()
    n = int(n)
    if(n==len(s)):
         break
    else:
        print("error")

d  = ''

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

d += s[len(s)-1]
print(len(d))


Verdicts: Wrong Answer

Accepted