結果

問題 No.1373 Directed Operations
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-02-05 21:28:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 92,776 KB
最終ジャッジ日時 2023-09-15 07:11:35
合計ジャッジ時間 5,762 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,344 KB
testcase_01 AC 70 ms
71,344 KB
testcase_02 AC 113 ms
91,868 KB
testcase_03 AC 107 ms
91,740 KB
testcase_04 AC 108 ms
92,776 KB
testcase_05 AC 69 ms
71,236 KB
testcase_06 AC 310 ms
92,504 KB
testcase_07 AC 78 ms
76,520 KB
testcase_08 AC 96 ms
77,392 KB
testcase_09 AC 307 ms
92,484 KB
testcase_10 AC 265 ms
90,208 KB
testcase_11 AC 118 ms
78,292 KB
testcase_12 AC 261 ms
90,248 KB
testcase_13 AC 92 ms
77,212 KB
testcase_14 AC 325 ms
92,412 KB
testcase_15 AC 288 ms
90,248 KB
testcase_16 AC 319 ms
92,276 KB
testcase_17 AC 152 ms
87,716 KB
testcase_18 AC 94 ms
84,832 KB
testcase_19 AC 160 ms
81,768 KB
testcase_20 AC 200 ms
84,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""

import sys
from sys import stdin

N = int(stdin.readline())
a = list(map(int,stdin.readline().split()))

b = [(a[i],i) for i in range(N-1)]
b.sort()

ans = [None] * (N-1)

for lp in range(N-1):

    ai,i = b[lp]

    if ai > lp+1:
        print ("NO")
        sys.exit()
    else:
        ans[i] = lp+2-ai

print ("YES")
print ("\n".join(map(str,ans)))
0