2025.09.11. 실습 / Sort Algorithm
Ungbae
Selection Sort import sysread = sys.stdin.readlinen = int(read())a = list(map(int, read().split()))count = 0for k in range(n - 1, 0, -1): max_idx = 0 max_val = a[0] for i in range(1, k + 1): if a[i] >= max_val: count += 1 max_val = a[i] max_idx = i a[k], a[max_idx] = a[max_idx], a[k]print(count) Bubble Sort n = int(input())arr = list(map..