結果

問題 No.1373 Directed Operations
ユーザー pluto77pluto77
提出日時 2021-03-20 11:48:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 370 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 30,304 KB
最終ジャッジ日時 2024-04-30 22:31:46
合計ジャッジ時間 5,486 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 190 ms
27,212 KB
testcase_03 AC 87 ms
22,392 KB
testcase_04 AC 101 ms
25,576 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 313 ms
27,836 KB
testcase_07 AC 35 ms
11,264 KB
testcase_08 AC 54 ms
12,800 KB
testcase_09 AC 264 ms
26,140 KB
testcase_10 AC 193 ms
23,856 KB
testcase_11 AC 63 ms
14,208 KB
testcase_12 AC 168 ms
23,428 KB
testcase_13 AC 44 ms
12,416 KB
testcase_14 AC 364 ms
30,304 KB
testcase_15 AC 316 ms
27,772 KB
testcase_16 AC 370 ms
30,240 KB
testcase_17 AC 166 ms
23,684 KB
testcase_18 AC 101 ms
18,272 KB
testcase_19 AC 134 ms
17,480 KB
testcase_20 AC 182 ms
19,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1373
n=int(input())
a=list(map(int,input().split()))
s=[(a[i],i)for i in range(n-1)]
s.sort()
X=[-1]*(n-1)
for i in range(1,n):
 a,x=s[i-1]
 if i-a<0:
  print("NO")
  exit()
 X[x]=i-a+1
print("YES")
print(*X,sep="\n")
0