結果

問題 No.1373 Directed Operations
ユーザー hir355hir355
提出日時 2021-02-05 21:32:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 474 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 98,260 KB
最終ジャッジ日時 2023-09-15 07:17:27
合計ジャッジ時間 6,589 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,204 KB
testcase_01 AC 70 ms
71,132 KB
testcase_02 AC 144 ms
98,076 KB
testcase_03 AC 115 ms
98,260 KB
testcase_04 AC 115 ms
97,892 KB
testcase_05 AC 68 ms
71,196 KB
testcase_06 AC 449 ms
97,004 KB
testcase_07 AC 89 ms
76,680 KB
testcase_08 AC 113 ms
78,584 KB
testcase_09 AC 335 ms
96,740 KB
testcase_10 AC 293 ms
95,468 KB
testcase_11 AC 118 ms
79,732 KB
testcase_12 AC 291 ms
95,352 KB
testcase_13 AC 93 ms
76,176 KB
testcase_14 AC 473 ms
96,944 KB
testcase_15 AC 416 ms
95,604 KB
testcase_16 AC 474 ms
96,956 KB
testcase_17 AC 186 ms
93,856 KB
testcase_18 AC 117 ms
88,088 KB
testcase_19 AC 223 ms
85,128 KB
testcase_20 AC 277 ms
88,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
n -= 1
a = list(map(int, input().split()))
for i in range(n):
    a[i] = [a[i], i, 0]
a.sort()
for i in range(n):
    if a[i][0] > i + 1:
        print('NO')
        break
else:
    print('YES')
    for i in range(n):
        a[i][2] = i + 2 - a[i][0]
    a.sort(key=lambda x:x[1])
    for row in a:
        print(row[2])
0