結果

問題 No.318 学学学学学
ユーザー TawaraTawara
提出日時 2015-12-11 20:59:13
言語 Python2
(2.7.18)
結果
AC  
実行時間 547 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 45,160 KB
最終ジャッジ日時 2023-09-04 17:43:06
合計ジャッジ時間 6,860 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
9,628 KB
testcase_01 AC 67 ms
12,696 KB
testcase_02 AC 84 ms
14,040 KB
testcase_03 AC 55 ms
11,516 KB
testcase_04 AC 72 ms
13,056 KB
testcase_05 AC 547 ms
45,160 KB
testcase_06 AC 362 ms
34,480 KB
testcase_07 AC 266 ms
30,396 KB
testcase_08 AC 213 ms
25,072 KB
testcase_09 AC 177 ms
22,616 KB
testcase_10 AC 143 ms
19,860 KB
testcase_11 AC 540 ms
45,064 KB
testcase_12 AC 343 ms
34,404 KB
testcase_13 AC 262 ms
30,312 KB
testcase_14 AC 213 ms
24,968 KB
testcase_15 AC 178 ms
22,680 KB
testcase_16 AC 144 ms
19,860 KB
testcase_17 AC 221 ms
30,564 KB
testcase_18 AC 228 ms
30,848 KB
testcase_19 AC 214 ms
30,588 KB
testcase_20 AC 140 ms
18,212 KB
testcase_21 AC 12 ms
6,032 KB
testcase_22 AC 12 ms
6,020 KB
testcase_23 AC 11 ms
6,016 KB
testcase_24 AC 11 ms
5,976 KB
testcase_25 AC 12 ms
5,940 KB
testcase_26 AC 11 ms
6,008 KB
testcase_27 AC 11 ms
6,088 KB
testcase_28 AC 11 ms
6,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=input();a=map(int,raw_input().split())
b=[0]*N;n=range(1,N+1);d={}
for i,v in enumerate(a):
	if v in d:d[v][1]=i
	else:d[v]=[i,i]
for k,(l,r)in sorted(d.items())[::-1]:
	while l<=r:
		if b[l]==0:b[l]=k
		n[l],l=r,n[l]
	n[r]=l
print " ".join(map(str,b))
0