This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k; cin >> n >> k;
int ans = 0;
string arr[300];
for (int i = 0; i < n; i++) cin >> arr[i];
for (int i = 0; i < n; i++) {
for (int j = i+1; j < n; j++) {
for (int x = j+1; x < n; x++) {
string a, b, c;
a = arr[i]; b = arr[j]; c = arr[x];
bool set = true;
int count = 0;
while (set == true) {
if (a[count] == b[count] && b[count] == c[count]) set = true;
else if (a[count] != b[count] && b[count] != c[count] && a[count] != c[count]) set = true;
else set = false;
count++;
}
if (set == true) ans++;
}
}
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |