-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1471.cpp
More file actions
44 lines (32 loc) · 752 Bytes
/
1471.cpp
File metadata and controls
44 lines (32 loc) · 752 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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool procuraNoVetor(vector<int> v, int num){
for(auto n : v){
if(n == num) return true;
}
return false;
}
int main() {
int N, R, M;
vector<int> voltou;
while(cin >> N >> R) {
for(int i=0; i<R; i++){
cin >> M;
voltou.push_back(M);
}
sort(voltou.begin(), voltou.end());
if(voltou.size() == N){
cout << "*" << endl;
} else {
for(int j=1; j<=N; j++) {
bool v = procuraNoVetor(voltou, j);
if(v == 0) cout << j << " ";
}
cout << endl;
}
voltou.clear();
}
return 0;
}