結果

問題 No.610 区間賞(Section Award)
ユーザー PulmnPulmn
提出日時 2018-07-25 18:54:28
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 197 ms / 2,000 ms
コード長 1,069 bytes
コンパイル時間 2,590 ms
コンパイル使用メモリ 152,844 KB
実行使用メモリ 5,712 KB
最終ジャッジ日時 2023-09-09 04:33:45
合計ジャッジ時間 6,832 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 12 ms
4,380 KB
testcase_20 AC 55 ms
4,948 KB
testcase_21 AC 8 ms
4,376 KB
testcase_22 AC 37 ms
4,420 KB
testcase_23 AC 6 ms
4,380 KB
testcase_24 AC 15 ms
4,380 KB
testcase_25 AC 5 ms
4,380 KB
testcase_26 AC 25 ms
4,376 KB
testcase_27 AC 54 ms
4,848 KB
testcase_28 AC 48 ms
4,660 KB
testcase_29 AC 35 ms
4,380 KB
testcase_30 AC 44 ms
4,704 KB
testcase_31 AC 24 ms
4,376 KB
testcase_32 AC 52 ms
4,796 KB
testcase_33 AC 8 ms
4,376 KB
testcase_34 AC 54 ms
4,976 KB
testcase_35 AC 26 ms
4,380 KB
testcase_36 AC 53 ms
4,800 KB
testcase_37 AC 43 ms
4,648 KB
testcase_38 AC 13 ms
4,504 KB
testcase_39 AC 57 ms
4,908 KB
testcase_40 AC 55 ms
4,888 KB
testcase_41 AC 56 ms
4,884 KB
testcase_42 AC 57 ms
4,800 KB
testcase_43 AC 57 ms
5,152 KB
testcase_44 AC 159 ms
5,564 KB
testcase_45 AC 191 ms
5,672 KB
testcase_46 AC 197 ms
5,712 KB
testcase_47 AC 47 ms
4,528 KB
testcase_48 AC 43 ms
4,892 KB
testcase_49 AC 47 ms
4,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<27;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-18;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n;
vi a,b;

int main(){
	cin>>n;
	a=b=vi(n);
	vi a_(n),b_(n),c(n+1,-1),A;
	for(int i=0;i<n;i++){
		cin>>a[i];
		a[i]--;
		a_[a[i]]=i;
	}
	for(int i=0;i<n;i++){
		cin>>b[i];
		b[i]--;
		b_[b[i]]=i;
		c[i+1]=a_[b[i]];
	}
	for(int i=1;i<=n;i++) c[i]=max(c[i],c[i-1]);
	for(int i=0;i<n;i++) if(c[b_[a[i]]]<i) A.push_back(a[i]);
	sort(A.begin(),A.end());
	for(auto i:A) cout<<i+1<<endl;
}
0