結果

問題 No.1373 Directed Operations
ユーザー ytftytft
提出日時 2022-03-18 10:18:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 97,684 KB
最終ジャッジ日時 2024-04-10 11:16:40
合計ジャッジ時間 5,049 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,404 KB
testcase_01 AC 37 ms
53,728 KB
testcase_02 AC 110 ms
97,628 KB
testcase_03 AC 91 ms
97,684 KB
testcase_04 AC 96 ms
97,620 KB
testcase_05 AC 37 ms
53,972 KB
testcase_06 AC 217 ms
97,472 KB
testcase_07 AC 56 ms
66,376 KB
testcase_08 AC 64 ms
69,380 KB
testcase_09 AC 197 ms
97,552 KB
testcase_10 AC 175 ms
96,704 KB
testcase_11 AC 65 ms
68,060 KB
testcase_12 AC 173 ms
96,296 KB
testcase_13 AC 55 ms
64,644 KB
testcase_14 AC 223 ms
97,192 KB
testcase_15 AC 197 ms
96,444 KB
testcase_16 AC 226 ms
97,624 KB
testcase_17 AC 111 ms
91,468 KB
testcase_18 AC 79 ms
84,952 KB
testcase_19 AC 113 ms
84,284 KB
testcase_20 AC 137 ms
88,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
temp=input().split()
A=[[int(temp[i]),i] for i in range(N-1)]
A=sorted(A,key=lambda x:x[0])
ans=[0 for i in range(N-1)]
for i in range(N-1):
	ans[A[i][1]]=i-A[i][0]+2
if min(ans)<1:
	print('NO')
else:
	print('YES')
	for i in ans:
		print(i)
0