-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10474.cpp
More file actions
32 lines (26 loc) · 720 Bytes
/
10474.cpp
File metadata and controls
32 lines (26 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <bits/stdc++.h>
using namespace std;
int main() {
int a[10001], b[10001];
int m = 0, n, q, i, j;
while (scanf("%d %d", &n, &q)) {
if (n == 0 && q == 0) return 0;
m++;
printf("CASE# %d:\n", m);
for (i = 0; i < n; i++) scanf("%d", &a[i]);
for (i = 0; i < q; i++) scanf("%d", &b[i]);
sort(a, a + n);
for (i = 0; i < q; i++) {
for (j = 0; j < n; j++) {
if (b[i] == a[j]) {
printf("%d found at %d\n", b[i], j + 1);
break;
}
}
if (j == n) {
printf("%d not found\n", b[i]);
}
}
}
return 0;
}