結果

問題 No.1373 Directed Operations
ユーザー NatsubiSogan
提出日時 2021-02-05 21:58:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,356 KB
実行使用メモリ 92,288 KB
最終ジャッジ日時 2024-07-02 12:28:09
合計ジャッジ時間 6,322 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 9 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a2 = [(a[i], i) for i in range(n - 1)]
a2.sort(reverse=True)
v = [0] * n
v[0] = 1
ans = [0] * (n - 1)
for i in range(n - 1):
    if a[a2[i][1]] + i < n:
        ans[a2[i][1]] = i + 1
    else:
        exit(print("NO"))
print("YES")
print(*ans, sep="\n")
0