Submission #3790642


Source Code Expand

n = int(input())
a = list(map(int, input().split()))
t = []
d = False
k = 0
for i in range(1,n):
  if a[i-1] == a[i]:
    if d:
      t[k].append(a[i])
    else:
      t.append([a[i-1], a[i]])
      d = True
  elif d:
    d = False
    k += 1
c = 0
for j in t:
  c += len(j)//2
print(c)

Submission Info

Submission Time
Task A - Colorful Slimes 2
User KYM384
Language Python (3.4.3)
Score 200
Code Size 304 Byte
Status AC
Exec Time 18 ms
Memory 3064 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 13
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 18 ms 3060 KB
example_1 AC 18 ms 3064 KB
example_2 AC 18 ms 3064 KB
example_3 AC 18 ms 3064 KB
handmade_0 AC 18 ms 3064 KB
handmade_1 AC 18 ms 3064 KB
rand_0 AC 18 ms 3064 KB
rand_1 AC 18 ms 3064 KB
smallcolor_0 AC 18 ms 3064 KB
smallcolor_1 AC 18 ms 3064 KB
smallcolor_2 AC 18 ms 3064 KB
smallcolor_3 AC 18 ms 3064 KB
smallcolor_4 AC 18 ms 3064 KB