結果

問題 No.610 区間賞(Section Award)
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2017-12-11 18:53:55
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 569 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 66,092 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-07 17:08:30
合計ジャッジ時間 4,092 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 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 RE -
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 RE -
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 RE -
testcase_19 AC 11 ms
6,944 KB
testcase_20 AC 53 ms
6,940 KB
testcase_21 AC 9 ms
6,944 KB
testcase_22 AC 36 ms
6,940 KB
testcase_23 AC 6 ms
6,940 KB
testcase_24 AC 15 ms
6,940 KB
testcase_25 AC 4 ms
6,940 KB
testcase_26 AC 25 ms
6,940 KB
testcase_27 AC 53 ms
6,940 KB
testcase_28 AC 45 ms
6,940 KB
testcase_29 AC 33 ms
6,940 KB
testcase_30 AC 43 ms
6,940 KB
testcase_31 AC 23 ms
6,944 KB
testcase_32 AC 50 ms
6,944 KB
testcase_33 AC 8 ms
6,944 KB
testcase_34 AC 56 ms
6,940 KB
testcase_35 AC 26 ms
6,944 KB
testcase_36 AC 53 ms
6,940 KB
testcase_37 AC 43 ms
6,944 KB
testcase_38 AC 12 ms
6,940 KB
testcase_39 AC 57 ms
6,940 KB
testcase_40 AC 53 ms
6,940 KB
testcase_41 AC 54 ms
6,940 KB
testcase_42 AC 52 ms
6,940 KB
testcase_43 AC 53 ms
6,940 KB
testcase_44 AC 147 ms
6,944 KB
testcase_45 AC 182 ms
6,940 KB
testcase_46 AC 183 ms
6,944 KB
testcase_47 AC 46 ms
6,940 KB
testcase_48 AC 43 ms
6,940 KB
testcase_49 AC 46 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)

int main(void){
    int n;
    cin >> n;

    vector<int> s(n),t(n),w(n),ans;
    
    REP(i,n) cin >> s[i];
    REP(i,n) cin >> t[i];
    REP(i,n) w[s[i]] = i;
    
    int j = -1;
    REP(i,n) {
        if(w[t[i]] > j){
            ans.push_back(t[i]);
            j = w[t[i]];
        }
    }
    
    sort(ans.begin(), ans.end());
    for(vector<int>::iterator it = ans.begin(); it != ans.end(); it++){
        cout << *it <<endl;
    }
}
0