BOJ - 1377 - 버블 소트

Updated:


def solution():

    N = int(input())
    a = []
    for i in range(N):
        a.append((int(input()), i))

    ret = sorted(a)
    answer = 0

    for i in range(N):
        answer = max((ret[i][1] - a[i][1]), answer)

    print(answer + 1)

solution()

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

Categories:

Updated:

Leave a comment