daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. num = list(map(int, input().split()))
  3. kek = []
  4. for i in range(n):
  5.     if i % 2 == 0:
  6.         kek.append(num[i])
  7. kek.sort()
  8. for i in range(n):
  9.     if i % 2 == 1:
  10.         print(num[i], end=' ')
  11.     else:
  12.         print(kek[i // 2], end=' ')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top