結果

問題 No.1373 Directed Operations
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-02-05 21:58:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 1,392 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 93,408 KB
最終ジャッジ日時 2023-09-15 08:08:21
合計ジャッジ時間 7,049 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 70 ms
71,460 KB
testcase_02 AC 129 ms
92,096 KB
testcase_03 AC 108 ms
92,100 KB
testcase_04 AC 108 ms
93,116 KB
testcase_05 AC 73 ms
71,092 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 304 ms
93,408 KB
testcase_10 AC 266 ms
91,004 KB
testcase_11 AC 119 ms
78,448 KB
testcase_12 AC 260 ms
90,864 KB
testcase_13 AC 96 ms
76,920 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a2 = [(a[i], i) for i in range(n - 1)]
a2.sort(reverse=True)
v = [0] * n
v[0] = 1
ans = [0] * (n - 1)
for i in range(n - 1):
    if a[a2[i][1]] + i < n:
        ans[a2[i][1]] = i + 1
    else:
        exit(print("NO"))
print("YES")
print(*ans, sep="\n")
0