Submission #96604

#TimeUsernameProblemLanguageResultExecution timeMemory
96604tpoppoParametriziran (COCI19_parametriziran)C++14
0 / 110
3077 ms1528 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 5e4 + 100; const int MAXM = 6; bitset<27*MAXM> v[MAXN]; int n,m; int rs; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cin>>n>>m; for(int t=0;t<n;t++){ string s; cin>>s; for(int i=0;i<m;i++){ if(s[i] == '?'){ for(int j=0;j<27;j++){ v[t][27*i + j] = 1; } }else{ v[t][27*i + s[i] - 'a'] = 1; } } } for(int i=0;i<n;i++){ //cout<<i<<": "<<v[i]<<endl; for(int j=i+1;j<n;j++){ bool f = true; bitset<27*MAXM> bt = (v[i]&v[j]); int cnt = bt.count(); for(int i=0;i<m;i++){ bt>>=27; int tmp = bt.count(); if(tmp == cnt ){ f = false; break; } cnt = tmp; } rs += f; } } cout<<rs; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...