結果

問題 No.318 学学学学学
ユーザー cielciel
提出日時 2015-12-11 07:07:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,055 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 1,673 ms
コンパイル使用メモリ 61,068 KB
実行使用メモリ 9,332 KB
最終ジャッジ日時 2023-09-04 17:15:17
合計ジャッジ時間 9,462 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
4,380 KB
testcase_01 AC 13 ms
4,380 KB
testcase_02 AC 15 ms
4,428 KB
testcase_03 AC 10 ms
4,376 KB
testcase_04 AC 14 ms
4,376 KB
testcase_05 AC 100 ms
9,256 KB
testcase_06 AC 742 ms
6,128 KB
testcase_07 AC 734 ms
5,168 KB
testcase_08 AC 593 ms
4,376 KB
testcase_09 AC 375 ms
4,380 KB
testcase_10 AC 77 ms
4,376 KB
testcase_11 AC 103 ms
9,332 KB
testcase_12 AC 65 ms
6,160 KB
testcase_13 AC 52 ms
5,160 KB
testcase_14 AC 42 ms
4,376 KB
testcase_15 AC 34 ms
4,380 KB
testcase_16 AC 26 ms
4,380 KB
testcase_17 AC 1,055 ms
6,212 KB
testcase_18 AC 50 ms
6,228 KB
testcase_19 AC 1,054 ms
6,128 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 2 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,376 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