結果

問題 No.318 学学学学学
ユーザー cielciel
提出日時 2015-12-11 07:12:46
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,055 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 61,716 KB
実行使用メモリ 9,340 KB
最終ジャッジ日時 2023-09-04 17:16:45
合計ジャッジ時間 7,639 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
4,376 KB
testcase_01 AC 13 ms
4,376 KB
testcase_02 AC 15 ms
4,484 KB
testcase_03 AC 10 ms
4,380 KB
testcase_04 AC 13 ms
4,380 KB
testcase_05 AC 90 ms
9,340 KB
testcase_06 AC 743 ms
6,180 KB
testcase_07 AC 729 ms
5,136 KB
testcase_08 AC 590 ms
4,380 KB
testcase_09 AC 376 ms
4,376 KB
testcase_10 AC 77 ms
4,376 KB
testcase_11 AC 97 ms
9,336 KB
testcase_12 AC 65 ms
6,252 KB
testcase_13 AC 49 ms
5,112 KB
testcase_14 AC 40 ms
4,376 KB
testcase_15 AC 32 ms
4,376 KB
testcase_16 AC 26 ms
4,376 KB
testcase_17 AC 1,052 ms
6,244 KB
testcase_18 AC 49 ms
6,236 KB
testcase_19 AC 1,055 ms
6,188 KB
testcase_20 AC 24 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <map>
#include <cstdio>
using namespace std;
int main(){
	int N;
	map<int,pair<int,int> >m;
	scanf("%d",&N);
	for(int i=0,x;i<N;i++){
		scanf("%d",&x);
		if(m.find(x)==m.end())m[x]=make_pair(i,i);
		else m[x].second=i;
	}
	vector<int> v(N);
	for(auto &e:m){
		int start=e.second.first,end=e.second.second;
		for(int i=start;i<=end;i++)v[i]=e.first;
	}
	for(int i=0;i<N;i++)printf(i<N-1?"%d ":"%d\n",v[i]);
}
0