Submission #3027486


Source Code Expand

def a_colorful_slimes_2(N, A):
    ans = 0
    used_color = set(A)
    for k in range(1, N - 1):
        if A[k - 1] == A[k]:
            ans += 1
            for num in range(1, 100001):
                if num not in used_color:
                    A[k] = num
                    used_color.add(num)
                    break
    return ans

N = int(input())
A = [int(i) for i in input().split()]
print(a_colorful_slimes_2(N, A))

Submission Info

Submission Time
Task A - Colorful Slimes 2
User kenseiQ
Language Python (3.4.3)
Score 0
Code Size 445 Byte
Status WA
Exec Time 19 ms
Memory 3188 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 4
AC × 11
WA × 2
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All example_0, example_1, example_2, example_3, handmade_0, handmade_1, rand_0, rand_1, smallcolor_0, smallcolor_1, smallcolor_2, smallcolor_3, smallcolor_4
Case Name Status Exec Time Memory
example_0 AC 17 ms 2940 KB
example_1 AC 17 ms 3060 KB
example_2 AC 19 ms 3188 KB
example_3 AC 17 ms 3060 KB
handmade_0 WA 17 ms 3060 KB
handmade_1 AC 17 ms 2940 KB
rand_0 AC 17 ms 2940 KB
rand_1 AC 17 ms 3060 KB
smallcolor_0 AC 17 ms 2940 KB
smallcolor_1 AC 17 ms 3060 KB
smallcolor_2 AC 17 ms 3060 KB
smallcolor_3 WA 17 ms 2940 KB
smallcolor_4 AC 17 ms 3060 KB