본문 바로가기
Algorithm/Greedy

[백준] 14720번 우유 축제

by 등촌동 꼬북이 2020. 10. 6.

쉬운 문제

 

이지만.. 조금 헤멤... 댕청.. 

N = int(input())
S = list(map(int, input().split()))
counter = 0
current = 0
for i in range(len(S)):
    if S[i] == current:
        counter += 1
        current += 1
        if current == 3:
            current = 0
print(counter)

'Algorithm > Greedy' 카테고리의 다른 글

[프로그래머스] 체육복  (0) 2020.10.09
[백준] 11047번 동전 0  (0) 2020.10.07
[백준] 10162번 전자레인지  (0) 2020.10.06
[백준] 5585번 거스름돈  (0) 2020.10.06
[백준] 2839번 설탕 배달  (0) 2020.09.29

댓글