結果
問題 | No.1373 Directed Operations |
ユーザー |
|
提出日時 | 2022-01-29 14:44:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 325 ms / 2,000 ms |
コード長 | 291 bytes |
コンパイル時間 | 346 ms |
コンパイル使用メモリ | 82,328 KB |
実行使用メモリ | 93,392 KB |
最終ジャッジ日時 | 2025-01-02 02:26:40 |
合計ジャッジ時間 | 5,491 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
import sysN = int(input())a = list(map(int,input().split()))l = [(a[i],i) for i in range(N-1)]ans = [0] * (N-1)l.sort()for j in range(N-1):if l[j][0] > j+1:print('NO')exit()else:ans[l[j][1]] = j+2-l[j][0]print('YES')for i in ans:print(i)