結果

問題 No.610 区間賞(Section Award)
ユーザー tempura_pptempura_pp
提出日時 2018-06-05 17:50:28
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 853 bytes
コンパイル時間 717 ms
コンパイル使用メモリ 89,768 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 22:28:21
合計ジャッジ時間 4,591 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 12 ms
4,380 KB
testcase_20 AC 51 ms
4,380 KB
testcase_21 AC 9 ms
4,376 KB
testcase_22 AC 35 ms
4,380 KB
testcase_23 AC 6 ms
4,380 KB
testcase_24 AC 13 ms
4,380 KB
testcase_25 AC 4 ms
4,380 KB
testcase_26 AC 24 ms
4,380 KB
testcase_27 AC 51 ms
4,380 KB
testcase_28 AC 45 ms
4,376 KB
testcase_29 AC 33 ms
4,376 KB
testcase_30 AC 42 ms
4,380 KB
testcase_31 AC 22 ms
4,380 KB
testcase_32 AC 48 ms
4,380 KB
testcase_33 AC 8 ms
4,380 KB
testcase_34 AC 51 ms
4,380 KB
testcase_35 AC 25 ms
4,380 KB
testcase_36 AC 50 ms
4,380 KB
testcase_37 AC 41 ms
4,380 KB
testcase_38 AC 12 ms
4,384 KB
testcase_39 AC 53 ms
4,384 KB
testcase_40 AC 52 ms
4,384 KB
testcase_41 AC 53 ms
4,376 KB
testcase_42 AC 53 ms
4,380 KB
testcase_43 AC 53 ms
4,380 KB
testcase_44 AC 158 ms
4,376 KB
testcase_45 AC 188 ms
4,376 KB
testcase_46 AC 191 ms
4,380 KB
testcase_47 AC 44 ms
4,376 KB
testcase_48 AC 40 ms
4,380 KB
testcase_49 AC 45 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef long long ll;
typedef pair<int,int> pint;
const ll mod= 998244353;
const int inf=1e9+7;
const ll  longinf = 1LL<<60;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};

bool used[101010];

int main(){
  int n;cin>>n;
  queue<int> q;
  rep(i,n){
    int x;cin>>x;
    q.push(x);
    }
  vector<int> ans;
  rep(i,n){
    int x;
    cin>>x;
    if(used[x])continue;
    ans.push_back(x);
    while(1){
      int y=q.front();
      q.pop();
      if(x==y)break;
      used[y]=true;
      }
    }
  sort(ans.begin(),ans.end());
  for(auto x:ans)cout<<x<<endl;
  
  return 0;
  }
0