結果

問題 No.318 学学学学学
ユーザー TawaraTawara
提出日時 2015-12-17 18:00:01
言語 Python2
(2.7.18)
結果
AC  
実行時間 543 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 6,600 KB
実行使用メモリ 48,028 KB
最終ジャッジ日時 2023-09-04 18:16:26
合計ジャッジ時間 7,047 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
9,692 KB
testcase_01 AC 65 ms
12,724 KB
testcase_02 AC 76 ms
14,196 KB
testcase_03 AC 53 ms
11,732 KB
testcase_04 AC 70 ms
13,260 KB
testcase_05 AC 523 ms
47,868 KB
testcase_06 AC 335 ms
35,020 KB
testcase_07 AC 261 ms
30,912 KB
testcase_08 AC 211 ms
25,244 KB
testcase_09 AC 171 ms
22,840 KB
testcase_10 AC 142 ms
19,804 KB
testcase_11 AC 543 ms
48,028 KB
testcase_12 AC 339 ms
34,848 KB
testcase_13 AC 261 ms
30,916 KB
testcase_14 AC 209 ms
25,096 KB
testcase_15 AC 174 ms
22,736 KB
testcase_16 AC 140 ms
19,896 KB
testcase_17 AC 220 ms
34,656 KB
testcase_18 AC 224 ms
34,548 KB
testcase_19 AC 205 ms
34,596 KB
testcase_20 AC 135 ms
18,320 KB
testcase_21 AC 12 ms
5,956 KB
testcase_22 AC 11 ms
5,960 KB
testcase_23 AC 11 ms
6,148 KB
testcase_24 AC 11 ms
6,040 KB
testcase_25 AC 11 ms
6,128 KB
testcase_26 AC 11 ms
5,968 KB
testcase_27 AC 11 ms
6,092 KB
testcase_28 AC 11 ms
5,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
a = map(int,raw_input().split())
b = [0]*N
nxt = range(1,N+1); d = dict()
for i,v in enumerate(a):
	if v in d: d[v][1] = i
	else: d[v] = [i,i]
S = d.items()
S.sort(reverse = True)
for k,(l,r) in S:
	while l <= r:
		if b[l] == 0: b[l] = k
		nxt[l],l = r,nxt[l]
	nxt[r] = l
print " ".join(map(str,b))
0