結果
問題 | No.930 数列圧縮 |
ユーザー |
![]() |
提出日時 | 2021-08-31 16:01:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 98 ms / 2,000 ms |
コード長 | 675 bytes |
コンパイル時間 | 692 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 102,848 KB |
最終ジャッジ日時 | 2024-11-25 21:47:17 |
合計ジャッジ時間 | 4,667 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
import sysdef I(): return int(sys.stdin.readline().rstrip())def MI(): return map(int,sys.stdin.readline().rstrip().split())def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))def LI2(): return list(map(int,sys.stdin.readline().rstrip()))def S(): return sys.stdin.readline().rstrip()def LS(): return list(sys.stdin.readline().rstrip().split())def LS2(): return list(sys.stdin.readline().rstrip())N = I()A = LI()if A[0] > A[-1]:print('No')exit()print('Yes')ANS0 = []ANS1 = []a0 = A[0]for i in range(1,N-1):a = A[i]if a > a0:ANS0.append(a)else:ANS1.append(a)ANS = ANS0+ANS1[::-1]+[a0]print(*ANS)