結果

問題 No.318 学学学学学
ユーザー fiordfiord
提出日時 2015-12-16 13:44:28
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,475 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 154,032 KB
実行使用メモリ 14,716 KB
最終ジャッジ日時 2023-09-04 18:11:54
合計ジャッジ時間 10,997 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
4,516 KB
testcase_01 AC 19 ms
5,460 KB
testcase_02 AC 22 ms
5,856 KB
testcase_03 AC 15 ms
5,312 KB
testcase_04 AC 19 ms
5,552 KB
testcase_05 AC 129 ms
14,668 KB
testcase_06 AC 1,051 ms
9,384 KB
testcase_07 AC 1,041 ms
7,804 KB
testcase_08 AC 842 ms
6,760 KB
testcase_09 AC 536 ms
5,804 KB
testcase_10 AC 114 ms
4,592 KB
testcase_11 AC 139 ms
14,716 KB
testcase_12 AC 95 ms
9,336 KB
testcase_13 AC 78 ms
7,656 KB
testcase_14 AC 69 ms
6,232 KB
testcase_15 AC 61 ms
5,540 KB
testcase_16 AC 50 ms
4,384 KB
testcase_17 AC 1,475 ms
9,516 KB
testcase_18 AC 64 ms
9,392 KB
testcase_19 AC 1,473 ms
9,388 KB
testcase_20 AC 37 ms
4,380 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;	cin>>n;
	vector<int> a(n);
	map<int,vector<int>> ls;
	for(int i=0;i<n;i++){
		cin>>a[i];
		ls[a[i]].push_back(i);
	}
	vector<int> b=a;
	for(auto i=ls.begin();i!=ls.end();i++){
		int e=i->second.size();
		for(int j=i->second[0];j<=i->second[e-1];j++){
			b[j]=i->first;
		}
	}
	for(int i=0;i<(int)b.size();i++)	cout<<(i?" ":"")<<b[i];
	cout<<endl;
	return 0;
}
	
0