General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
44854424 Contestant:
atrophy98
1073B - 11 GNU C++17 Time limit exceeded on test 7 1000 ms 1024 KB 2018-10-25 17:57:50 2018-10-25 17:57:50
 
 
→ 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(){
	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;

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

		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