답안 #366304

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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)
# 결과 실행 시간 메모리 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 -