BOJ - 14659 - 한조서열정리하고옴ㅋㅋ

Updated:

import sys

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

    ret = 0
    for i in range(N):
        top = arr[i]
        cnt = 0

        for j in range(i+1, N):
            if arr[j] > top:
                break
            else:
                cnt += 1
        ret = max(ret, cnt)
        
    print(ret)

solution()

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

Categories:

Updated:

Leave a comment