| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339466 | vjudge1 | Parametriziran (COCI19_parametriziran) | C++17 | 110 ms | 2308 KiB |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int MAXN=5e4;
bitset<MAXN> has[6][26];
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];
for(int j=0; j<m; j++)
if(s[j]!=26)
correct&=(has[j][(int)s[j]]|has[j][26]);
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... | ||||
