Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. q = [0] * 12
  2. w = [0] * 12
  3. e = int(input())
  4. for r in range(e):
  5.     q[r]=int(input())
  6. for j in range(5, 2, -1):
  7.     for x in range(e):
  8.         if (q[x] < j) and (q[x + 1]==j) and (w[x + 1]==0):
  9.             q[x] = j
  10.             w[x] = 1
  11.         if (q[x] < j) and (q[x - 1]==j) and (w[x - 1]==0):
  12.             q[x] = j
  13.             w[x] = 1
  14. for i in range(e):
  15.     print(q[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement