結果

問題 No.1373 Directed Operations
ユーザー ああいいああいい
提出日時 2022-01-29 14:44:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 334 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 1,510 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 93,996 KB
最終ジャッジ日時 2023-08-30 12:57:43
合計ジャッジ時間 7,389 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,208 KB
testcase_01 AC 73 ms
71,508 KB
testcase_02 AC 131 ms
92,476 KB
testcase_03 AC 112 ms
92,828 KB
testcase_04 AC 114 ms
93,880 KB
testcase_05 AC 72 ms
71,176 KB
testcase_06 AC 329 ms
93,996 KB
testcase_07 AC 92 ms
76,908 KB
testcase_08 AC 109 ms
77,784 KB
testcase_09 AC 306 ms
93,924 KB
testcase_10 AC 270 ms
91,560 KB
testcase_11 AC 120 ms
78,672 KB
testcase_12 AC 270 ms
90,916 KB
testcase_13 AC 97 ms
77,180 KB
testcase_14 AC 334 ms
93,932 KB
testcase_15 AC 296 ms
91,340 KB
testcase_16 AC 334 ms
93,860 KB
testcase_17 AC 168 ms
88,684 KB
testcase_18 AC 110 ms
84,312 KB
testcase_19 AC 178 ms
82,560 KB
testcase_20 AC 216 ms
85,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N = int(input())
a = list(map(int,input().split()))
l = [(a[i],i) for i in range(N-1)]
ans = [0] * (N-1)
l.sort()


for j in range(N-1):
    if l[j][0] > j+1:
        print('NO')
        exit()
    else:
        ans[l[j][1]] = j+2-l[j][0]
print('YES')
for i in ans:
    print(i)
0