-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1025.cpp
37 lines (27 loc) · 811 Bytes
/
1025.cpp
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
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long llu;
int main(){
llu n, q, it = 0;
vector <llu> marmores;
while(true){
it++;
cin >> n >> q;
if (n == 0 && q == 0) break;
printf("CASE# %llu:\n", it);
for(llu i=0; i<n; i++){
llu temp;
cin >> temp;
marmores.push_back(temp);
}
sort(marmores.begin(), marmores.end());
for(llu i=0; i<q; i++){
llu temp;
cin >> temp;
llu pos = find(marmores.begin(), marmores.end(), temp) - marmores.begin();
if (pos >= n) printf("%llu not found\n", temp);
else printf("%llu found at %llu\n", temp, pos+1);
}
marmores.clear();
}
}