-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathw3_p3.cpp
More file actions
44 lines (35 loc) · 798 Bytes
/
Copy pathw3_p3.cpp
File metadata and controls
44 lines (35 loc) · 798 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
33
34
35
36
37
38
39
40
41
42
43
44
#include <bits/stdc++.h>
#define total_top_num 4
using namespace std;
int main()
{
cin.tie(nullptr), ios::sync_with_stdio(false);
map<int, int> container;
int N;
cin >> N;
for (int i = 0; i < N; i++)
{
int product;
cin >> product;
container.insert({product, i + 1});
}
int ppl;
cin >> ppl;
for (int i = 0; i < ppl; i++)
{
int request;
cin >> request;
if (container.find(request) != container.end())
{
if (container[request] > 0)
{
cout << container[request] << endl;
container[request] = -1;
}
else
cout << "empty" << endl;
}
else
cout << "invalid" << endl;
}
}