BOJ - 14720 - 우유 축제

Updated:

import sys

def solution():
    N = int(sys.stdin.readline())
    milk = list(map(int, sys.stdin.readline().split()))

    ret = 0
    cur = 0
    for i in range(N):
        if milk[i] == cur:
            ret += 1
            cur = (cur + 1) % 3
    print(ret)

solution()

https://www.acmicpc.net/problem/14720

Categories:

Updated:

Leave a comment