結果

問題 No.1373 Directed Operations
ユーザー gorugo30
提出日時 2021-02-05 21:33:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 284 ms / 2,000 ms
コード長 269 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 92,392 KB
最終ジャッジ日時 2024-07-02 11:45:26
合計ジャッジ時間 4,444 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
S = [(A[i], i) for i in range(N - 1)]
S.sort()
X = [-1] * (N - 1)
for i in range(1, N):
    a, x = S[i - 1]
    if i - a < 0:
        print("NO")
        exit()
    X[x] = i - a + 1
print("YES")
print(*X, sep = "\n")
0