結果

問題 No.610 区間賞(Section Award)
ユーザー KKT89KKT89
提出日時 2020-07-14 12:18:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 746 bytes
コンパイル時間 1,035 ms
コンパイル使用メモリ 122,856 KB
実行使用メモリ 9,464 KB
最終ジャッジ日時 2024-04-28 13:35:11
合計ジャッジ時間 5,210 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 15 ms
6,940 KB
testcase_20 AC 79 ms
8,704 KB
testcase_21 AC 10 ms
6,944 KB
testcase_22 AC 50 ms
6,940 KB
testcase_23 AC 7 ms
6,940 KB
testcase_24 AC 19 ms
6,940 KB
testcase_25 AC 5 ms
6,940 KB
testcase_26 AC 36 ms
6,940 KB
testcase_27 AC 85 ms
8,704 KB
testcase_28 AC 70 ms
8,192 KB
testcase_29 AC 50 ms
6,940 KB
testcase_30 AC 68 ms
7,680 KB
testcase_31 AC 33 ms
6,940 KB
testcase_32 AC 80 ms
8,192 KB
testcase_33 AC 10 ms
6,940 KB
testcase_34 AC 84 ms
8,704 KB
testcase_35 AC 35 ms
6,944 KB
testcase_36 AC 76 ms
8,448 KB
testcase_37 AC 62 ms
7,680 KB
testcase_38 AC 15 ms
6,944 KB
testcase_39 AC 82 ms
8,832 KB
testcase_40 AC 82 ms
8,832 KB
testcase_41 AC 81 ms
8,832 KB
testcase_42 AC 84 ms
8,832 KB
testcase_43 AC 80 ms
8,832 KB
testcase_44 AC 76 ms
8,388 KB
testcase_45 AC 98 ms
9,132 KB
testcase_46 AC 99 ms
9,464 KB
testcase_47 AC 68 ms
7,936 KB
testcase_48 AC 63 ms
7,552 KB
testcase_49 AC 66 ms
7,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
using namespace std;
typedef long long int ll;
using ull = unsigned long long;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> a(n),b(n);
    vector<int> v;
    map<int,int> mp;
    for(int i=0;i<n;i++){
        cin >> a[i];
        mp[a[i]]=i;
    }
    int mx=-1;
    for(int i=0;i<n;i++){
        cin >> b[i];
        if(mx<mp[b[i]])v.push_back(b[i]);
        mx=max(mx,mp[b[i]]);
    }
    sort(v.begin(), v.end());
    for(int vv:v){
        printf("%d\n",vv);
    }
}
0