Information
- ID
- 1834
- Time
- 1000ms
- Memory
- 512MiB
- Difficulty
- 4
- Tags
- # Submissions
- 44
- Accepted
- 21
- Uploaded By
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e4+10;
int a[N],sum;
int main()
{
int n,y;cin>>n;
int pos = -1;
for(int i = 1;i <= n;i++)
{
cin>>a[i];
}
cin>>y;
for(int i = 1;i <= n;i++)
{
if(a[i] == y)
{
pos = i;
break;
}
}
cout<<pos<<"\n";
return 0;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.