結果

問題 No.1373 Directed Operations
ユーザー titiatitia
提出日時 2021-02-05 21:40:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 33,552 KB
最終ジャッジ日時 2023-09-15 07:28:21
合計ジャッジ時間 3,963 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,916 KB
testcase_01 AC 15 ms
8,288 KB
testcase_02 AC 123 ms
30,660 KB
testcase_03 AC 62 ms
19,948 KB
testcase_04 AC 74 ms
23,100 KB
testcase_05 AC 16 ms
7,836 KB
testcase_06 AC 207 ms
30,536 KB
testcase_07 AC 18 ms
8,784 KB
testcase_08 AC 32 ms
10,584 KB
testcase_09 AC 185 ms
23,580 KB
testcase_10 AC 130 ms
21,104 KB
testcase_11 AC 41 ms
11,512 KB
testcase_12 AC 112 ms
20,916 KB
testcase_13 AC 26 ms
9,828 KB
testcase_14 AC 244 ms
33,552 KB
testcase_15 AC 215 ms
30,332 KB
testcase_16 AC 242 ms
33,396 KB
testcase_17 AC 113 ms
25,420 KB
testcase_18 AC 66 ms
18,268 KB
testcase_19 AC 87 ms
16,920 KB
testcase_20 AC 122 ms
20,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
AX=[(x,i) for i,x in enumerate(A)]
AX.sort()

ANS=[-1]*(N-1)

for i in range(N-1):
    x,j=AX[i]
    ANS[j]=i+2-x
    if ANS[j]<1:
        print("NO")
        sys.exit()

print("YES")
print("\n".join(map(str,ANS)))

0