N, S = map(int,input().split())
A = list(map(int,input().split()))
operations = []
for i in range(N):
for j in range(N-i):
if A[j] > A[j+1]:
operations.append((j,j+1))
operations.append((j+1,j))
operations.append((j,j+1))
A[j], A[j+1] = A[j+1], A[j]
print(len(operations))
for i, j in operations: print(i+1, j+1)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
16 ms |
3052 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
16 ms |
3052 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
16 ms |
2796 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |