Submission #2703100


Source Code Expand

S = input()
ans = 0
if S.count('W') == 0 or S.count('B') == 0:
    print(0)
    exit()
a = S[0]
while True:
    for i, s in enumerate(S):
        if s != a: break
    S = S[i:]
    a = S[0]
    ans += 1
    if S.count('W') == 0 or S.count('B') == 0:break
print(ans)

Submission Info

Submission Time
Task C - 1D Reversi
User peace_of_junk
Language Python (3.4.3)
Score 0
Code Size 278 Byte
Status TLE
Exec Time 2104 ms
Memory 3188 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 8
TLE × 7
Set Name Test Cases
sample sample_01.txt, sample_02.txt, sample_03.txt
All alternate_01.txt, alternate_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, same_01.txt, same_02.txt, sample_01.txt, sample_02.txt, sample_03.txt, small_01.txt, small_02.txt, small_03.txt
Case Name Status Exec Time Memory
alternate_01.txt TLE 2103 ms 3188 KB
alternate_02.txt TLE 2104 ms 3188 KB
random_01.txt TLE 2104 ms 3188 KB
random_02.txt TLE 2103 ms 3188 KB
random_03.txt TLE 2104 ms 3188 KB
random_04.txt TLE 2104 ms 3188 KB
random_05.txt TLE 2104 ms 3188 KB
same_01.txt AC 17 ms 3188 KB
same_02.txt AC 17 ms 3188 KB
sample_01.txt AC 17 ms 3060 KB
sample_02.txt AC 17 ms 3060 KB
sample_03.txt AC 17 ms 2940 KB
small_01.txt AC 17 ms 3060 KB
small_02.txt AC 17 ms 2940 KB
small_03.txt AC 17 ms 3060 KB