結果
| 問題 |
No.930 数列圧縮
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-01 21:04:30 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 761 bytes |
| コンパイル時間 | 130 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 390,516 KB |
| 最終ジャッジ日時 | 2024-10-10 14:23:05 |
| 合計ジャッジ時間 | 7,500 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 3 WA * 12 RE * 1 TLE * 1 -- * 7 |
ソースコード
N = int(input())
a = list(map(int,input().split()))
import sys
if a[0] > a[-1]:
print('No')
exit()
print('Yes')
def calc(l,flag = True):
if len(l) == 2:
print(l[0])
exit()
s = []
if flag:
now = l[0]
s.append(now)
for i in range(1,len(l)-1):
if l[i] > now:
print(l[i],end = " ")
else:
s.append(l[i])
now = l[i]
calc(s,False)
else:
now = l[-1]
s.append(now)
for i in reversed(range(1,len(l)-1)):
if l[i] < now:
print(l[i],end = " ")
else:
s.append(l[i])
now = l[i]
calc(s[::-1],True)
calc(a,True)