-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbingo.cpp
executable file
·48 lines (39 loc) · 931 Bytes
/
bingo.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
38
39
40
41
42
43
44
45
46
47
48
#include <bits/stdc++.h>
#define MAXN 1000
#define MAXK 1000
#define MAXU 10000
using namespace std;
bool cartelas[MAXN][MAXU];
int cnt[MAXN];
vector <int> venceu;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int N, K, U;
cin >> N >> K >> U;
for(int i = 0; i < N; i++){
for(int j = 0; j < K; j++){
int value;
cin >> value;
cartelas[i][value] = true;
}
}
for(int i = 0; i < U; i++){
int value;
cin >> value;
for(int j = 0; j < N; j++){
if(cartelas[j][value]) cnt[j]++;
if(cnt[j] == K){
venceu.push_back(j+1);
}
}
if(!venceu.empty()){
for(int j = 0; j < venceu.size(); j++){
cout << venceu[j] << " ";
}
cout << endl;
break;
}
}
return 0;
}
// 100/100