結果

問題 No.318 学学学学学
ユーザー cielciel
提出日時 2015-12-11 18:22:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 378 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 62,628 KB
実行使用メモリ 8,516 KB
最終ジャッジ日時 2023-09-04 17:32:13
合計ジャッジ時間 3,719 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
4,376 KB
testcase_01 AC 13 ms
4,376 KB
testcase_02 AC 16 ms
4,376 KB
testcase_03 AC 11 ms
4,376 KB
testcase_04 AC 13 ms
4,384 KB
testcase_05 AC 94 ms
8,456 KB
testcase_06 AC 103 ms
7,528 KB
testcase_07 AC 88 ms
6,692 KB
testcase_08 AC 74 ms
5,732 KB
testcase_09 AC 63 ms
4,936 KB
testcase_10 AC 47 ms
4,380 KB
testcase_11 AC 91 ms
8,428 KB
testcase_12 AC 72 ms
6,076 KB
testcase_13 AC 58 ms
5,260 KB
testcase_14 AC 48 ms
4,804 KB
testcase_15 AC 37 ms
4,380 KB
testcase_16 AC 29 ms
4,380 KB
testcase_17 AC 64 ms
8,516 KB
testcase_18 AC 47 ms
6,144 KB
testcase_19 AC 65 ms
8,516 KB
testcase_20 AC 24 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <map>
#include <cstdio>
int main(){
	int N,x,i=0;scanf("%d",&N);
	std::map<int,int>m,s;
	std::vector<int>v(N),sa(N),sb(N);
	for(;i<N;sb[i]++,m[x]=i++){
		scanf("%d",&x);
		v[i]=x;
		if(m.find(x)==m.end())sa[i]++;else sb[m[x]]--;
	}
	for(i=-1;++i<N;){
		if(sa[i])s[v[i]]=1;
		printf(i<N-1?"%d ":"%d\n",s.rbegin()->first);
		if(sb[i])s.erase(v[i]);
	}
}
0