結果

問題 No.1373 Directed Operations
ユーザー Kude
提出日時 2021-02-05 21:32:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 283 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,944 KB
実行使用メモリ 91,436 KB
最終ジャッジ日時 2024-07-02 11:44:42
合計ジャッジ時間 4,308 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [(int(x), i) for i, x in enumerate(input().split())]
a.sort()
ans = [0] * (n - 1)
for i, (aj, j) in enumerate(a, 1):
    if i - aj < 0:
        print('NO')
        exit()
    ans[j] = i - aj + 1
print('YES')
print(*ans, sep='\n')
0