-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbee2227.cpp
More file actions
38 lines (29 loc) · 706 Bytes
/
Copy pathbee2227.cpp
File metadata and controls
38 lines (29 loc) · 706 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
/*
* Contest : Beecrowd
* Problem : 2227 - Aeroporto
* Link : https://judge.beecrowd.com/pt/problems/view/2227
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
int main() {
fastio
int a, v, x, y, teste = 1;
while (scanf("%i%i", &a, &v), a && v) {
vector<int> voos(a + 1, 0);
int maior = 0;
for (int i = 0; i < v; i++) {
scanf("%i%i", &x, &y);
voos[x]++;
voos[y]++;
maior = max(maior, max(voos[x], voos[y]));
}
printf("Teste %i\n", teste++);
for (int i = 1; i <= a; i++) {
if (voos[i] == maior) printf("%i ", i);
}
printf("\n\n");
}
return 0;
}