| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1339470 | po_rag526 | Parametriziran (COCI19_parametriziran) | C++17 | 208 ms | 2980 KiB |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int MAXN=5e4;
bitset<MAXN> has[6][27];
bitset<MAXN> aux;
bitset<MAXN> correct;
string s1[MAXN];
int main()
{
int n, m;
cin>>n>>m;
long long ans=0;
for(int i=0; i<n; i++){
string s;
cin>>s;
for(int j=0; j<m; j++){
if(s[j]!='?')
s[j]-='a';
else
s[j]=26;
has[j][(int)s[j]][i]=1;
}
s1[i]=s;
}
aux.set();
for(int i=0; i<n; i++){
correct=aux;
string s=s1[i];
int ok=1;
for(int j=0; j<m; j++)
if(s[j]!=26){
correct&=(has[j][(int)s[j]]|has[j][26]);
ok=0;
}
if(ok==1)
ans+=n;
else
ans+=correct.count();
}
ans-=n;
ans/=2;
cout<<ans<<"\n";
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
