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>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
#define lg long long
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main()
{
fastio;
lg n, k;
cin >> n >> k;
vector<string> v(n);
for(int i = 0; i < n; i++) cin >> v[i];
lg ans = 0;
for(int j = 0; j < n; j++)
{
for(int z = j+1; z < n; z++)
{
for(int l = z+1; l < n; l++)
{
lg b = 1;
for(int h = 0; h < k; h++)
{
if(v[j][h] == v[z][h] && v[l][h] == v[z][h])
{
continue;
}
if(v[j][h] != v[z][h] && v[z][h] != v[l][h] && v[j][h] != v[l][h])
{
continue;
}
b = 0;
break;
}
ans += b;
}
}
}
cout << ans << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |