結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
4,380 KB
testcase_01 AC 12 ms
4,384 KB
testcase_02 AC 15 ms
4,508 KB
testcase_03 AC 11 ms
4,380 KB
testcase_04 AC 13 ms
4,384 KB
testcase_05 AC 101 ms
9,276 KB
testcase_06 AC 1,012 ms
6,120 KB
testcase_07 AC 1,008 ms
5,132 KB
testcase_08 AC 811 ms
4,380 KB
testcase_09 AC 509 ms
4,380 KB
testcase_10 AC 94 ms
4,384 KB
testcase_11 AC 90 ms
9,248 KB
testcase_12 AC 60 ms
6,176 KB
testcase_13 AC 52 ms
5,120 KB
testcase_14 AC 41 ms
4,384 KB
testcase_15 AC 32 ms
4,384 KB
testcase_16 AC 26 ms
4,384 KB
testcase_17 AC 1,466 ms
6,172 KB
testcase_18 AC 48 ms
6,124 KB
testcase_19 AC 1,463 ms
6,184 KB
testcase_20 AC 25 ms
4,384 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,384 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,384 KB
testcase_28 AC 2 ms
4,384 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)for(int i=e.second.first;i<=e.second.second;i++)v[i]=e.first;
	for(int i=0;i<N;i++)printf(i<N-1?"%d ":"%d\n",v[i]);
}
0