#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main()
{
//freopen("input.txt","r",stdin);
int n,q,x,a[10000],Case=0;
while(cin>>n>>q){
if(!n)
break;
Case++;
cout<<"CASE# "<<Case<<":"<<endl;
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;
if(a[p]==x)
cout<<x<<" found at "<<p+1<<endl;
else
cout<<x<<" not found"<<endl;
}
}
return 0;
}
UVA - 10474 Where is the Marble?
最新推荐文章于 2023-01-31 19:44:06 发布