結果
| 問題 | No.397 NO MORE KADOMATSU |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-02-02 12:34:44 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 449 bytes |
| 記録 | |
| コンパイル時間 | 499 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 54,056 KB |
| 平均クエリ数 | 2.00 |
| 最終ジャッジ日時 | 2026-03-31 08:37:48 |
| 合計ジャッジ時間 | 16,862 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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