top of page

소스 코드 제출

공개·회원 63명

20260113

# import sys

# sys.setrecursionlimit(10**6)

#

#

# def bs(s, e, k):

# global a, n

# if s == e:

# return s+1

# mid = int((s + e) / 2)

# if a[mid] >= k:

# return bs(s, mid, k)

# else:

# return bs(mid+1, e, k)

#

#

# n, m = map(int, input().split())

# a = list(map(int, input().split()))

# if a[-1] < m:

# print(n+1)

# else:

# print(bs(0, n-1, m))


a = [1000]

cnt = 0

n = int(input())

b = list(map(int, input().split()))

for i in range(n):

a.append(b[i])


for i in range(n-1):

check = 0

for j in range(n-i):

if a[j] > a[j + 1]:

temp = a[j]

a[j] = a[j + 1]

a[j + 1] = temp

check = 1

cnt += 1

print(check)

if check == 0:

break


print(cnt)

4회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page