結果
問題 | No.1373 Directed Operations |
ユーザー | aaaaaaaaaa2230 |
提出日時 | 2021-02-12 12:19:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 355 ms / 2,000 ms |
コード長 | 265 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 98,432 KB |
最終ジャッジ日時 | 2024-07-19 06:30:43 |
合計ジャッジ時間 | 5,840 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
n = int(input()) a = list(map(int,input().split())) sa = [[a[i],i] for i in range(n-1)] sa.sort() ans = [-1]*(n-1) for i in range(n-1): a,ind = sa[i] if a > i+1: print("NO") exit() ans[ind] = i-a+2 print("YES") for i in ans: print(i)