結果

問題 No.1373 Directed Operations
ユーザー pluto77pluto77
提出日時 2021-03-20 11:48:29
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 27,672 KB
最終ジャッジ日時 2023-08-13 04:08:50
合計ジャッジ時間 4,150 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,936 KB
testcase_01 AC 16 ms
8,056 KB
testcase_02 AC 146 ms
24,676 KB
testcase_03 AC 62 ms
19,884 KB
testcase_04 AC 75 ms
22,784 KB
testcase_05 AC 16 ms
7,784 KB
testcase_06 AC 233 ms
25,296 KB
testcase_07 AC 20 ms
8,644 KB
testcase_08 AC 34 ms
10,376 KB
testcase_09 AC 191 ms
23,664 KB
testcase_10 AC 132 ms
21,388 KB
testcase_11 AC 43 ms
11,608 KB
testcase_12 AC 113 ms
20,776 KB
testcase_13 AC 25 ms
9,756 KB
testcase_14 AC 267 ms
27,672 KB
testcase_15 AC 218 ms
25,236 KB
testcase_16 AC 271 ms
27,592 KB
testcase_17 AC 125 ms
21,004 KB
testcase_18 AC 71 ms
15,540 KB
testcase_19 AC 89 ms
15,120 KB
testcase_20 AC 128 ms
17,260 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