-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1025.cpp
More file actions
54 lines (43 loc) · 1.16 KB
/
1025.cpp
File metadata and controls
54 lines (43 loc) · 1.16 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int,int> ii;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
int main(){ _
int n,q;
vector<int> pedras;
vector<int>:: iterator it;
int num;
int consulta[q+200];
int count = 0;
do{
cin >> n >> q;
if(n == 0 && q == 0){
break;
}
count++;
for(int i = 0;i<n;i++){
cin >> num;
pedras.pb(num);
}
sort(pedras.begin(), pedras.end());
cout << "CASE# " << count << ":" << endl;
for(int i = 0;i<q;i++){
cin >> consulta[i];
it = find(pedras.begin(), pedras.end(), consulta[i]);
if(it != pedras.end()){
cout << consulta[i] << " found at " << it - pedras.begin() + 1 << endl;
}else{
cout << consulta[i] << " not found" << endl;
}
}
consulta[q+200] = {0};
pedras.clear();
}while(n != 0 && q != 0);
}