General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
44899490 Practice:
atrophy98
1073B - 11 GNU C++17 Accepted 530 ms 1812 KB 2018-10-26 11:24:27 2018-10-26 11:24:27
 
 
→ Source
#include<bits/stdc++.h>
#define ll long long 
#define ld long double
#define X first
#define Y second
#define pb push_back
#define max_el(x) max_element(x.begin(),x.end())-x.begin()
#define min_el(x) min_element(x.begin(),x.end())-x.begin()
#define mp make_pair
#define endl '\n'
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main(){
	// fastread;
	int n;
	cin>>n;
	vector<int> a(n+1);
	for(int i=0;i<n;i++){
		int u;cin>>u;
		a[u] = i;
	}

	int cur = 0;
	vector<int> b(n);

	for(int i=0;i<n;i++){
		cin>>b[i];
	}

	for(int i=0;i<n;i++){
		int pos= a[b[i]];

		if(pos >= cur){
			cout<<pos-cur+1<<endl;
			cur = pos+1;
		}
		else{
			cout<<0<<endl;
		}
		
	}
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details