結果
問題 | No.930 数列圧縮 |
ユーザー |
|
提出日時 | 2022-04-01 09:48:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 155 ms / 2,000 ms |
コード長 | 298 bytes |
コンパイル時間 | 289 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 20,776 KB |
最終ジャッジ日時 | 2024-11-18 22:22:37 |
合計ジャッジ時間 | 5,360 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
N = int(input())A = tuple(map(int, input().split()))if A[0] > A[-1]:print("No")exit()ans = []for i in range(1, N - 1):if A[0] < A[i]:ans.append(A[i])for i in range(N - 2, 0, -1):if A[0] > A[i]:ans.append(A[i])ans.append(A[-1])print("Yes")print(*ans)