Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # by: senb1 aka amigo
- n = int(input())
- a = list(map(int, input().split()))
- m = 0
- ops = []
- for i in range(n):
- for j in range(1, n):
- if a[j-1] > a[j]:
- a[j] += a[j-1]
- ops.append((j-1, j))
- m += 1
- print(m)
- for x, y in ops:
- print(x+1, y+1)
Advertisement
Add Comment
Please, Sign In to add comment