define _CRT_SECURE_NO_WARNI NGS include iostream include cstdio includ

 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <queue>
#include <set>
#include <cassert>
#define inf 1e14
#define eps 1e-8
#define EPS 1e-4
using namespace std;
int n, m;
vector <vector <char> > a, b;
vector <vector <int> > g;
void build(int i) {
for (int k = 0; k < n; ++k) {
bool flag(false);
for (int j = 0; j < m; ++j) {
if (!(a[k][j] == b[i][j] || a[k][j] == '?')) {
flag = true;
break;
}
}
if (flag)
continue;
g[i].push_back(k);
}
}
int main() {
freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
cin >> n >> m;
a.assign(n, vector <char>(m));
b.assign(n, vector <char>(m));
g.resize(n);
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
cin >> a[i][j];
for (int i = 0; i < n; ++i)
for (int j = 0; j < m; ++j)
cin >> b[i][j];
for (int i = 0; i < n; ++i)
build(i);
cout << "mew" << endl;
return 0;
}