結果

問題 No.318 学学学学学
ユーザー TawaraTawara
提出日時 2015-12-17 18:17:47
言語 Python2
(2.7.18)
結果
AC  
実行時間 538 ms / 2,000 ms
コード長 250 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 43,916 KB
最終ジャッジ日時 2023-09-04 18:17:08
合計ジャッジ時間 7,253 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
9,580 KB
testcase_01 AC 65 ms
12,748 KB
testcase_02 AC 78 ms
13,904 KB
testcase_03 AC 56 ms
11,352 KB
testcase_04 AC 71 ms
12,976 KB
testcase_05 AC 523 ms
43,916 KB
testcase_06 AC 344 ms
33,728 KB
testcase_07 AC 262 ms
30,432 KB
testcase_08 AC 216 ms
25,112 KB
testcase_09 AC 178 ms
22,652 KB
testcase_10 AC 143 ms
19,736 KB
testcase_11 AC 538 ms
43,888 KB
testcase_12 AC 343 ms
34,052 KB
testcase_13 AC 265 ms
30,368 KB
testcase_14 AC 210 ms
25,112 KB
testcase_15 AC 177 ms
22,716 KB
testcase_16 AC 143 ms
19,752 KB
testcase_17 AC 217 ms
28,728 KB
testcase_18 AC 223 ms
30,160 KB
testcase_19 AC 202 ms
28,808 KB
testcase_20 AC 140 ms
17,716 KB
testcase_21 AC 11 ms
6,056 KB
testcase_22 AC 11 ms
5,980 KB
testcase_23 AC 12 ms
5,964 KB
testcase_24 AC 11 ms
6,072 KB
testcase_25 AC 11 ms
5,996 KB
testcase_26 AC 12 ms
6,048 KB
testcase_27 AC 12 ms
6,004 KB
testcase_28 AC 12 ms
6,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=input();b=[0]*N;n=range(1,N+1);d={}
for i,v in enumerate(map(int,raw_input().split())):
	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