結果
| 問題 |
No.1373 Directed Operations
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-07 17:21:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 417 ms / 2,000 ms |
| コード長 | 290 bytes |
| コンパイル時間 | 938 ms |
| コンパイル使用メモリ | 81,664 KB |
| 実行使用メモリ | 102,388 KB |
| 最終ジャッジ日時 | 2024-10-08 23:27:19 |
| 合計ジャッジ時間 | 5,472 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
ソースコード
N=int(input())
a=list(map(int,input().split()))
a=[(i+1,j) for i,j in enumerate(a)]
a.sort(key=lambda x:x[1])
ans=[]
for j,i in enumerate(a):
if i[1]>j+1:
print("NO")
exit()
else:
ans.append((i[0],j+2-i[1]))
ans.sort()
print("YES")
for i,j in ans:
print(j)