結果

問題 No.1373 Directed Operations
ユーザー convexineqconvexineq
提出日時 2021-02-05 21:37:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 591 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 99,568 KB
最終ジャッジ日時 2023-09-15 07:25:32
合計ジャッジ時間 4,890 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,548 KB
testcase_01 AC 71 ms
71,308 KB
testcase_02 AC 122 ms
94,832 KB
testcase_03 AC 101 ms
94,044 KB
testcase_04 AC 115 ms
99,532 KB
testcase_05 AC 73 ms
71,324 KB
testcase_06 AC 224 ms
99,552 KB
testcase_07 AC 85 ms
76,952 KB
testcase_08 AC 92 ms
76,644 KB
testcase_09 AC 213 ms
99,568 KB
testcase_10 AC 172 ms
93,908 KB
testcase_11 AC 96 ms
78,616 KB
testcase_12 AC 165 ms
92,840 KB
testcase_13 AC 83 ms
76,200 KB
testcase_14 AC 236 ms
99,312 KB
testcase_15 AC 194 ms
93,976 KB
testcase_16 AC 236 ms
99,456 KB
testcase_17 AC 133 ms
93,356 KB
testcase_18 AC 103 ms
86,584 KB
testcase_19 AC 130 ms
85,040 KB
testcase_20 AC 151 ms
89,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
s = sorted(range(n-1),key = lambda i:a[i])
ans = [0]*(n-1)
for i in range(n-1):
    x = i+1-a[s[i]]
    if x < 0:
        print("NO")
        exit()
    ans[s[i]] = x+1
print("YES")
print(*ans)
0