#include<iostream>
#include<vector>
using namespace std;
int main(){
int n, cnt=1, t, a;
cin>>n;
vector<int> v(10005, -1);
for(int i=0; i<n; i++){
cin>>t;
if(v[t]==-1)
v[t]=cnt;
cnt++;
}
cin>>a;
if(a>=0)
cout<<v[a]<<endl;
else
cout<<-1<<endl;
return 0;
}
原文地址:https://www.cnblogs.com/A-Little-Nut/p/10316835.html
时间: 2024-10-17 02:39:57