結果

問題 No.1373 Directed Operations
ユーザー 👑 rin204rin204
提出日時 2022-01-18 05:52:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 338 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 98,356 KB
最終ジャッジ日時 2023-08-15 07:23:45
合計ジャッジ時間 6,922 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,468 KB
testcase_01 AC 72 ms
71,204 KB
testcase_02 AC 137 ms
97,108 KB
testcase_03 AC 112 ms
97,108 KB
testcase_04 AC 117 ms
98,228 KB
testcase_05 AC 72 ms
70,960 KB
testcase_06 AC 328 ms
98,356 KB
testcase_07 AC 87 ms
76,704 KB
testcase_08 AC 104 ms
77,536 KB
testcase_09 AC 312 ms
98,316 KB
testcase_10 AC 273 ms
95,276 KB
testcase_11 AC 120 ms
78,792 KB
testcase_12 AC 269 ms
95,264 KB
testcase_13 AC 96 ms
76,780 KB
testcase_14 AC 337 ms
98,172 KB
testcase_15 AC 301 ms
95,376 KB
testcase_16 AC 338 ms
98,208 KB
testcase_17 AC 168 ms
92,340 KB
testcase_18 AC 107 ms
87,852 KB
testcase_19 AC 175 ms
84,124 KB
testcase_20 AC 217 ms
87,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
A = [(a, i) for i, a in enumerate(A)]
A.sort()
ans = [-1] * (n - 1)
for j, (a, i) in enumerate(A, 1):
    if a > j:
        print("NO")
        exit()
    ans[i] = (j + 1 - a)
print("YES")
print(*ans, sep="\n")
0