結果

問題 No.1373 Directed Operations
ユーザー nephrologistnephrologist
提出日時 2021-02-05 21:40:07
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 334 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 1,111 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 98,716 KB
最終ジャッジ日時 2023-09-15 07:28:03
合計ジャッジ時間 6,011 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,360 KB
testcase_01 AC 71 ms
71,392 KB
testcase_02 AC 129 ms
98,188 KB
testcase_03 AC 112 ms
98,272 KB
testcase_04 AC 114 ms
98,700 KB
testcase_05 AC 70 ms
71,540 KB
testcase_06 AC 321 ms
98,532 KB
testcase_07 AC 88 ms
76,560 KB
testcase_08 AC 105 ms
77,824 KB
testcase_09 AC 308 ms
98,716 KB
testcase_10 AC 273 ms
95,580 KB
testcase_11 AC 121 ms
78,972 KB
testcase_12 AC 268 ms
95,564 KB
testcase_13 AC 96 ms
77,536 KB
testcase_14 AC 334 ms
98,636 KB
testcase_15 AC 299 ms
95,896 KB
testcase_16 AC 329 ms
98,476 KB
testcase_17 AC 165 ms
93,076 KB
testcase_18 AC 110 ms
86,024 KB
testcase_19 AC 172 ms
83,916 KB
testcase_20 AC 214 ms
87,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline
n = int(input())

A = list(map(int, input().split()))


now = 2
ans = [-1] * (n - 1)
kouho = []
for (idx, a) in enumerate(A):
    kouho.append((a, idx))
kouho.sort()
for a, idx in kouho:
    ans[idx] = now - a
    if ans[idx] <= 0:
        print("NO")
        exit()
    now += 1
print("YES")
for a in ans:
    print(a)

0