結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2020-01-19 03:12:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 509 ms / 2,000 ms |
コード長 | 504 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 43,952 KB |
最終ジャッジ日時 | 2024-06-28 18:31:14 |
合計ジャッジ時間 | 19,026 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(readline()) A = np.array(read().split(),np.int64) for i in range(1,N+N-3): left = 0 if i<=N-1 else i+1-N right = i-left+1 sub = A[left:right].copy() x = np.maximum(sub, sub[::-1]) y = np.minimum(sub, sub[::-1]) mid = (left+right)//2 A[left:mid] = y[:mid-left] A[mid:right] = x[:right-mid][::-1] print(' '.join(A.astype(str)))