結果
| 問題 |
No.397 NO MORE KADOMATSU
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-02-02 12:36:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 474 bytes |
| コンパイル時間 | 317 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 75,576 KB |
| 最終ジャッジ日時 | 2024-07-16 19:23:30 |
| 合計ジャッジ時間 | 6,900 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 17 |
ソースコード
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)
dummy = int(readline())
maspy