結果

問題 No.930 数列圧縮
ユーザー convexineqconvexineq
提出日時 2021-04-11 20:51:57
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 294 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 98,592 KB
最終ジャッジ日時 2023-09-09 22:43:32
合計ジャッジ時間 14,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
78,380 KB
testcase_01 AC 69 ms
71,216 KB
testcase_02 AC 75 ms
71,088 KB
testcase_03 AC 72 ms
71,420 KB
testcase_04 AC 73 ms
71,308 KB
testcase_05 AC 80 ms
76,660 KB
testcase_06 AC 73 ms
71,072 KB
testcase_07 AC 89 ms
76,728 KB
testcase_08 AC 240 ms
91,280 KB
testcase_09 TLE -
testcase_10 AC 1,243 ms
91,836 KB
testcase_11 AC 843 ms
91,464 KB
testcase_12 AC 1,027 ms
95,444 KB
testcase_13 AC 992 ms
85,712 KB
testcase_14 AC 980 ms
86,104 KB
testcase_15 AC 115 ms
98,592 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
res = []
for i in range(1,n):
    if a[0]==i:
        res += a[1:]
        break
    elif a[-1]==i:
        break
    else:
        a.pop(a.index(i))
        res.append(i)

if len(res) < n-1:
    print("No")
else:
    print("Yes")
    print(*res)
0