#include <iostream>
#include <algorithm>
using namespace std;
main()
{
int n, q, x, a[10000], k = 0;
while(cin >> n >> q)
{
cout << "CASE#" << k << ":" << endl;
k++;
for(int i = 0; i < n; i++)
{
cin >> a[i];
}
sort(a, a+n);
while(q--)
{
cin >> x;
int p = lower_bound(a, a+n, x) - a; //在已知数组a中寻找x
if(a[p] == x)
cout << x << " found at " << p << endl;
else
cout << x << " not found" << endl;
}
}
}
111
最新推荐文章于 2024-10-28 15:40:12 发布