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;
long long n, m, cnt = 0;
bool check = 0;
int main()
{
cin >> n >> m;
string s[n + 1];
for(int i = 1; i <= n; ++i)
{
cin >> s[i];
for(int j = 0; j < m; ++j) s[i][j] -= '0';
}
for(int i = 1; i <= n; ++i)
{
for(int j = i + 1; j <= n; ++j)
{
for(int k = j + 1; k <= n; ++k)
{
check = 0;
for(int l = 0; l < m; ++l)
{
if((s[i][l] ^ s[j][l] ^ s[k][l]) == 0 || (s[i][l] ^ s[j][l] ^ s[k][l]) == s[i][l]) continue;
else
{
check = 1;
break;
}
}
if(!check)
{
++cnt;
cout << i << j << k << "\n";
}
}
}
}
cout << cnt;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |