結果

問題 No.1373 Directed Operations
ユーザー Kiri8128Kiri8128
提出日時 2021-02-05 22:39:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 227 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 98,180 KB
最終ジャッジ日時 2023-09-15 09:13:31
合計ジャッジ時間 4,872 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,400 KB
testcase_01 AC 71 ms
71,408 KB
testcase_02 AC 117 ms
94,296 KB
testcase_03 AC 109 ms
94,080 KB
testcase_04 AC 113 ms
98,088 KB
testcase_05 AC 70 ms
71,356 KB
testcase_06 AC 221 ms
98,152 KB
testcase_07 AC 81 ms
76,524 KB
testcase_08 AC 88 ms
76,520 KB
testcase_09 AC 210 ms
98,180 KB
testcase_10 AC 177 ms
93,500 KB
testcase_11 AC 96 ms
77,904 KB
testcase_12 AC 164 ms
90,552 KB
testcase_13 AC 86 ms
76,384 KB
testcase_14 AC 226 ms
97,920 KB
testcase_15 AC 190 ms
93,500 KB
testcase_16 AC 227 ms
98,000 KB
testcase_17 AC 125 ms
92,236 KB
testcase_18 AC 92 ms
83,760 KB
testcase_19 AC 122 ms
81,532 KB
testcase_20 AC 149 ms
89,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = sorted([(int(a), i) for i, a in enumerate(input().split())], key = lambda x: -x[0])
ANS = [-1] * (N - 1)
for j, (a, i) in enumerate(A):
    if N - 1 - j - a < 0:
        print("NO")
        break
    ANS[i] = str(N - j - a)
else:
    print("YES")
    print("\n".join(ANS))
0