結果

問題 No.1373 Directed Operations
ユーザー tassei903tassei903
提出日時 2021-02-05 22:00:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 423 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 33,424 KB
最終ジャッジ日時 2023-09-15 08:09:24
合計ジャッジ時間 5,308 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,944 KB
testcase_01 AC 16 ms
7,928 KB
testcase_02 AC 196 ms
30,096 KB
testcase_03 AC 65 ms
19,892 KB
testcase_04 AC 77 ms
22,824 KB
testcase_05 AC 16 ms
7,968 KB
testcase_06 AC 400 ms
30,648 KB
testcase_07 AC 22 ms
8,940 KB
testcase_08 AC 45 ms
10,648 KB
testcase_09 AC 302 ms
30,008 KB
testcase_10 AC 185 ms
22,896 KB
testcase_11 AC 55 ms
12,324 KB
testcase_12 AC 133 ms
20,636 KB
testcase_13 AC 28 ms
9,788 KB
testcase_14 AC 423 ms
33,424 KB
testcase_15 AC 346 ms
30,280 KB
testcase_16 AC 405 ms
33,364 KB
testcase_17 AC 179 ms
25,212 KB
testcase_18 AC 96 ms
18,028 KB
testcase_19 AC 134 ms
16,724 KB
testcase_20 AC 194 ms
20,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
a = list(map(int,input().split()))
b = [(a[i],i) for i in range(N-1)]
b=sorted(b)
a = sorted(a)
d = True
z=[]
for i in range(N-1):
    #print(i-a[i]+1)
    if i-a[i]+1<0:
        d = False
        break
    z.append((b[i][1],i-a[i]+2))
z = sorted(z)
if d:
    print("YES")
    for i in range(N-1):
        print(z[i][1])
else:
    print("NO")
0