쉬운 문제
이지만.. 조금 헤멤... 댕청..
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 |
댓글