結果

問題 No.930 数列圧縮
ユーザー chocoruskchocorusk
提出日時 2019-03-30 06:19:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,648 KB
最終ジャッジ日時 2024-04-25 06:52:10
合計ジャッジ時間 4,566 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 28 ms
10,624 KB
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 27 ms
10,624 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 28 ms
10,880 KB
testcase_06 AC 26 ms
10,880 KB
testcase_07 AC 33 ms
11,136 KB
testcase_08 AC 118 ms
17,116 KB
testcase_09 AC 144 ms
18,672 KB
testcase_10 AC 123 ms
16,980 KB
testcase_11 AC 132 ms
17,744 KB
testcase_12 AC 139 ms
18,808 KB
testcase_13 AC 41 ms
15,692 KB
testcase_14 AC 46 ms
16,948 KB
testcase_15 AC 158 ms
20,644 KB
testcase_16 AC 160 ms
20,648 KB
testcase_17 AC 170 ms
20,644 KB
testcase_18 AC 167 ms
20,392 KB
testcase_19 AC 173 ms
20,520 KB
testcase_20 AC 171 ms
20,648 KB
testcase_21 AC 166 ms
20,644 KB
testcase_22 AC 27 ms
10,624 KB
testcase_23 AC 163 ms
20,520 KB
testcase_24 AC 27 ms
10,752 KB
testcase_25 AC 27 ms
10,752 KB
testcase_26 AC 25 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int, input().split()))
if a[0]>a[n-1]:
    print("No")
else:
    print("Yes")
    for i in range(1, n-1):
        if a[0]<a[i]:
            print("%d " % a[i], end="")
    for i in range(n-2, 0, -1):
        if a[0]>a[i]:
            print("%d " % a[i], end="")
    print(a[n-1])
0