結果
問題 | No.930 数列圧縮 |
ユーザー |
|
提出日時 | 2022-05-07 22:52:21 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 295 bytes |
コンパイル時間 | 201 ms |
コンパイル使用メモリ | 82,388 KB |
実行使用メモリ | 103,436 KB |
最終ジャッジ日時 | 2024-07-07 04:54:37 |
合計ジャッジ時間 | 4,214 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
n = int(input())A = list(map(int,input().split()))start = A[0]l = []rest = []for a in A[1:]:while rest and rest[-1] < a:l.append(rest.pop())if start < a:l.append(a)else:rest.append(a)if rest:print("No")else:print("Yes")print(*l)