結果

問題 No.1373 Directed Operations
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-02-12 12:19:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 386 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 98,456 KB
最終ジャッジ日時 2023-09-26 11:56:21
合計ジャッジ時間 8,191 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,340 KB
testcase_01 AC 75 ms
71,132 KB
testcase_02 AC 140 ms
98,404 KB
testcase_03 AC 124 ms
98,456 KB
testcase_04 AC 120 ms
98,024 KB
testcase_05 AC 74 ms
71,484 KB
testcase_06 AC 362 ms
98,132 KB
testcase_07 AC 90 ms
77,000 KB
testcase_08 AC 110 ms
78,520 KB
testcase_09 AC 335 ms
98,212 KB
testcase_10 AC 297 ms
95,960 KB
testcase_11 AC 123 ms
79,848 KB
testcase_12 AC 285 ms
95,660 KB
testcase_13 AC 93 ms
76,172 KB
testcase_14 AC 370 ms
98,060 KB
testcase_15 AC 342 ms
96,200 KB
testcase_16 AC 386 ms
97,944 KB
testcase_17 AC 176 ms
92,968 KB
testcase_18 AC 113 ms
87,424 KB
testcase_19 AC 181 ms
84,828 KB
testcase_20 AC 233 ms
88,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0