Please read the new rule regarding the restriction on the use of AI tools. ×

Tihon-Reshetin's blog

By Tihon-Reshetin, history, 8 months ago, In Russian

a = list(map(int, input().split())) l, r = 0, len(a) — 1 while(r — l >= 1): if(a[l] > a[l + 1]): a[l + 1], a[l] = a[l], a[l + 1] if(a[r] > a[r — 1]): a[r — 1], a[r] = a[r], a[r — 1] l += 1 r -= 1 print(max(a[l], a[r]))

  • Vote: I like it
  • -18
  • Vote: I do not like it