Submission #874549

#TimeUsernameProblemLanguageResultExecution timeMemory
874549Youssif_ElkadiSet (COCI21_set)C++17
10 / 110
1081 ms596 KiB
#include <bits/stdc++.h> using namespace std; const long long N = 5e2 + 5, inf = 1e17 + 5, mod = 998244353; int main() { int n, kk; cin >> n >> kk; vector<string> arr(n); for (int i = 0; i < n; i++) cin >> arr[i]; int cnt = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { int flag = 0; for (int s = 0; s < kk; s++) if ((arr[i][s] == arr[j][s] && arr[j][s] == arr[k][s]) || (arr[i][s] != arr[j][s] && arr[i][s] != arr[k][s] && arr[j][s] != arr[k][s])) flag++; cnt += (flag == kk); } } } cout << cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...