結果
| 問題 |
No.397 NO MORE KADOMATSU
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-02-02 12:34:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 449 bytes |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 61,176 KB |
| 平均クエリ数 | 2.00 |
| 最終ジャッジ日時 | 2024-07-16 19:23:46 |
| 合計ジャッジ時間 | 13,575 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 12 |
ソースコード
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,3)
print(len(answer))
for i,j in answer:
print(i,j)
maspy