Submission #655518

#TimeUsernameProblemLanguageResultExecution timeMemory
655518googleSet (COCI21_set)C++17
40 / 110
1078 ms80888 KiB
#include<bits/stdc++.h> using namespace std; int n,k,a,b; set<string> v; vector<string> vec; string s; int main(){ cin.tie(0)->sync_with_stdio(0); cin >> n >> k; for (int i = 0;i<n;i++) { cin >> s; v.insert(s); vec.push_back(s); } int ans = 0; for (int i = 0;i<n;i++){ for (int j = i+1;j<n;j++){ string sr; for (int c = 0;c<k;c++){ if (vec[i][c] == vec[j][c]) sr += vec[i][c]; else { char t = 6-vec[i][c]-vec[j][c]+'0'*3; sr += t; } } ans += v.count(sr); } } cout << ans/3; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...