結果
| 問題 |
No.397 NO MORE KADOMATSU
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-02-02 12:35:46 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 565 ms / 2,000 ms |
| コード長 | 449 bytes |
| コンパイル時間 | 108 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 61,040 KB |
| 平均クエリ数 | 52.17 |
| 最終ジャッジ日時 | 2024-07-17 02:28:29 |
| 合計ジャッジ時間 | 12,753 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
import sys
readline = sys.stdin.buffer.readline
import numpy as np
N = int(readline())
A = np.fromstring(readline(), np.int64, sep=' ')
answer = []
def swap_sort(A,ind):
if ind == 1:
return
n = A[:ind].argmax()
if n == ind-1:
swap_sort(A,ind-1)
return
answer.append((n,ind-1))
A[n], A[ind-1] = A[ind-1], A[n]
swap_sort(A,ind-1)
swap_sort(A,N)
print(len(answer))
for i,j in answer:
print(i,j)
maspy