#pragma warning(disable:4996)
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
#include<time.h>
#include<map>
#include<set>
#include<sstream>
#include<cassert>
using namespace std;
const int INF = 0x3f3f3f3f;
int a[10005];
int main()
{
int n, m;
cin.sync_with_stdio(false);
int cas = 1;
while (cin >> n >> m, n || m)
{
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
int temp;
cout << "CASE# " << cas++ <<":"<< endl;
for (int i = 0; i < m; i++)
{
bool flag = false;
cin >> temp;
for (int j = 0; j < n; j++)
{
if (a[j] == temp)
{
cout << temp << " found at " << j+1 << endl;
flag = true;
break;
}
}
if (!flag)
cout << temp << " not found" << endl;
}
}
return 0;
}
UVA10474
最新推荐文章于 2021-11-10 11:29:34 发布