#include <bits/stdc++.h>
using namespace std;
int arr[1001000];
int main()
{
ios::sync_with_stdio(false);
int n, k;
while(cin >> n >> k)
{
int t = -1;
for(int i = 0; i < n; i++)
{
cin >> arr[i];
}
for(int i = 0; i < n; i++)
{
if(arr[i] == k)
{
t = i;
}
}
if(t != -1)
{
cout << t+1 << " " << n-t << endl;
}
else
{
cout << "No" << endl;
}
}
return 0;
}
顺序查找
最新推荐文章于 2018-12-21 15:24:22 发布