#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;
}
if (set == true) ans++;
}
}
}
cout << ans << endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Execution timed out |
1074 ms |
212 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Execution timed out |
1074 ms |
212 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Execution timed out |
1074 ms |
212 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |