#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10;
const int MAXM = 6;
bitset<MAXN> v[MAXM][27];
string s[MAXN];
int n,m;
int rs;
bitset<MAXN> ones;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
cin>>n>>m;
for(int t=0;t<n;t++){
cin>>s[t];
for(int j = 0;j<m;j++){
if(s[t][j] == '?'){
for(int i=0;i<27;i++){
v[j][i][t] = 1;
}
}else{
v[j][s[t][j] - 'a'][t] = 1;
}
}
}
for(int i=0;i<n;i++) ones[i] = 1;
for(int i=0;i<n;i++){
ones[i] = 0;
bitset<MAXN> good = ones;
for(int j=0;j<m;j++){
if(s[i][j] == '?') continue;
good &= v[j][s[i][j] - 'a'];
//cout<<s[i]<<": "<<good<<" - "<<v[j][s[i][j] - 'a']<<endl;
}
rs += good.count();
}
cout<<rs;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
508 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
508 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
424 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |