結果
| 問題 |
No.318 学学学学学
|
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2015-12-11 19:29:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 118 ms / 2,000 ms |
| コード長 | 542 bytes |
| コンパイル時間 | 1,641 ms |
| コンパイル使用メモリ | 172,680 KB |
| 実行使用メモリ | 8,960 KB |
| 最終ジャッジ日時 | 2024-06-22 15:34:23 |
| 合計ジャッジ時間 | 4,328 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
int main() {
int n;cin>>n;
map<int,int> lr;
vector<int> unko(n,-1);
for(int i = 0; i < n; i++){
int num;cin>>num;
if(lr.count(num)==0)unko[i]=num;
lr[num]=i;
}
priority_queue<P> que;
for(int i=0;i<n;i++){
if(unko[i]>=1){
que.push(make_pair(unko[i],lr[unko[i]]));
}
while(que.top().second<i)que.pop();
cout<<(!i)+" "<<que.top().first;
}
cout<<endl;
return 0;
}
btk