• 个人简介

    a=list(map(int,input().split())) n=len(a) left=0 right=n-1 keven=int(input()) while left<=right : m=(left+right)//2 if keven==a[m]: break elif keven<a[m]: left=m+1 else : right=m-1 if

    a= int(input()) arr= list(map(int, input().split())) m = int(input()) current_pos = m path = [m] for i in range(a): for j in range(n-1, i, -1): if arr[j] < arr[j-1]: arr[j], arr[j-1] = arr[j-1], arr[j] if j == current_pos: current_pos -= 1 path.append(current_pos) elif j-1 == current_pos: current_pos += 1 path.append(current_pos) print(' '.join(map(str, arr))) print('→'.join(map(str, path)))

  • 最近活动

    This person is lazy and didn't join any contests or homework.