BOJ - 17608 - 막대기

Updated:

import sys

def solution():
    N = int(input())
    Stick = []
    for _ in range(N):
        Stick.append(int(sys.stdin.readline()))

    maxLength = 0
    ret = 0
    for i in range(N):
        if maxLength < Stick[N - i - 1]:
            maxLength = Stick[N - i - 1]
            ret += 1

    print(ret)

solution()

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

Categories:

Updated:

Leave a comment