Submission #366304

# Submission time Handle Problem Language Result Execution time Memory
366304 2021-02-13T20:38:49 Z model_code Xor Sort (eJOI20_xorsort) Python 3
0 / 100
16 ms 3052 KB
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)
# Verdict Execution time Memory Grader output
1 Runtime error 16 ms 3052 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 16 ms 3052 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 16 ms 2796 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -